[Exim] Router preconditions

Góra strony
Delete this message
Reply to this message
Autor: Nico Erfurth
Data:  
Dla: exim-users
Temat: [Exim] Router preconditions
Hi,

i have a problem with the router preconditions, it's not realy a
problem, because it can be avoided with some tricks, but it's a little
bit unclean.

I want a router which checks the personal blacklist of virtual mailaccounts.

First thought was something like that

virtual_blacklist:
driver = redirect
require_files = /etc/exim/blacklists/$domain/$local_part
senders = /etc/exim/blacklists/$domain/$local_part
allow_fail
data = :fail: Blacklisted

Looks good, BUT senders is checked BEFORE require_files, so this will
not work, because the file does not exist in every case, ok, next try

virtual_blacklist:
   driver = redirect
   require_files = /etc/exim/blacklists/$domain/$local_part
   allow_fail
   data = ${lookup {$sender_address}lsearch\
           {/etc/exim/blacklists/$domain/$local_part}}


Looks good too, BUT, with this i can't use funky regular expressions in
the blacklist, MHHHHH, last try

virtual_blacklist:
   driver = redirect
   senders = ${if exists{/etc/exim/blacklists/$domain/$local_part}\
        {${readfile{/etc/exim/blacklists/$domain/$local_part}{:}}}\
        {}}
   allow_fail
   data = :fail: Blacklisted



The last one will work as excpeted, but looks HORRIBLE, IMHO.

Anyone has an better idea?

My suggestion would be to move the require_files conditions at the top
of the router-preconditions, because most options can be used with files
as argument.

ciao

P.S. these routers are not the ones from the configfile, i just wrote
them down from memory, so don't blame me for typos and missing router
options, unless i overlooked one that has to do with the problem itself ;)

ciao