[EXIM] LDAP problem

Pàgina inicial
Delete this message
Reply to this message
Autor: Stuart Lynne
Data:  
A: exim-users
Assumpte: [EXIM] LDAP problem
In article <19990408140939.2798.qmail@???>,
<michael@???> wrote:
>I use LDAP (previously OpenLDAP 1.2, currently 1.2.1) since a while and
>it works fine, but I have a problem with using it for alias expansion.
>Every now and then, I get a message like this:
>
>1999-04-08 15:38:05 user@domain: d_forward director deferred:
><user@domain> - error in alias lookup: missing or malformed local part
>(expected word or "<") in "\254\002"
>*** Frozen ***
>
>user@domain is a valid address, but there is no alias for it. The
>d_forward director is (sorry for the long lines):
>
>d_forward:
>  driver                = aliasfile
>  include_domain        = true
>  condition             = "${lookup ldap
>{ldap://ldap.mydomain.de/cn=$local_part@$domain,dc=$domain,dc=maildomain,o=myorg?forwardto} {$value} fail}"
>  query                 =
>ldap://ldap.mydomain.de/cn=${local_part}@${domain},dc=${domain},dc=maildomain,o=myorg?forwardto
>  search_type           = ldap
>  forbid_pipe           = true
>  forbid_file           = true

>
>I need the condition because there is an entry with the specified DN,
>but it has no forwardto attribute. Unfortunately, I can not reproduce


Hmm.. I use LDAP extensively for delivery and have never seen this..

What happens if you do delivery from the command line. Something like:

    echo test | exim -d99 user@domain 2>&1 | less


Can you get it to fail this way?

For performance reasons you should attempt to collapse the queries down to
a single one. Could you replace the above with a single director where the
query has two components, something like:

query = "${lookup ldap query = ldap://ldap.mydomain.de/cn=${local_part}@${domain},dc=${domain},dc=maildomain,o=myorg?forwardto} : /etc/myaliases"

Here is what I use:

  queries = "ldap:://wilt.fireplug.net/l=yvr?mailforwardingaddress?sub?(&(mail=$local_part@$domain)):\
          ldap:://wilt.fireplug.net/l=yvr?mailforwardingaddress?sub?(&(mail=USER_NOT_FOUND@$domain))"     


Where the second query looks for any special entry for a user called
USER_NOT_FOUND@$domain. If present this entry can have a mailforwarding
address like:

    mailforwardingaddress: $local_part@???


To bounce the mail to some other system for delivery (handy for diverting mail
to another mail gateway, e.g. CC-Mail etc.

or:
    mailforwardingaddress: :FAIL:


which just causes it to fail.


>the problem (it only happens every other message) and if I force delivery
>of the frozen message, exim delivers it!
>
>I also tried using a similar aliasfile director that tries to find a
>catch-all alias for a domain and every now and then, it generates a
>screwed up address that contains part of the query. That only seems
>to happen for DNs that do not exist.
>
>Any idea what might cause that or how to fix it? I have only ever seen
>such problems with alias expansion. Other directors use LDAP very much
>and they always work. Could it be a problem with not reading all data
>off a connection, and re-using that connection later?
>
>Michael
>
>--
>*** Exim information can be found at http://www.exim.org/ ***
>
>



-- 
Stuart Lynne <sl@???>      604-461-7532      <http://edge.fireplug.net>
PGP Fingerprint: 28 E2 A0 15 99 62 9A 00  88 EC A3 EE 2D 1C 15 68




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