Re: [Exim] exim3 - trying to get lookup to work

Góra strony
Delete this message
Reply to this message
Autor: Nico Erfurth
Data:  
Dla: Chris Huff
CC: 'exim-users@exim.org'
Temat: Re: [Exim] exim3 - trying to get lookup to work
Chris Huff wrote:
> Hi : Im trying to get a router setup in exim 3. I want it to take the IP of
> the remote host and see if it matches a list of IPs i have. I cant get this
> to work but it looks like it should.
>
> sandbox:
> driver = smartuser
> # THIS WORKS --->>> condition = ${if eq {$sender_host_address}
> (10.5.3.39} {yes}{no}}
> condition = ${lookup{$sender_host_address} lsearch
> {/usr/local/exim/dev_addresses}}
> new_address = developers@???
> headers_add = X-From-Host: xxx.com
> errors_to = chuff@???
>
> /usr/local/exim/dev_addresses looks like
> ###########
> 127.0.0.1
> 10.5.3.39
> 10.5.3.16
> 10.5.3.17
> 10.5.3.172
> 10.5.3.176
> 10.5.3.18
> 10.5.3.180
> 10.5.3.181
> 10.5.3.182
> #etc...
> ###########
>
> anyone notice something im doing wrong? Ive never had to make a
> router/director with conditions and string expansions before so im kind of a
> newbie with this.


Your lookup will return an empty string, that makes the condition fail.
Change it to:

condition = ${lookup{$sender_host_address} lsearch\
{/usr/local/exim/dev_addresses}{yes}{no}}

or give every line in dev_addresses a value.

Nico