Re: [exim] Not very efficient I believe

Etusivu
Poista viesti
Vastaa
Lähettäjä: Dennis Davis
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Not very efficient I believe
On Thu, 28 Jun 2007, gascione wrote:

> From: gascione <george@???>
> To: exim-users@???
> Date: Thu, 28 Jun 2007 10:00:43 -0400
> Subject: [exim] Not very efficient I believe
>
> 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.


Chapter 41 of the manual:

http://www.exim.org/exim-html-current/doc/html/spec_html/ch41.html#SECTscanspamass

includes the statement:

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.

So your ACL fragment below should be efficient; spamassassin should
only be called once as you're always using the "nobody" username.

> #### Send message to spamassassin for checking
> .ifdef ENABLE_SPAMASSASSIN 
> warn              
> message = X-Spam-Report: $spam_report
> spam = nobody            

>
> warn
> message = X-Spam-Score: $spam_score $spam_bar)
> spam = nobody:true
>
> warn         
> message = X-Spam-Status: YES
> spam = nobody

>
> deny message = Message SPAM score exceeded threshold. Messsage
> Delivery DENIED.
> log_message = SPAM score exceeded
> spam = nobody
> condition = ${if >{$spam_score_int}{80}{1}{0}}         

>
> warn message = X-Spam-Category: HIGH
> spam = nobody
> condition = ${if >{$spam_score_int}{50}{1}{0}}            
> condition = ${if <{$spam_score_int}{80}{1}{0}}

>
> warn message = X-Spam-Category: MEDIUM
> spam = nobody
> condition = ${if >{$spam_score_int}{20}{1}{0}}
> condition = ${if <{$spam_score_int}{50}{1}{0}}
>
> warn message = X-Spam-Category: LOW
> spam = nobody
> condition = ${if >{$spam_score_int}{10}{1}{0}}
> condition = ${if <{$spam_score_int}{20}{1}{0}}
> .endif

-- 
Dennis Davis, BUCS, University of Bath, Bath, BA2 7AY, UK
D.H.Davis@???               Phone: +44 1225 386101