Re Hello ^^)
Le 02/09/2021 à 20:49, Bill Cole a écrit :
On 2021-09-02 at 06:03:22 UTC-0400 (Thu, 2 Sep 2021 12:03:22 +0200)
Jean-François Bachelet <jfbache...@free.fr>
is rumored to have said:
Hello folks ^^)
I've installed the latest spamassassin version on a new Debian 11
server and configured it to work with Postfix, amavis-new, and clamav.
spamassassin got a user named 'spamd' and is run under it.
sa-update is set on a cron job to automate the update but that fails :(
each day I get that report from cron :
/etc/cron.daily/spamassassin:
mkdir /var/lib/spamassassin/3.004006: Permission denied at
/usr/bin/sa-update line 488.
sa-update failed for unknown reasons.
First, I've thinked that it was a permissions problem for 'spamd'
user to access the '/var/lib/spamassassin' directory, so I've
'chown -r spamd:spamd /var/lib/spamassassin'
Hopefully that was actually "-R"
but even with permissions set to 775 on that directory the update
still fail with the same message.
I just can't set permissions to 777 on that kind of directory (I'm
not mad),
Right. Using 777 (or 666) anywhere except for directories with the
sticky bit set is always wrong.
so what is the real problem with sa-update not working under
spamassassin's own user when on a cron job on debian 11 ?
You need to run the sa-update cron job as the same user that INSTALLED
SpamAssassin, the user who OWNS the local state directory (i.e.
/var/lib/spamassassin.) You can make that happen by properly modifying
the ownership of the directory or by running the cron job as root.
This was also my answer to the (not-a-)bug report that you opened.
There really isn't another answer.
here is the conf files that activate the cron job : (I'm using nano line
numbered so ignore)
1 # /etc/default/spamassassin
2 # Duncan Findlay
3
4 # WARNING: please read README.spamd before using.
5 # There may be security risks.
6
7 # Prior to version 3.4.2-1, spamd could be enabled by setting
8 # ENABLED=1 in this file. This is no longer supported. Instead, please
9 # use the update-rc.d command, invoked for example as "update-rc.d
10 # spamassassin enable", to enable the spamd service.
11
12 # Options
13 # See man spamd for possible options. The -d option is automatically
added.
14
15 # SpamAssassin uses a preforking model, so be careful! You need to
16 # make sure --max-children is not set to anything higher than 5,
17 # unless you know what you're doing.
18
19 OPTIONS="--create-prefs --max-children 5 --username spamd
--helper-home-dir /var/lib/spamassassin -s /var/lib/spamassassin/spamd.log"
20
21 # Pid file
22 # Where should spamd write its PID to file? If you use the -u or
23 # --username option above, this needs to be writable by that user.
24 # Otherwise, the init script will not be able to shut spamd down.
25 #PIDFILE="/var/run/spamd.pid"
26
27 # Set nice level of spamd
28 #NICE="--nicelevel 15"
29
30 # Cronjob
31 # Set to anything but 0 to enable the cron job to automatically update
32 # spamassassin's rules on a nightly basis
33 CRON=1
34
is there something wrong / forgotten there ?
Jeff