Re: [exim] Multiple ldap Condition Check

Top Page
Delete this message
Reply to this message
Author: Mark T. Valites
Date:  
To: exim-users
Subject: Re: [exim] Multiple ldap Condition Check
Tony's been great so far - hopefully only one last post from me for a
while...

On Thu, 10 Feb 2005, Tony Finch wrote:

> The arguments to and{} must be expansion conditions, and must be wrapped
> in braces. In your code, ${lookup is not an expansion condition, and is
> not wrapped in braces.
>
> Remember that ${lookup has built in then/else functionality, so you can say:


Hmmm. With that in mind, how would I combine a lookup with a regular
condition - is the (then/else)/and still required?

I want to only run a router if the user exists in ldap and a certain
header isn't set to 'YES" - how would I 'AND' these two conditions:?

condition = ${lookup ldap {ldap:///ou=<ou>,o=<o>?uid?sub?(uid=$local_part)}{true}{false}}
condition = ${if eq {$h_X-Header:}{YES}{no}{yes}}


> condition = ${lookup ldap {ldap://<2nd_ldap_server>/dc=<dc>,dc=<dc>,dc=<dc>?uid?sub?(uid=$local_part)} \
>                 {${lookup ldap {ldap:///ou=<ou>,o=<o>?uid?sub?(uid=$local_part)} \
>                      {yes} {no} }} \
>                 {no} }


This worked great - now I'd like to 'AND' the above two conditions with
the check for a header, namely 'AND' the following three conditions:

condition = ${lookup ldap {ldap:///ou=<ou>,o=<o>?uid?sub?(uid=$local_part)}{true}{false}}
condition = ${lookup ldap {ldap://2nd_ldap_host/dc=<dc>,dc=<dc>,dc=<dc>?uid?sub?(uid=$local_part)}{true}{false}}
condition = ${if eq {$h_X-Header:}{YES}{no}{yes}}

So $local_part has to exist in both directories and the X-Header header
has cannot be set to 'YES'.

-Mark

For those curious, I'm changing my existing mail setup from PAM/
libnss-ldap to ldap and adding a 2nd set of mail domains to deliver to
local users if they exist in two ldap directories.

--
Mark T. Valites
Unix Systems Analyst
Computing & Information Technology
SUNY Geneseo
>--))> >--))>