[prev in list] [next in list] [prev in thread] [next in thread] 

List:       exim-users
Subject:    Re: [exim] lookup in and
From:       Jakob Hirsch <jh () plonk ! de>
Date:       2011-12-04 10:53:03
Message-ID: 4EDB510F.9030508 () Message-ID ! plonk ! de
[Download RAW message or body]

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. :)

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic