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

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: michael
Data:  
Para: james
CC: exim-users
Asunto: Re: [EXIM] Are partial-ldap queries allowed?
> 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.


It would fail on foo.bar.sub.domain, though. I don't see a way to count
from the right.

> 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....


But then we would also need loops. Partial lookups solve both problems
very elegant and there is no reason why they shouldn't perform their
loop over $key exactly like they loop over the implicitly given key of
single key lookups.

Michael

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