Tony Finch wrote:
> (like def, eq, match, etc.). However note that ${lookup
> has built-in ${if-like behaviour...
>
> condition = ${lookup {$interface_address} \
> lsearch {Exim_Tables/aaa_file} \
> { ${lookup {$domain} \
> lsearch {Exim_Tables/bbb_file} \
> {1} {0} } } \
> {0} }
This isn't still doing the right thing. By reading the docs I'd assume
the above to give 'and' like behaviour. But in certain cases it seems
to give 'or' behaviour.
blah_blah:
driver = manualroute
condition = ${lookup {$interface_address} \
lsearch {Exim_Tables/aaa_file} \
{ ${lookup {$domain} \
lsearch {Exim_Tables/bbb_file} \
{1} {0} } } \
{0} }
route_data = ${lookup{$domain}wildlsearch{Exim_Tables/manualroute}}
debug_print = ia: '$interface_address', dom: '$domain'
hosts_randomize
transport = remote_smtp
# exim -oMi 212.74.114.37 -bh 212.74.114.134 -d -bt testing@???
yields:
--------> blah_blah router <--------
local_part=testing domain=tiscali.co.uk
ia: '212.74.114.37', dom: 'tiscali.co.uk'
checking "condition"
search_open: lsearch "/usr/local/exim/tables/aaa_file"
search_find: file="/usr/local/exim/tables/aaa_file"
key="212.74.114.37" partial=-1 affix=NULL starflags=0
LRU list:
9/usr/local/exim/tables/aaa_file
End
internal_search_find: file="/usr/local/exim/tables/aaa_file"
type=lsearch key="212.74.114.37"
file lookup required for 212.74.114.37
in /usr/local/exim/tables/aaa_file
lookup yielded:
search_open: lsearch "/usr/local/exim/tables/bbb_file"
search_find: file="/usr/local/exim/tables/bbb_file"
key="tiscali.co.uk" partial=-1 affix=NULL starflags=0
LRU list:
9/usr/local/exim/tables/bbb_file
9/usr/local/exim/tables/aaa_file
End
internal_search_find: file="/usr/local/exim/tables/bbb_file"
type=lsearch key="tiscali.co.uk"
file lookup required for tiscali.co.uk
in /usr/local/exim/tables/bbb_file
lookup failed
^^^^ the lookup fails, yet....
calling blah_blah router
blah_blah router called for testing@???
domain = tiscali.co.uk
search_open: wildlsearch "/usr/local/exim/tables/manualroute"
search_find: file="/usr/local/exim/tables/manualroute"
key="tiscali.co.uk" partial=-1 affix=NULL starflags=0
LRU list:
C/usr/local/exim/tables/manualroute
9/usr/local/exim/tables/bbb_file
9/usr/local/exim/tables/aaa_file
End
internal_search_find: file="/usr/local/exim/tables/manualroute"
type=wildlsearch key="tiscali.co.uk"
file lookup required for tiscali.co.uk
in /usr/local/exim/tables/manualroute
tiscali.co.uk in "*"? yes (matched "*")
lookup yielded: 212.74.114.38:212.74.114.39:212.74.114.40:212.74.114.47:212.74.114.48 byname
aaa_file contains:
212.74.114.37
bbb_file contains:
aol.com
manualroute contains:
*: 212.74.114.38:212.74.114.39:212.74.114.40:212.74.114.47:212.74.114.48 byname
Its probably something dumb, but I've given up going around in circles...
Any ideas people?
Cheers
D.