I'm just finishing ''Introduction to C'' at UCLA, so with that
disclaimer, it appears that qmail-ldap-20010501 will build a bad search
filter if control/ldapobjectclass exists, and thus, catchall addresses
will fail to 'catch.'

Here's some debug output (DEBUGLEVEL=255) showing the bad search filter:

delivery 1:
failure:
mailaddr:
[EMAIL PROTECTED]/
ldapfilter:_'(&(objectclass=qmailUser)(|([EMAIL PROTECTED])([EMAIL PROTECTED])))'/
ldap_lookup:_init_successful,_bind_successful/
ldap_lookup:_search_for_(&(objectclass=qmailUser)(|([EMAIL PROTECTED])([EMAIL PROTECTED])))_succeeded/
ldap_lookup:_Too_many_(less)_entries_found_(0)/
retry_with_filter_'(&(objectclass=qmailUser)(|([EMAIL PROTECTED])([EMAIL PROTECTED]))'/
ldap_lookup:_init_successful,_bind_successful/
ldap_lookup:_search_for_(&(objectclass=qmailUser)(|([EMAIL PROTECTED])([EMAIL PROTECTED]))_failed_(Bad_search_filter)/

^^^ (see end of above line)

I think this should fix the prob:

--- qmail-lspawn.c      Sun May 13 12:14:40 2001
+++ ../qmail-ldap-1.03/qmail-lspawn.c   Sun May 13 12:11:14 2001
@@ -427,7 +427,11 @@
       if (!stralloc_cats(&filter,"=")) _exit(QLX_NOMEM);
       if (!stralloc_cats(&filter,LDAP_CATCH_ALL)) _exit(QLX_NOMEM);
       if (!stralloc_catb(&filter,r+at, i-at)) _exit(QLX_NOMEM);
-      if (!stralloc_cats(&filter,"))")) _exit(QLX_NOMEM);
+      if (qldap_objectclass.len) {
+        if (!stralloc_cats(&filter,")))")) _exit(QLX_NOMEM);
+      } else {
+         if (!stralloc_cats(&filter,"))")) _exit(QLX_NOMEM);
+      }
       if (!stralloc_0(&filter)) _exit(QLX_NOMEM);

       debug(16, "retry with filter '%s'\n", filter.s);

Another random issue I noticed --

To get qmail-ldap to re-read control/ldapobjectclass, you have to send a
SIGHUP to qmail-lspawn. I *thought* whatever signal you sent to qmail-send
would get forwarded, per se, to it's child processes, but perhaps I'm
wrong. Am I missing something, or is qmail-send not properly forwarding
signals to qmail-lspawn ?

Abe


Reply via email to