Re: [Exim] LDAP local_domain lookup

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: sysadmin
CC: exim-users
Subject: Re: [Exim] LDAP local_domain lookup
On Wed, 9 Feb 2000, sysadmin wrote:

> I'm attempting to set the
>
> local_domains
>
> variable in my /usr/exim/configure by way of an LDAP lookup.


I wouldn't recommend this, unless you have the LDAP server on the same
host as Exim, and your volumes of mail are low. Exim tests domains for
being local an awful lot.

> ie. local_domains =
> ldapm;ldap::///ou=visps,o=test.com?vispdomainpattern?sub?(vispstatus=active)
>
> Lets say the standard LDAP query (when run in a brower):-
>
> ldap::///ou=visps,o=test.com?vispdomainpattern?sub?(vispstatus=active)
>
> returns two entries:-
>
> somedomain.com
> anotherdomain.com


You have misunderstood the way lookups work in lists like local_domains.
The value returned by the lookup is not used. Exim is merely checking
the existence of the "key" in a file. Take a simpler case

local_domains = lsearch;/some/file

The contents of the file are just a list of domains - no data is needed.
Similarly, if you construct a query for a database, as long as the query
succeeds, the current domain matches the list.

You need to construct an LDAP query that involves $key (which will
contain the domain being tested). I'm not an LDAP person, but it seems
to me that you need to add something like

vispdomainpattern=$key

somewhere in there. (And abandon ldapm.)


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.