Re: [EXIM] Who uses ldap queries?

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: James FitzGibbon
Data:  
Para: michael
CC: exim-users
Assunto: Re: [EXIM] Who uses ldap queries?
On 12 Jan 1999 michael@??? wrote:

> My mail setup consists of various machines, that use a dozen db files to
> lookup e.g. mail aliases. Rdist works fine to distribute those files
> from a controlling server, but I would like to switch to ldap to get
> live updates. Rdist may become a serious bottleneck if my tables grow
> and I expect them to do so rapidly.
>
> Does anybody use ldap to access mail aliases, mail quota and a bunch
> other tables? If so, is it possible to obtain the needed config files
> to for a starting point?


We use LDAP extensively (combined with DBM lookups for legacy data, but
still). We don't use it for quotas (we use NFS quotas for that). Our
config file is somewhat complex because our schema is complex. A quick
example though:

ldap_forwarding_realm:
        driver = aliasfile
        search_type = ldap
        queries =       "ldap:://LDAPSERVER/ldapAuthRealmName=$domain,\
                        ou=UsersByRealm,o=ACC Global Net\
                        ?ldapAuthForwarding\
                        ?sub\
            ?(&(ldapAuthLogin=$local_part)(ldapAuthForwarding=*))\
                        :\
                        ldap:://LDAPSERVER/ldapAuthRealmName=$domain,\
                        ou=UsersByRealm,o=ACC Global Net\
                        ?ldapAuthForwarding\
                        ?sub\
            ?(&(ldapAuthLogin=__catchall__)(ldapAuthForwarding=*))"



This makes two queries. The first is for the entry with ldapAuthRealmName
equal to $domain and ldapAuthLogin equal to $local_part in the
"UsersByRealm" tree. If it finds the entry, it returns the value of
ldapAuthForwarding. The second query (executed only if the first doesn't
return) looks for the special token "__catchall__" in ldapAuthLogin, which
we use to implement "catch-all" aliases.

Those variables are all part of our specific schema, so the layout might
not be immediately obvious to you, but it illustrates a useful query and
Exim's excellent support for LDAP URLs and multiple queries.

--
j.

James FitzGibbon                                                james@???
System Engineer, ACC Global Net                   Voice/Fax (416)207-7171/7610



--
*** Exim information can be found at http://www.exim.org/ ***