You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Terence Parker <tp...@deltapath.com> on 2004/12/18 06:56:22 UTC

Running SA globally?

Hi there,

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?

(I would rather if the rules can just be implemented globally as a
system-wide thing, and not a per-user configuration).

Thanks,

Terence


Re: Running SA globally?

Posted by Sam Nilsson <sa...@servingpeace.com>.
Terence Parker wrote:
> Thanks for that.
> 
> I ran sa-learn using the amavis user and indeed, I now get much less 
> spam than before. One thing I haven't done though is checked for 
> false-positives on the server... that's just so much hassle (is there an 
> easy way to do it?).
> 
> Anyways, for now sa-learn seems to have been very effective. You should 
> try it!
> 
> Thanks,
> 
> Terence

Hi Terence,

Cool! I'm glad it had such a great effect. As far as checking for false 
positives, I guess it really depends on how much mail you have to 
process. My server is currently very low volume, so I set amavisd-new to 
quarantine the messages to my email account (over smtp).

Then I filter the mail into 'quarantined-spam' and 'quarantined-viruses' 
folders in my mail client. This way I can see the subject and look at 
the content if necessary. The thing is, with the spam cutoff level of 12 
in amavisd-new, I never once saw a false positive!

Obviously, the 'quarantine-to-email-account' method is not scalable at 
all. You could set up a script to give you a view of the quarantine. For 
instance you could generate an email that simply contains a list of 
message-ids, subjects and senders. This list could only include messages 
that scored between 6 and 15 or something to further streamline your view.

For something more simple, try using something like amavislogsumm 
(listed on the amavisd-new website in the contributed software section) 
to look at the senders and recievers of messages marked as spam as well 
as all kinds of other scoring statistics.

- Sam Nilsson

Re: Running SA globally?

Posted by Terence Parker <tp...@deltapath.com>.
Thanks for that.

I ran sa-learn using the amavis user and indeed, I now get much less 
spam than before. One thing I haven't done though is checked for 
false-positives on the server... that's just so much hassle (is there 
an easy way to do it?).

Anyways, for now sa-learn seems to have been very effective. You should 
try it!

Thanks,

Terence



On 19 Dec 04, at 6:10 AM, Sam Nilsson wrote:

> 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:
>
> --snip--
>
> 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


Re: Running SA globally?

Posted by Sam Nilsson <sa...@servingpeace.com>.
Terence Parker wrote:
> 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