I'm running SpamAssassin 2.64 bundled with Gentoo Linux - interfacing with Postfix via Amavisd-new (e.g. not spamd).
A fairly simple question - when I run "sa-learn --showdots --mbox --spam [file]" (as root), I notice that the Bayes filtering rules get added to /root/.spamassassin . However, with my setup, I presume that SA gets called by Amavis and therefore is called as the 'antivirus' user which I created for amavis? I presume as well then that all the SA settings in /root are completely ignored?
If I ran sa-learn as 'antivirus' and hence had the SA Bayes rules installed in the respective home directory, would this do the trick? Or is there a better way to make these rules global?
Yes, your post makes sense. Since *all* filtered mail goes through amavisd-new, your amavisd-new setup *is* global.
Because amavisd-new *is* run globally as a certain user (for me this is user vscan), so must SA run under that same user since amavisd-new actually runs SA itself. My /etc/passwd entry for my vscan user reads:
vscan:*:1006:1007:Scanning Virus Account:/var/amavis:/bin/sh
The contents of /var/amavis are:
drwxr-x--- 9 vscan vscan 1024 Dec 13 00:27 . drwxr-xr-x 23 root wheel 512 Sep 14 00:12 .. drwxr-x--- 2 vscan vscan 512 Oct 26 02:55 .pyzor drwxr-xr-x 2 vscan vscan 512 Dec 17 03:59 .razor drwx------ 2 vscan vscan 512 Dec 18 14:02 .spamassassin drwxrwx--- 2 root vscan 512 Sep 16 02:04 amavis-client-zz8OLZcI -rw-r----- 1 vscan vscan 0 Oct 26 16:33 amavisd-15035.lock -rw-r----- 1 vscan vscan 0 Oct 26 00:58 amavisd-2125.lock -rw-r----- 1 vscan vscan 0 Oct 26 02:50 amavisd-47974.lock -rw-r----- 1 vscan vscan 0 Oct 26 03:17 amavisd-49248.lock -rw-r----- 1 vscan vscan 0 Oct 26 02:49 amavisd-67713.lock -rw-r----- 1 vscan vscan 0 Nov 8 01:01 amavisd-74288.lock -rw-r----- 1 vscan vscan 0 Oct 26 03:25 amavisd-79926.lock -rw-r----- 1 vscan vscan 0 Nov 10 04:19 amavisd-80723.lock -rw-r----- 1 vscan vscan 0 Oct 26 03:46 amavisd-82747.lock -rw-r----- 1 vscan vscan 0 Oct 26 04:02 amavisd-9520.lock -rw-r----- 1 vscan vscan 0 Dec 18 14:04 amavisd.lock -rw-r----- 1 vscan vscan 5 Dec 13 00:27 amavisd.pid drwxr-x--- 2 vscan vscan 512 Dec 13 00:27 db drwx------ 2 vscan vscan 512 Oct 26 03:52 dot-spamassassin-bak drwxr-x--- 195 vscan vscan 9216 Dec 18 14:02 tmp
So although I haven't needed to use the sa-learn command yet, when I do it will be after doing an "su - vscan". This is true anytime I mess with any of the SA, Pyzor, Razor or Amavisd-new files. FYI, I also use Clamav, which I have also setup to run as the 'vscan' user.
Take Care - Sam