[exim] LDAP lookups for domainlist local_domains

Top Page
Delete this message
Reply to this message
Author: Andy Rabagliati
Date:  
To: exim-users
Subject: [exim] LDAP lookups for domainlist local_domains
Folks,

I would like local_domains to be set from an LDAP lookup. I use
powerdns, and serve DNS out of this LDAP tree, and anticipate having a
lot of domains here.

My LDAP entries look like this :-

dn: dc=_forward_,ou=Computers,dc=aims,o=ami-net
dc: _forward_
objectClass: dNSDomain
objectClass: domainRelatedObject
mXRecord: 10 smtp.aims.ac.za.
mXRecord: 20 frogfoot.ami-net.org.
nSRecord: ns1.aims.ac.za.
nSRecord: ns2.aims.ac.za.
nSRecord: frogfoot.ami-net.org.
associatedDomain: aims.ac.za
businessCategory: Server
sOARecord: ns2.aims.ac.za hostmaster@??? 1171107778 1800 3600 1814400 84600

dn: dc=_aminet_,ou=Computers,dc=aims,o=ami-net
dc: _aminet_
objectClass: dNSDomain
objectClass: domainRelatedObject
mXRecord: 10 smtp.aims.ac.za.
mXRecord: 20 frogfoot.ami-net.org.
nSRecord: ns1.aims.ac.za.
nSRecord: ns2.aims.ac.za.
nSRecord: frogfoot.ami-net.org.
associatedDomain: ami-net.org
businessCategory: Server
sOARecord: ns2.aims.ac.za hostmaster@??? 1171107778 1800 3600 1814400 84600

I would like an LDAP lookup to return all 'associatedDomain' entries
for which we are listed as an mXRecord.

I found this on Mr. Google :-
http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20050207/msg00019.html

So I tried this :-

LOCAL_LAN = 192.168.42.0/24
LDAP_HOST = localhost
LDAP_BASE = dc=aims,o=ami-net

domainlist local_domains = ${tr {${lookup ldapm{ \
    ldap://LDAP_HOST/ou=Computers,LDAP_BASE?associatedDomain?one?(mXRecord=10 smtp.aims.ac.za.)}}} {\n}{:}}


It works !!
But I need a wildcard on the MX record, like so :-

domainlist local_domains = ${tr {${lookup ldapm{ \
    ldap://LDAP_HOST/ou=Computers,LDAP_BASE?associatedDomain?one?(mXRecord=*smtp.aims.ac.za*)}}} {\n}{:}}


No Go. Any help there, please ?

Cheers, Andy!

--
African Institute for Mathematical Sciences -- www.aims.ac.za