This hack might be worth merging mainline.
My patch below allows users to login with LDAP_MAIL,
LDAP_MAILALTERNATE, or LDAP_UID via qmail-ldap auth_*.
In terms of LDAP attributes that is, they can login with their mail
mailalternateaddress or uid values.
My ldap directory has multiple ou=customerdomain,[base dn] entries which
then contain multiple email users who's uid is only uniq within the
ou=custdomain subtree. This patch allows us to have [EMAIL PROTECTED]
and [EMAIL PROTECTED] without doing any of the traditional virtualization stuff
by
allowing them to login with email addresses instead of uids.
Thank you for qmail-ldap.
-Ray Ferguson.
The patch was generated against qmail-ldap-1.03-20041201.
--- qmail-1.03.orig/checkpassword.c 2005-01-16 00:02:08.000000000 -0600
+++ qmail-1.03/checkpassword.c 2005-01-16 13:34:36.000000000 -0600
@@ -128,8 +128,12 @@
attrs[10] = 0;
}
- filter = filter_uid(login->s);
- if (filter == 0) { r = ERRNO; goto fail; }
+ int done = 0 ;
+ filter = filter_mail(login->s,&done);
+ if (filter == 0) {
+ filter = filter_uid(login->s);
+ if (filter == 0) { r = ERRNO; goto fail; }
+ }
r = qldap_lookup(q, filter, attrs);
if (r != OK) goto fail;