Re: [exim] Multiple warning headers for multiple RBL matches

Top Page
Delete this message
Reply to this message
Author: David Woodhouse
Date:  
To: Brian Candler
CC: exim-users
Subject: Re: [exim] Multiple warning headers for multiple RBL matches
On Wed, 2005-07-13 at 12:41 +0100, Brian Candler wrote:
> But what I want to be able to do is to add warning headers for each selected
> RBL which is matched; in particular, if a source IP matches more than one
> RBL, then to add a separate warning header for each one. (And ideally
> increment a counter, so that if more than N RBLs match, the message can be
> bounced)
>
> I can't see a good way to do this in Exim 4, short of enumerating all
> possible RBL lists in separate ACL lines:
>
> # assume $address_data contains a colon-separated list of RBLs to be used


Try a subroutine something like this (entirely untested):

check_rbls:
# Split first RBL off into acl_m2
warn set acl_m2 = ${sg {$acl_m1}{^([^:]*)}{\$1}}
# Remove it from the list
warn set acl_m1 = ${sg {$acl_m1}{^[^:]*:*}{}}

  warn dnslists = $acl_m2
       set acl_m0 = ${eval:$acl_m0+1}
       message = X-RBL-Warning: $dnslist_domain: $dnslist_text


# Break out of loop if there are no RBLs left in $acl_m1
accept condition = ${if eq {$acl_m1}{} {no}{yes}}

accept acl = check_rbls


.... invoked like this...

warn set acl_m1 = $address_data
warn acl = check_rbls


--
dwmw2