Re: [exim] dnslists - how to reject only if sender is in two…

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-users
Subject: Re: [exim] dnslists - how to reject only if sender is in two or more ?
On 19/02/2021 12:28, Gregory Edigarov via Exim-users wrote:
> warn    message       = X-Local-Spam: ***SPAM*** $h_Subject
>             hosts         = !+relay_from_hosts
>             dnslists      = cbl.abuseat.org : sbl-xbl.spamhaus.org :
> bl.spamcop.net


> I want to reject the message completely if sender is in two or more RBLs
> and accept if
> it hits only one.


# args:  rbl name, hit count
# return: hit count
try_rbl:
  accept    !dnslists =    $acl_arg1
  accept    message =    ${eval:$acl_arg2 + 1}


...

warn    set acl_c_cnt =    0
    hosts =        !+relay_from_hosts
    set acl_c_cnt =    ${reduce \
        {cbl.abuseat.org:sbl-xbl.spamhaus.org:bl.spamcop.net} \
        {0} \
        {${acl {try_rbl}{$item}{$value}}} \
            }
    condition =    ${if > {$acl_c_cnt}{0}}
    add_header =    X-Local-Spam: ***SPAM*** $h_Subject


reject    condition =    ${if > {$acl_c_cnt}{1}}


...

--
Cheers,
Jeremy