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

--
## List details at https://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