[exim] Creating defer condition when using warn and to test …

Top Page
Delete this message
Reply to this message
Author: Steven Brown
Date:  
To: exim-users
Subject: [exim] Creating defer condition when using warn and to test for SPAM
I am looking for a way to make spam tests skip all further tests if the
first check fails.

The reason for this is if spamd is intermittently failing I can get
incorrect tagging if it fails one test but works on the next. And if spamd
is down completely, I get four attempts to connect to it per message as each
prior test did not return any condition and nothing is cached.

I am thinking about changing my filtering to use a temporary ACL so a
failure on the first test will skip all tests, then defer the message.

Does anyone see any blatant problems with the following configure snippet?
Or have any comments along the lines of "this would work better if you did
it a different way" ?

Note specifically the use of acl_m9 as well as the defer condition at the
bottom.

warn    condition       = ${if < {$message_size}{150K}}
        set acl_m9      = 1
        spam            = nobody
        set acl_m9      = 0
        add_header      = X-Spam-Score: $spam_score\n\
                          X-Spam-Bar: $spam_bar


warn    !condition      = $acl_m9
        condition       = ${if < {$message_size}{150K}}
        spam            = nobody
        condition       = ${if >={$spam_score_int}{50}{1}{0}}
        condition       = ${if <{$spam_score_int}{125}{1}{0}}
        add_header      = X-Spam-Medium: Yes


warn    !condition      = $acl_m9
        condition       = ${if < {$message_size}{150K}}
        spam            = nobody
        condition       = ${if >={$spam_score_int}{125}{1}{0}}
        condition       = ${if <{$spam_score_int}{175}{1}{0}}
        add_header      = X-Spam-High: Yes


warn    !condition      = $acl_m9
        condition       = ${if < {$message_size}{150K}}
        spam            = nobody
        condition       = ${if >={$spam_score_int}{175}{1}{0}}
        add_header      = X-Spam-VeryHigh: Yes


defer   message         = Temporary Scanning Failure
        condition       = $acl_m9