Re: [exim] lookup in and

Top Page
Delete this message
Reply to this message
Author: Jakob Hirsch
Date:  
To: 'exim-users@exim.org'
Subject: Re: [exim] lookup in and
On 02.12.2011 01:09, Klaus Ethgen wrote:

>>> ${if and{{={25}{$received_port}}{lookup ldap{...}}}}
>> That's because "and" requires conditions, and a lookup is not a
>> condition.
> lookup ldap{...}{yes}{no} and voila, it is boolean


It may be boolean to you, but for Exim it's still only a string.
What may have confused is that Exim has different requirements for
"condition" depending on the contet. Conditions in ACLs and routers
require a string, conditions in string expansions require a expansion
condition as listed in
http://exim.org/exim-html-current/doc/html/spec_html/ch11.html#SECTexpcond
(or the combination conditions or{} and and{}, but obviously you were
able to find that by yourself).

>> What does your lookup return, anyway?
> anything that exists for this account.


So you want the condition to be true if something is returned? Then
all you need to do is turn the result string into a string expansion
condition, in this case by comparing it to the empty string. Like I
already wrote: and { {...} {ne{}{${lookup ldap{...

> But however, as I posted before I found another way.


Well then, good for you. :)