Re: [Exim] Checking for sender_host_address

Top Page
Delete this message
Reply to this message
Author: Dave Lewney
Date:  
To: exim-users
Subject: Re: [Exim] Checking for sender_host_address
Philip Hazel wrote:
>
> On Tue, 25 Jan 2000, Dave Lewney wrote:
>
> > I need to check whether a message has been sent from one of our
> > own networks which are of form
> >
> > a.b.c.d/19
> > e.f.g.h/20
> > j.k.l.m/21
> >
> > Is there an easier way than a long-winded check on $sender_host_address
> > with net19-lsearch;/my/networks
> >      net20-lsearch;/my/networks   and then
> >      net21-lsearch;/my/networks

>
> If you have enough of them to need to put them in a file, and you are
> testing the variable in some expanded string, then the answer is no. If
> there are only three of them, you can of course do the test in-line:
>
> ${if or {
> {eq {${mask:$sender_host_address/19}} {10.9.8.7/19}}
> {eq {${mask:$sender_host_address/20}} {10.9.8.8/20}}
> {eq {${mask:$sender_host_address/21}} {10.9.8.9/21}}
> } {yes-string}{no-string}}
> ...


Trying the in-line test, "mask" looks like an expansion operator
but exim v3.03 does not recognise it ...

2000-01-27 15:15:22 12DUSY-0002x9-00 failed to expand condition"${if
...
for lookuphost router: unknown expansion operator "mask"

Has the mask expansion operator appeared since v3.03 ?

Dave
---
Dave Lewney  
Unix System Manager             Email:  D.M.Lewney@??? 
University of Brighton          phone:  01273 642669
UK                              fax:    01273 642666