[exim] Using a list of REGEX to select hosts

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Marc Perkel
Datum:  
To: 'exim-users@exim.org'
Betreff: [exim] Using a list of REGEX to select hosts
Just sharing a little code that some might find useful. This is a way to
store a list of regular expressions in a file to select a host. What
this does it read a text file and build a regex that looks like:

^.*\.(line1|line2|line3)$

This can be modified and used for anything where you are testing
something against a list.

warn    message = X-Big-Host: $sender_host_name
    condition = ${if match {$sender_host_name}\
{^.*\.\x28${sg{${sg{${sg{${readfile{/etc/exim/acllists/bighosts.txt}{|}}}{\\|+}{|}}}{#.*?\\|}{}}}{\\|\$}{}}\x29\$}{yes}{no}}



List looks like this:

locos\.com
aol\.com
yahoo\..*