Re: [exim] spam acl condition syntax

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Stuart Gall
Datum:  
To: W B Hacker
CC: exim users
Betreff: Re: [exim] spam acl condition syntax

On 13 Oct 2006, at 11:56, W B Hacker wrote:

> Stuart Gall wrote:
>
> *snip*
>
>>
>> So can I infer that spam = X
>> where X is the user of the process under which spamd is running - hmm
>> that wont fly on a virtual host.
>>
>
> Flies just fine here.
>
> Experiment with it while 'tailing' wherever spamd logs in another
> terminal.
>
> Note the effect there of using 'true', OR real shell-account-holder
> names, OR
> non-existent names w/r the euid spamd *reports* running as. PS or
> top may disagree.
>
> AFAICS, the field is a 'DRGAD' on a virtual host, *except* for the
> effect it may
> have on what (little) use spamd has for a $home directory, where it
> logs, dumps
> error output, etc.
>
> IOW - just hasn't seemed to matter...
>
>>
>>> Before reaching this stage, a 'warn' verb was used to set an acl
>>> 'flag' for
>>> certain authenticated clients, etc. This also controlled skipping
>>> other checks.
>>>
>>> And/or you can add the line something like this one:
>>>
>>>     !local_parts = postmaster : abuse : hostmaster

>>
>>
>> I would love to, but I think that I cant use local_parts in the
>> data_acl right ?
>>
>
> AFAIK they are available anytime after acl_smtp_recpt and persist
> until final
> disposition (router/transport actioned).


OK I realy don't see how this can work
the data acl is only called once - right - so if the email is
addressed to multiple recipients with different rejection thresholds
how can it handle that.

From the manual referring to data and predata
For both of these ACLs, it is not possible to reject individual
recipients. An error response rejects the entire message.

>
> NOT SHOWN in first port was what we DO with the (cached) spam
> score, on per-user
> basis.. Per-user prefs are pulled by a lookup at the end of
> acl_smtp_recpt or
> first thing in acl_smtp_predata and loaded into acl_m variables.


Care to post that part, how do you deal with multiple recipients you
must just be picking the first or last perhaps.

>
> You might find something you can more easily adapt in these:
> ## note that I am leaving a spamd call in ALL of them but it only
> need be called
> ## ONCE
> ## you may remove that call from all but the first of whatever you
> use.
> ## note also that these do NOT use headers or reports from SA,
> ## you'd need to add those
>
> =====
>    # DATA_SCAN_11: Put headers in messages when score is over per- 
> recipient limits
>    #
>    warn
>    # logwrite    = DS11 Spam Bars $spam_score
>      !condition  = ${if eq{$acl_m0}{1}}
>      spam        = spamd:true
>      condition   = ${if >{$spam_score_int}{${eval:$acl_m7}}{1}{0}}


this is only run once so $acl_m7 has a unique value, if there are
multiple recipients one must override the others.

BUT you have given me an idea to do something very similar.
I can set $acl_m1 if receipt to postmaster happens
and $acl_m2 if receipt to other happens then do the test
in the data_acl
If the message is ONLY to postmaster ignore spam checks

OK - this is going to work

TVM

>      message     = X-Spam-Bars: ($spam_bar) $spam_score
>      log_message = DS11 Spam Bars header added ($spam_bar) $spam_score

>
>    # DATA_SCAN_12: Modify Subject line with *Suspect* when score is  
> over limit
>    # and prep for divert to quarantine if per-recipient  
> pg_quarantine is set
>    #
>    warn
>    # logwrite    = DS12 Add Suspect to subject $spam_score_int
>      !condition  = ${if eq{$acl_m0}{1}}
>      condition   = ${if >{$spam_score_int}{${eval:$acl_m7}}{1}{0}}
>      spam        = spamd:true
>      add_header  = Subject: *Suspect* $h_Subject:
>      log_message = DS12 *Suspect* header added $spam_score_int

>
>    # DATA_SCAN_13: Quarantine spam at scores above per-recipient  
> setting
>    #
>    warn
>    # logwrite    = DS13 X-Junk header $spam_score_int
>      !condition  = ${if eq{$acl_m0}{1}}
>      condition   = ${if >{$spam_score_int}{${eval:$acl_m8}}{1}{0}}
>      add_header  = X-Junk: HIGHLY SUSPECT MESSAGE!
>      log_message = DS13 $acl_m3 scored $spam_score spam points
>      spam        = spamd:true

>
>    # DATA_SCAN_14: Reject spam outright at scores above per- 
> recipient SPAMLIMIT
>    #
>    discard
>    # logwrite    = DS14 User Spam Reject $spam_score_int
>      !condition  = ${if eq{$acl_m0}{1}}
>      condition   = ${if >{$spam_score_int}{${eval:$acl_m9}}{1}{0}}
>      message     = Classified as spam at $spam_score points
>      log_message = DS14 $acl_m3 scored $spam_score spam points
>      spam        = spamd:true

>
>    # DATA_SCAN_15: Reject spam outright at scores above global  
> SPAMLIMIT
>    # even if per-recipient score is set to a higher number
>    #
>    discard
>    # logwrite    = DS15 Global Spam Reject $spam_score_int
>      !condition  = ${if eq{$acl_m0}{1}}
>      condition   = ${if >{$spam_score_int}{SPAMLIMITINT}{1}{0}}
>      message     = Classified as spam at $spam_score points
>      log_message = D18S13 $acl_m3 scored $spam_score spam points
>      spam        = spamd:true

>
> I won't go into the use of 'discard' at this time - but there are
> significant
> caveats, so you should research and test before use.
>
> Bill
>
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/
>