Re: [EXIM] Are partial-ldap queries allowed?

Pàgina inicial
Delete this message
Reply to this message
Autor: James FitzGibbon
Data:  
A: michael
CC: exim-users
Assumpte: Re: [EXIM] Are partial-ldap queries allowed?
* michael@??? (michael@???) [990316 03:45]:

> > I have extensive experience using LDAP with Exim, especially with custom
> > schemas. Fire off your questions.
>
> I need to lookup foo.sub.domain in a directory that contains the DN
> dc=sub.domain, so my key is longer than the DN. Partial matching
> would help, if I had the DN dc=*.sub.domain in the directory.


You could use the 'queries' search type instead of 'query' to simulate a
partial search:

queries = "ldap:://ldapserver/dn...?attr?sub?dc=$domain:\
           ldap:://ldapserver/dn...?attr?sub?\
               dc=*.${extract{2}{.}{$domain}}${extract{3}{.}{$domain}"


Which should (if domain is "foo.sub.domain") look for "dc=foo.sub.domain"
then look for "dc=*.sub.domain" if foo.sub.domain isn't found. Note the
doubling of the colons in the URLs to distinguish them from the URL
separators.

Rather than make all query-style lookups capable of partial matching, it
might be helpful if Philip moved the code in search.c that does the string
transformation for partial lookups (i.e. chop of leading elements one and
keep trying each) into expand.c and gave it an expansion operator.

Then we could say:

${partial{3}{$domain}} = foo.sub.domain
${partial{2}{$domain}} = sub.domain
${partial{1}{$domain}} = domain

Presuming that $domain started as some string that ends in 'foo.sub.domain'.

This might be a bit too much work for too little gain though....

--
j.

James FitzGibbon                                                james@???
EHLO Solutions                                         Voice/Fax (416)410-0100


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