[Mimedefang] Spamassassin & MimeDefang

Nels Lindquist nlindq at maei.ca
Mon Apr 1 11:53:58 EST 2002


On 28 Mar 2002 at 22:57, Rich West wrote:

> Since 2.x of SpamAssassin, I've been doing the same thing by 
> symbolically linking /etc/maiil/spamassassin.cf to 
> /etc/mail/spamassassin/migrate.cf.
> 
> 
> Is there something else you might be doing within your filter to make it 
> subtract 100 from the spam score?

Not at all; that's handled entirely by SpamAssassin.  I'm just using 
a call to spam_assassin_check, and examining the scores to see if SA 
thinks it's spam:

if ($msgsize <= 256000) {  # Don't scan if message size exceeds 256K
    ($SA_Hits, $SA_Required, $SA_Tests, $report) = 
spam_assassin_check();
} else {
    $SA_Hits=0;
    $SA_Required=5;
    $SA_Tests="MAX_MSG_SIZE_EXCEEDED";
}

if ($SA_Hits && ($SA_Hits >= $SA_Required)) {
    $SpamFound = 1;
}

Later (in filter_end) I'm adding the following headers, which are 
useful for seeing exactly which tests were triggered:

if ($SpamFound) {
    return action_add_header("X-Spam-Status","Yes, hits=$SA_Hits \ 
required=$SA_Required tests=$SA_Tests");
} else {
    return action_add_header("X-Spam-Status","No, hits=$SA_Hits \ 
required=$SA_Required tests=$SA_Tests");
}

Here's what one of the headers looks like for a whitelisted sender:

X-Spam-Status: No, hits=-94.4 required=5 tests=EMAIL_MARKETING,
    CLICK_BELOW,LINE_OF_YELLING,USER_IN_WHITELIST

----
Nels Lindquist <*>
Information Systems Manager
Morningstar Air Express Inc.




More information about the MIMEDefang mailing list