Re: [exim] Not very efficient I believe

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Marc Sherman
Data:  
Para: exim-users
Assunto: Re: [exim] Not very efficient I believe
Ted Cooper wrote:
> gascione wrote:
>> I have the following ACL integrating spamassassin into my exim gateways.
>> I believe it is inefficient because I believe it is sending the message
>> to be evaluated by spamassassin many times. Am I correct and if so how
>> should I construct the logic to achieve the same result.
>
> http://www.exim.org/exim-html-current/doc/html/spec_html/ch41.html#SECID206
>
> "The spam condition caches its results. If you call it again with the
> same user name, it does not scan again, but rather returns the same
> values as before."


There is a nasty failure mode, though, that that kind of config
provokes. If SA times out because the message is too big or somehow
pathological, each spam= line causes it to rescan.

The variables set by the spam condition will remain set for the rest of
the current ACL. Here's the spamassassin portion of my data ACL:

   # If the message is oversized, accept it without spam filtering;
   # Spamassassin times out with messages that are too large
   warn
     message = X-Spam-Projectile: Message too large for Spamassassin \
               (size=$message_size)
     condition = ${if >{$message_size}{200k}}
   accept
     condition = ${if >{$message_size}{200k}}


   # Run spamc as user spamd, and don't defer if spamc fails
   # Set the quarantine flag based on the success/failure of the spam rule
   # (based on the required spam score configured in spamassasin's local.cf)
   warn
     spam = spamd/defer_ok
     set ACL_MSG_QUARANTINE = true


   # Add the spam report header
   warn
     message = X-Spam-Projectile: $spam_report


   # Reject messages which exceed a spam score of 12, only if they are 
either
   # autolearned or already match the BAYES_99 rule.  We've never had
   # a false positive higher than 8.  Note that spam_score_int is the
   # real spam score * 10 and truncated to an integer.
   deny
     message = Rejected spam ($spam_score). \
               Mail postmaster@??? for help.
     !condition = $ACL_MSG_NO_REJECT_SPAM
     condition = ${if >{$spam_score_int}{120}}
     condition = ${if match{$spam_report} \
                 { autolearn=(spam|unavailable)\n| BAYES_99 }}


# accept otherwise
accept