[Exim] How do I test whether an IP is in a range?

Top Page
Delete this message
Reply to this message
Author: Brian Kendig
Date:  
To: exim-users
Subject: [Exim] How do I test whether an IP is in a range?
In exim.conf, how do I test whether an IP address is in a certain
range? I want to check whether incoming email is from my local
network, which is all 10.0.x.x addresses, so I'm trying this test:

${if and {{def:sender_host_address} {!eq
{$sender_host_address}{10.0.0.0/16}} } {1}{0}}

But that's returning true for all sender host addresses. Is there a
different syntax I need to use?

And also, where is this covered in the Exim documentation? I want to
know where I missed it... :-)

(FYI, this test is for SA-Exim to determine whether it should run its
spam filter -- I don't want it to run the filter on mail originating
from my local network. SA-Exim uses the same config file options as
Exim itself.)


  ____    |\/|                 Brian Kendig   Set your priorities right.
  \  /\   / ..__.    brian at enchanter net   No one ever said on his
   \/  \__\   _/   http://www.enchanter.net/  death bed, "Gee, if I'd
    \__   __  \_      Be insatiably curious.  only spent more time at
       \____\___\           Ask "why" a lot.  the office."