[exim] Conditional routing based on source IP

Top Page
Delete this message
Reply to this message
Author: John P Connor
Date:  
To: exim-users
Subject: [exim] Conditional routing based on source IP
Hi

I want to route some mail based on the sending server's IP address. I
know I can do this using a condition like this:

${if {lookup{$sender_host_address}lsearch{/usr/exim/route_by_ip}}{yes}{no}}

on the router. This works fine, but it means that I have to list all the
individual IPs in my file. I'd rather use CIDR notation in the file to
specify ranges and it occurred to me to try something like this:

${if
{lookup{${mask:$sender_host_address/28}}lsearch{/usr/exim/route_by_ip}}{yes}{no}}

but, of course, this fails when the masks are different. Does anyone
have any ideas on how to do this neatly?


Cheers

John