[Exim] Flat-file wildcard lookup in an ACL condition

Top Page
Delete this message
Reply to this message
Author: Adam D. Barratt
Date:  
To: exim-users
Subject: [Exim] Flat-file wildcard lookup in an ACL condition
Hi,

I'm trying to do something that at first glance looks like it should be
simple enough, but having great difficulty making it work in the manner
desired. Please forgive me if I'm missing something obvious; it's been a
long couple of weeks. :-)

We have a file (/etc/exim4/blocked/domains) which contains entries such as:

domain1
*.domain1
domain2
*.domain2

and is used as part of a `senders' clause in the RCPT ACL. That part works
fine. I'm trying to extend this to add a log warning if the connecting
host's HELO matches any entry in the file. As there isn't a `helos' clause
(that would just be too easy :>), I'm trying to fashion something using a
`condition' clause.

A ${lookup won't work, as the file doesn't contain keys with data. The most
successful solution I've found so far was a combination of ${match and
${readfile (matching `.*${sender_helo_name}:.*' in the result of
${readfile{/etc/exim4/blocked/domains}{:}}), which works fine for the
standard `domain1' entry, but obviously won't match `*.domain1'.

Before I give up on the idea, does anyone have any suggestions as to how I
might achieve this?

(Yes, I know thou must not block on HELO, hence it being a `warn').

Cheers,

Adam