From 7498bb1831bd554b6d8d46f6c17897fed56981ef Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 27 Apr 2009 16:16:38 +0200 Subject: [PATCH] exim: Restructure the spam handling acls. Previously, exim would have its own spam score threshold and expect spamassassin to mark any messages as spam (even with negative score), so spam headers could be added on non-rejected messages. Now, we use three acl clauses instead of just one, allowing us to accept the judgment of spamassassin again and add spam headers in a separate clause. --- .../conf.d/acl/40_exim4-config_check_data | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/etc/exim4/conf.d/acl/40_exim4-config_check_data b/etc/exim4/conf.d/acl/40_exim4-config_check_data index a1b7024..58a65f3 100644 --- a/etc/exim4/conf.d/acl/40_exim4-config_check_data +++ b/etc/exim4/conf.d/acl/40_exim4-config_check_data @@ -22,27 +22,21 @@ acl_check_data: message = No verifiable sender address in message headers !verify = header_sender - # Mark messages with their spamscore and deny messages with a very high - # score. + # Don't spamcheck big messages + accept + condition = ${if >{$message_size}{80k}} + add_header = X-Spam-Report: Message too big, not scanned. + + # Deny messages with a large spamscore. The threshold is set by + # spamassassin, see required_score in /etc/spamassassin/local.cf deny message = Message was classified as spam - # Only scan messages that are small, since spam is hardly ever big (and - # scanning big messages costs lots of resources - condition = ${if <{$message_size}{80k}} # Check using spamassasin, running as the "spamd" user. - # This condition will always succeed, since spam assassin is configured - # with a very low (even negative) threshold. spam = spamd - # Add spam headers (these will be added even when the next condition fails - # and the message is not denied). - add_header = X-Spam-Score: $spam_score ($spam_bar) - add_header = X-Spam-Report: $spam_report - # Reject any messages with a spam score of more than 20 ($spam_score_int is - # $spam_score * 10). This is fairly high, but we don't like really - # rejecting messages. - condition = ${if >{$spam_score_int}{200}} - # accept otherwise + # Accept any other messages, but add spam headers. accept + add_header = X-Spam-Score: $spam_score ($spam_bar) + add_header = X-Spam-Report: $spam_report # vim: set sts=2 expandtab sw=2 ai: -- 2.30.2