Re: [exim] Exim-users Digest, Vol 46, Issue 20

Top Page
Delete this message
Reply to this message
Author: Tony Marsh
Date:  
To: exim-users
Subject: Re: [exim] Exim-users Digest, Vol 46, Issue 20
Ted, That worked like a charm, Thanks!

---------- Forwarded message ----------
From: Ted Cooper <eximX1211@???>
To: exim-users@???
Date: Wed, 12 Mar 2008 11:49:36 +1100
Subject: Re: [exim] no value in $spam_score & $spam_bar
Tony Marsh wrote:
> Hi there,
>
> I've recently shoehorned exim4 & spamassassin onto a linux box I had
> lying around (well, sort of - it's mainly a mythtv box, but that's not
> the problem). Mail is fetched via fetchmail from a pop mailbox, has
> some spamassassin headers removed (thanks to a really badly configured
> mailserver, I can't rely on this instance of spamassassin) fed through
> spamassassin, and then fowarded to a single gmail account. this
> process, is on the whole working fine. Spamassassin is even catching
> spam as fetchmail picks it up, which is great.
>
> But there's a problem.. The 2 variables above are showing up empty in
> the headers of my email, making dealing with what little spam that's
> making it though pretty hard indeed.
>
> To save everyone's mailbox, examples of headers, as well as my exim
> filters are tucked away on pastebin: http://pastebin.ca/938827
>
> Any help will be very much appreciated!
>


While the "message" text is calculated after everything in the ACL has
been run, the "set acl" is run as it is hit in the ACL. Since your "spam
= user" is run AFTER the "set acl", it doesn't have any values in the
spam variables.
Using "spam=user:true" means that the condition returns true regardless
of if the message is spam or not, so you don't need to include it once
SA has been run the first time. The $spam_score and $spam_score_int
variables are completely global and may or may not be cleared between
messages (I can't remember if that was fixed or not).

Try re-arranging the first one as so:

#
# Adds spam score
#
warn message = X-Spam-Score: $spam_score ($spam_bar)
       condition = ${if <{$message_size}{250k}{1}{0}}
       spam = spamassassin:true
# the variables are now set
       set acl_m8 = X-Spam-Score: $spam_score ($spam_bar)


<snip>