[EXIM] Trouble with LDAP queries in alias expansion

Top Page
Delete this message
Reply to this message
Author: michael
Date:  
To: exim-users
Subject: [EXIM] Trouble with LDAP queries in alias expansion
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
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/ ***