[Exim] Usage of operators in director condition

Top Page
Delete this message
Reply to this message
Author: Lorenzo Chiavacci
Date:  
To: exim-users
Subject: [Exim] Usage of operators in director condition
Hello everyone,
I am currently using exim 3.33 as the SMTP relay for a Lotus Domino mail
server.
I would like to verify recipients before delivery to Lotus Notes via an
LDAP query.
I am using the following director:

local_not_exists:
       condition = "and { ${lookup ldap
{ldap://172.18.18.20/?mail?subtree?(mail=$local_part@$domain)}{no}{yes}}
${lookup ldap
{ldap://172.18.18.20/?shortname?subtree?(shortname=$local_part@$domain)}{no}{yes}}
}"
         debug_print = "and { ${lookup ldap
{ldap://172.18.18.20/?mail?subtree?(mail=$local_part@$domain)}{no}{yes}}
${lookup ldap
{ldap://172.18.18.20/?shortname?subtree?(shortname=$local_part@$domain)}{no}{yes}}
}"
   driver = smartuser
   transport = rcpt_not_found_autoreply


I need to make two checks on the "mail" and "shortname" LDAP attributes to
take into account both users and groups.
I thought that I needed to use to AND operator to concatenate the two
queries and use the directory and if both queries fail.

I have tested this syntax with exim -d9 -bt and I see a line
and { no yes }
that, in my mind, would mean that the condition is not valid. However this
is not the case and all addresses match the director giving me a wrong
behavior.

Could anyone explain if and how I can concatenate the two LDAP queries to
obtain the expected behavior?

Thank you very much.

Lorenzo Chiavacci