[Exim] Ldap sender_address lookup

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Mark Sapp
Datum:  
To: exim-users
Betreff: [Exim] Ldap sender_address lookup
I would like to enable SMTP AUTH via LDAP with the username/password
query based upon the sender's domain. In essence, the main site will
receive mail from other domains, which happen to be subsidiary
companies. These companies are represented as organizational units
within the root dn...i.e. users at subcompany1.com would be found in
ou=people,ou=subcompany1,dc=maincompany,dc=com

When performing the authorization, I would like to lookup the sender's
email domain in a linear file and grab the appropriate ou name for that
domain. I've tried:
"${lookup ldap {user=\"${lookup \
ldapdn{ldap:///ou=people,ou=${lookup
{$sender_address}lsearch{/etc/ldap.domains}},dc=maincompany,dc=com?sn?sub?(&(uid=$2))}
{$value}{no}}\" pass=$3 \
ldap:///ou=people,ou=${lookup
{$sender_address}lsearch{/etc/ldap.domains}{$value}},dc=maincompany,dc=com?sn?sub?(&(uid=$2))}{yes}{n
o}}"

ldap.domains looks like:
subcompany1.com : subcompany1

The query errors out as a malformed DN - the second ou is blank.

Is this even possible, or should I just put the crack pipe down?

Thanks,
-Mark