Re: [exim] How to disable spamassassin for outgoing messages…

Top Page
Delete this message
Reply to this message
Author: Andrew D
Date:  
To: exim-users
Subject: Re: [exim] How to disable spamassassin for outgoing messages?
Hi there,
One thing to keep in mind is that ACLs are processed in order.

On 18/03/2016 6:28 PM, pencho kuncho wrote:
> Hi,
>
>      Sorry about that.

>
>        Yes, my config is close to default. But i think there is other problem. I want to get report scores in header of messages. So, when i set in exim  this config, spamd hangs 100% cpu:

>
>     - warn    message   = X-Spam_score: $spam_score\n\
>     -                                    X-Spam_score_int: $spam_score_int\n\
>     -                                    X-Spam_bar: $spam_bar
>     -                     spam = mail:true


This scans everything but won't put the header in the due to the scan
being after the message (inserting of header) and ALL emails with
attachments are scanned which is causing the cpu usage.

>     - warn    message   = X-Spam_report: $spam_report
>     -                condition = ${if <{$message_size}{100k}{1}{0}}
>     -                      spam = mail:true


Then this adds the message as it now has the information due to the
previous acl.

>
>     If I set this:

>
>     - warn    message   = X-Spam_score: $spam_score\n\
>     -                                    X-Spam_score_int: $spam_score_int\n\
>     -                                    X-Spam_bar: $spam_bar
>     -                condition = ${if <{$message_size}{100k}{1}{0}}
>     -                      spam = mail:true

>
>
>     everything is fine. But then i don't have spam report in mail header.  I was thinking if stop checking outgoing mails, this will help me. Now, i'm not sure. Even i set


This is due to the Spamassassin values being used before it has been filled.

>     - accept authenticated = *
>     -  accept hosts = +trusted_hosts

>
>     this will not help for spamd hangs.


No, but it will for allow outbound emails sent not being scanned, further reducing cpu usage.
The Best way would be to do the following.


accept authenticated = *

accept hosts = +trusted_hosts

warn    condition = ${if <{$message_size}{100k}{1}{0}}
         spam = mail:true
    message   = X-Spam_score: $spam_score\n\
                     X-Spam_score_int: $spam_score_int\n\
                     X-Spam_bar: $spam_bar



So it checks if the sender is authenticated, then if its in the trusted_hosts list. if its in either it accepts the email.
It then checks the size of the email and if its under 100K it continues on to scan the email and then places the header
into the message. This should pretty much knock the cpu usage on its head.

Cheers
cya
Andrew


>
>      Thanks.