[exim] Multiple warning headers for multiple RBL matches

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Brian Candler
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: [exim] Multiple warning headers for multiple RBL matches
I would like to use a string expansion to select, for a each individual
recipient, a list of RBLs that they would like their mail filtered against.

It's easy enough to arrange it so that if the source IP matches any one of
the RBLs in the list, the mail is rejected at RCPT TO time.

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

  warn  message = X-RBL-Warning: $dnslist_domain: $dnslist_text
        condition = ${if match {:$address_data:} {:rbl\.foo\.com:}}
        dnslists = rbl.foo.com
        set acl_m0 = ${eval:$acl_m0+1}


  warn  message = X-RBL-Warning: $dnslist_domain: $dnslist_text
        condition = ${if match {:$address_data:} {:rbl\.bar\.com:}}
        dnslists = rbl.bar.com
        set acl_m0 = ${eval:$acl_m0+1}


  warn  message = X-RBL-Warning: $dnslist_domain: $dnslist_text
        condition = ${if match {:$address_data:} {:rbl\.baz\.com:}}
        dnslists = rbl.baz.com
        set acl_m0 = ${eval:$acl_m0+1}


... etc

This is cumbersome if we offer a large range of RBLs to filter against, e.g.
all the various *.blackholes.us lists. And I don't want to lookup all
incoming connections against all RBLs when not required by the recipient.

I think exim 3 had an 'rbl_warn_header' option, which would add multiple
X-RBL-Warning: headers if a site matched multiple RBLs:

  rbl_domains = rbl.foo.com/warn : rbl.bar.com/warn : rbl.baz.com/warn
                # not sure if this could be a string expansion though


Is there any way to simulate this in exim 4, so that I can make my
configuration properly data-driven?

Cheers,

Brian.