You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Bob Mortimer <Bo...@mortimer.nildram.co.uk> on 2004/02/29 17:29:21 UTC

amavis-d and spamd not working?

I've set up amavis-d and spamassassin on my linux box. When I call spamd via 
the procmailrc file it works fine and inserts headers etc. When I use amavis 
with the spamd bit commented out in the procmailrc file I don't get any spam 
headers and spam gets through fine. It looks as if amavis isn't calling 
spamassassin at all ...

I've stuck amavis on max logging level and get stuff like
 "Feb 29 16:08:54 myhost.mydomain.co.uk amavisd[23540]: (23540-06) TIMING 
[total 341 ms] - SMTP EHLO: 3 (1%), SMTP pre-MAIL: 1 (0%), SMTP 
pre-DATA-flush: 4 (1%), SMTP DATA: 37 (11%), body hash: 0 (0%), mime_decode: 
18 (5%), get-file-type: 16 (5%), decompose_part: 2 (1%), parts: 0 (0%), 
AV-scan-1: 18 (5%), SA msg read: 2 (1%), SA parse: 1 (0%), SA check: 82 
(24%), fwd-connect: 66 (19%), fwd-mail-from: 39 (12%), fwd-rcpt-to: 2 (1%), 
write-header: 8 (2%), fwd-data: 1 (0%), fwd-data-end: 34 (10%), fwd-rundown: 
2 (1%), unlink-1-files: 5 (2%), rundown: 0 (0%)"

This would suggest it *is* calling SA.
My settings in amavisd.conf are:
$sa_tag_level_deflt  = 0.0; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 3.4; # add 'spam detected' headers at that level
$sa_kill_level_deflt = $sa_tag2_level_deflt; # triggers spam evasive actions

Any help appreciated ...

Bob

Re: amavis-d and spamd not working?

Posted by Bob Mortimer <Bo...@mortimer.nildram.co.uk>.
On Monday 01 Mar 2004 6:16 pm, Bob Mortimer wrote:

> > In your amavisd.conf file, set $sa_tag_level_deflt to -99.0 to get
> > the X-Spam-Status header added to all emails.
>
> Seems to make no difference at all - I'm getting it to send a notification
> alert which works OK, but the original spam email just comes through
> without the X-Spam headers.
>

Problem now solved following posting on the amavis-user list - it's to do with 
the @local_domains_acl setting in amavisd.conf
amavis only inserts the X-Spam headers for email addresses it thinks are local
So the line:
@local_domains_acl = ( "." );
tells it *all* domains are local and it does the headers :-/

Thread I was pointed to here if anyone's interested:
http://marc.theaimsgroup.com/?l=amavis-user&m=107764590117010&w=2

-- 
Regards,

Bob

Re: amavis-d and spamd not working?

Posted by Bob Mortimer <Bo...@mortimer.nildram.co.uk>.
On Monday 01 Mar 2004 3:51 pm, Bill Randle wrote:

Thanks again Bill.
<snip>

> > Yes, also found these entries. My amavisd.conf is (I thought!) set up to
> > just pass the mail on. but I thought it should be adding the
> > X-Spam-Status: header, which it isn't. I'll try reverting back to
> > delivering to a different address or quarantining spam.
>
> In your amavisd.conf file, set $sa_tag_level_deflt to -99.0 to get
> the X-Spam-Status header added to all emails.

Seems to make no difference at all - I'm getting it to send a notification 
alert which works OK, but the original spam email just comes through without 
the X-Spam headers.

> > >From looking at all this it looks like amavisd doesn't use spamd but
> > > uses the
> >
> > the Mail::SpamAssassin module which I thought was slower. Also passing
> > direct from amavisd to spamassassin loses the ability to use a local
> > config file for SA (apart from the options in amavisd.conf).
>
> It's not slower because amavisd preloads the SpamAssassin module once at
> startup, similar to what spamd does. The performance hit comes when loading
> the SA module for each messages.
>
> You can still have a local.cf and user_prefs file even when amavisd is
> used. Just put user_prefs in a .spamassassin directory under amavisd's
> home directory (the same place your bayes databases are). For instance,
> on my system:

Ah, didn't know about that one! Seems to work for the threshold, but still no 
X-Spam headers trigger.

> What you don't get (any maybe this is what you were alluding to) is
> per user preferences.

No, I'm happy with per system preferences, but am having trouble getting them 
implemented! I guess I can just carry on using it via procmailrc but it's 
bugging me that I can't get it to work properly!

-- 
Regards,

Bob

Re: amavis-d and spamd not working?

Posted by Bill Randle <bi...@neocat.org>.
On Mon, 2004-03-01 at 03:06, Bob Mortimer wrote:
> On Sunday 29 Feb 2004 11:11 pm, Bill Randle wrote:
> 
[snip]
> > Also, when it runs, you'll see log entries like this ($log_level = 2):
> >
> > Feb 29 15:01:19 filter amavis[13571]: (13571-01) spam_scan: hits=23.422
> > tests=BANG_MORE,BAYES_99,DCC_CHECK,FVGT_b_GVR,FVGT_m_IMAGE_ONLY_SPAM,
> > FVGT_s_VIAGRI,HTML_50_60,HTML_IMAGE_ONLY_02,HTML_MESSAGE,LOCAL_DRUGS_DIET,
> > LOCAL_DRUGS_SLEEP,MRWIGGLY,RM_st_iso8859,T_NUM_IN_DOMAIN_4,T_NUM_IN_DOMAIN_
> >46, T_NUM_IN_DOMAIN_6
> 
> Yes, also found these entries. My amavisd.conf is (I thought!) set up to just 
> pass the mail on. but I thought it should be adding the X-Spam-Status: 
> header, which it isn't. I'll try reverting back to delivering to a different 
> address or quarantining spam.

In your amavisd.conf file, set $sa_tag_level_deflt to -99.0 to get
the X-Spam-Status header added to all emails.
 
> >From looking at all this it looks like amavisd doesn't use spamd but uses the  
> the Mail::SpamAssassin module which I thought was slower. Also passing direct 
> from amavisd to spamassassin loses the ability to use a local config file for 
> SA (apart from the options in amavisd.conf).

It's not slower because amavisd preloads the SpamAssassin module once at startup,
similar to what spamd does. The performance hit comes when loading the
SA module for each messages.

You can still have a local.cf and user_prefs file even when amavisd is
used. Just put user_prefs in a .spamassassin directory under amavisd's
home directory (the same place your bayes databases are). For instance,
on my system:

# ls -l /var/lib/amavis/.spamassassin         
total 20588
-rw-r-----    1 amavis   amavis      37134 Mar  1 07:48 bayes_journal
-rw-r-----    1 amavis   amavis   20934656 Mar  1 07:48 bayes_seen
-rw-------    1 amavis   amavis    4521984 Mar  1 07:48 bayes_toks
-rw-r-----    1 amavis   amavis        762 Jan 18 11:32 user_prefs

What you don't get (any maybe this is what you were alluding to) is
per user preferences.

	-Bill


Re: amavis-d and spamd not working?

Posted by Bob Mortimer <Bo...@mortimer.nildram.co.uk>.
On Sunday 29 Feb 2004 11:11 pm, Bill Randle wrote:

> What do you see in the mail log when amavisd is started? In my case,
> with amavisd-new, I see this:
>
> Feb 29 15:01:51 filter amavis[13758]: Found $unarj      at /usr/bin/arj
> Feb 29 15:01:51 filter amavis[13758]: Found $uncompress at
> /usr/bin/uncompress
> Feb 29 15:01:51 filter amavis[13758]: No $unfreeze,     not using it
> Feb 29 15:01:51 filter amavis[13758]: Found $unrar      at /usr/bin/rar
> Feb 29 15:01:51 filter amavis[13758]: Found $zoo        at /usr/bin/zoo
> Feb 29 15:01:51 filter amavis[13758]: Found $cpio       at /bin/cpio
> Feb 29 15:01:51 filter amavis[13758]: Using internal av scanner code for
> (primary) Clam Antivirus-clamd
> Feb 29 15:01:51 filter amavis[13758]: Found secondary av scanner Clam
> Antivirus - clamscan at /usr/bin/clamscan
> Feb 29 15:01:51 filter amavis[13758]: SpamControl: initializing
> Mail::SpamAssassin
> Feb 29 15:01:55 filter amavis[13758]: SpamControl: done
>
> showing it loaded SpamAssassin and is using it.

Thanks for the reply Bill.
Yep, here are the spam bits:

Mar  1 05:13:24 linux.targa.gotadsl.co.uk amavisd[13841]: Module 
Mail::SpamAssassin  2.55

Mar  1 05:13:24 linux.targa.gotadsl.co.uk amavisd[13841]: ANTI-SPAM  code        
loaded
Mar  1 05:13:24 linux.targa.gotadsl.co.uk amavisd[13842]: SpamControl: 
initializing Mail::SpamAssassin
Mar  1 05:13:24 linux.targa.gotadsl.co.uk amavisd[13842]: SpamControl: turning 
on SA auto-whitelisting (AWL)
Mar  1 05:13:25 linux.targa.gotadsl.co.uk amavisd[13842]: SpamControl: done

Mar  1 05:28:21 linux.targa.gotadsl.co.uk amavisd[13938]: Net::Server: 
Couldn't POSIX::setuid to "79" [Illegal seek]


> Also, when it runs, you'll see log entries like this ($log_level = 2):
>
> Feb 29 15:01:19 filter amavis[13571]: (13571-01) spam_scan: hits=23.422
> tests=BANG_MORE,BAYES_99,DCC_CHECK,FVGT_b_GVR,FVGT_m_IMAGE_ONLY_SPAM,
> FVGT_s_VIAGRI,HTML_50_60,HTML_IMAGE_ONLY_02,HTML_MESSAGE,LOCAL_DRUGS_DIET,
> LOCAL_DRUGS_SLEEP,MRWIGGLY,RM_st_iso8859,T_NUM_IN_DOMAIN_4,T_NUM_IN_DOMAIN_
>46, T_NUM_IN_DOMAIN_6

Yes, also found these entries. My amavisd.conf is (I thought!) set up to just 
pass the mail on. but I thought it should be adding the X-Spam-Status: 
header, which it isn't. I'll try reverting back to delivering to a different 
address or quarantining spam.

From looking at all this it looks like amavisd doesn't use spamd but uses the  
the Mail::SpamAssassin module which I thought was slower. Also passing direct 
from amavisd to spamassassin loses the ability to use a local config file for 
SA (apart from the options in amavisd.conf).

-- 
Regards,

Bob

Re: amavis-d and spamd not working?

Posted by Bill Randle <bi...@neocat.org>.
On Sun, 2004-02-29 at 14:54, John Andersen wrote:
> On Sunday 29 February 2004 07:29, Bob Mortimer wrote:
> > I've set up amavis-d and spamassassin on my linux box. When I call spamd
> > via the procmailrc file it works fine and inserts headers etc. When I use
> > amavis with the spamd bit commented out in the procmailrc file I don't get
> > any spam headers and spam gets through fine. It looks as if amavis isn't
> > calling spamassassin at all ...
> 
> So don't comment it out!!!
> Depending on your mail setup, they are meant to go thru amavis
> and spamd serialy, (one after the other).
> 
> Amavis is triggered by sendmail (or whatever) and then
> the mail is handed off to spamd by procmail just prior
> to final delivery.

True, it depends on your mail configuration, but typically in an
amavisd[-new] setup, SpamAssassin is called directly by amavisd,
so spamd is not needed nor used.

What do you see in the mail log when amavisd is started? In my case,
with amavisd-new, I see this:

Feb 29 15:01:51 filter amavis[13758]: Found $unarj      at /usr/bin/arj
Feb 29 15:01:51 filter amavis[13758]: Found $uncompress at
/usr/bin/uncompress
Feb 29 15:01:51 filter amavis[13758]: No $unfreeze,     not using it
Feb 29 15:01:51 filter amavis[13758]: Found $unrar      at /usr/bin/rar
Feb 29 15:01:51 filter amavis[13758]: Found $zoo        at /usr/bin/zoo
Feb 29 15:01:51 filter amavis[13758]: Found $cpio       at /bin/cpio
Feb 29 15:01:51 filter amavis[13758]: Using internal av scanner code for
(primary) Clam Antivirus-clamd
Feb 29 15:01:51 filter amavis[13758]: Found secondary av scanner Clam
Antivirus - clamscan at /usr/bin/clamscan
Feb 29 15:01:51 filter amavis[13758]: SpamControl: initializing
Mail::SpamAssassin
Feb 29 15:01:55 filter amavis[13758]: SpamControl: done

showing it loaded SpamAssassin and is using it.

Also, when it runs, you'll see log entries like this ($log_level = 2):

Feb 29 15:01:19 filter amavis[13571]: (13571-01) spam_scan: hits=23.422
tests=BANG_MORE,BAYES_99,DCC_CHECK,FVGT_b_GVR,FVGT_m_IMAGE_ONLY_SPAM,
FVGT_s_VIAGRI,HTML_50_60,HTML_IMAGE_ONLY_02,HTML_MESSAGE,LOCAL_DRUGS_DIET,
LOCAL_DRUGS_SLEEP,MRWIGGLY,RM_st_iso8859,T_NUM_IN_DOMAIN_4,T_NUM_IN_DOMAIN_46,
T_NUM_IN_DOMAIN_6

	-Bill



Re: amavis-d and spamd not working?

Posted by John Andersen <js...@pen.homeip.net>.
On Sunday 29 February 2004 07:29, Bob Mortimer wrote:
> I've set up amavis-d and spamassassin on my linux box. When I call spamd
> via the procmailrc file it works fine and inserts headers etc. When I use
> amavis with the spamd bit commented out in the procmailrc file I don't get
> any spam headers and spam gets through fine. It looks as if amavis isn't
> calling spamassassin at all ...

So don't comment it out!!!
Depending on your mail setup, they are meant to go thru amavis
and spamd serialy, (one after the other).

Amavis is triggered by sendmail (or whatever) and then
the mail is handed off to spamd by procmail just prior
to final delivery.

-- 
_____________________________________
John Andersen