Le 2010-08-05 09:40, Andrew D a écrit :
> G'Day,
>
> Alexandre Gagné wrote:
>>  Hi !
>>
>>   I have some user that would prefer to rely on their mail client for
>> spam filtering instead of the server-side anti-spam (spamassassin).
>>
>>   I use MySQL to manage my users, so I added a "enable_antispam" in the
>> table which can be set to "YES" or "NO".
>>
>>   Then I have defined a variable in Exim config, 'ENABLE_ANTISPAM',
>> which do a mysql lookup and get the 'enable_antispam' value.  So
>> 'ENABLE_ANTISPAM' should return 'YES' or 'NO'.
>>
>>   I added a condition to my ACLs that have something to do with spam,
>> and I'm not sure if I done it right.  I did a lot a googling and read
>> exim documentation, but I haven't found anything that make me confident
>> I am doing things right.
>>
>>   Below, the parts in my 'exim.conf' that are concerned.  Does it seems
>> to be right ?  I added my "condition" before those that were already
>> there.  The idea being that if "ENABLE_ANTISPAM" return "NO", I don't
>> wan't to do the spam-check.
>>
>
>
> The issue with this is that the scanning is done at the DATA acl,
> which means variables like $local_part and $domain aren't available,
> due to there possibly being multiple recipients in different domains.
>
> It also means that if an email comes in to multiple recipients and you
> set the ENABLE_ANTISPAM variable to no before hand, none of those
> recipients would have their email scanned.
>
> What you could do is defer (during the rcpt to phase) on those ppl,
> that don't want spam scanning, when in a mutiple rcpt email (defer the
> rest if it is the first rcpt), getting around this issue.
>
> Cheers I hope that helps.
> cya
> Andrew
>

Thanks for everyone answer !  I removed the quotes, and revert the
condition (check if NO instead of YES). So that the condition looks like
this:

condition       = ${if eq {ENABLE_ANTISPAM}{NO}{no}{yes}}

I have noticed after adding some logging to a MySQL table (for reject
mails) that the "local_part" and "domain" are only defined in RCPT acl,
not in DATA and MAIL.  That was part of my problem too.

Am I right to assume that the variable "recipient" in DATA acl will only
contain multiple email address if the email is sent through the same
SMTP server ?  My server need authentication to send emails, so I don't
check SPAM/Greylisting on those emails since it is a trusted user.  I
sent a multiple-recipient emails to a few address destinated to the same
domain from GMail and Hotmail, and they were going through as "single
recipient" email.  Is there cases where it wouldn't be ?

Thanks a lot for the help !
AlexG

-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to