Author: Jeremy Harris Date: To: exim-users Subject: Re: [exim] Cannot negate router lookup condition
On 12/08/2020 21:45, Sebastian Arcus via Exim-users wrote: > I am running Exim 4.89. I have the following router in exim.conf:
>
> send_direct:
> driver = dnslookup
> condition = ! ${lookup{$local_part@$domain}\
> lsearch{/etc/exim/exim.passwd}{$value}{}}
> transport = remote_smtp
That exclamation-mark is not interpreted; it just becomes part
of the string, with the expansion result, being tested by the
"condition" option.
The latter is documented as:
"if the result is [...] one of the strings “0” or “no” or “false”
(checked without regard to the case of the letters), the router is skipped.
So: forget the "!", and just have your lookup returning {0} or {1}.
Put them in *that* order in the ${lookup...} so that your condition
has the truth sense you wanted.
(You were assuming the rules for an ACL condition apply to a router
condition. Sorry. but historical reasons...)
--
Cheers,
Jeremy