On Tue, Dec 24, 2002 at 08:30:29AM -0500, Matt wrote:
> 
> Is there anyway I can make qmail read from the value of "mail" in
> addition to "uid"?   My problem is I have 2 domains.. domain.net and
> domain.com and my domain.net users log in with "joe" while the
> domain.com customers log in with [EMAIL PROTECTED] and I need both to
> work.. but my database software only will dump the uid one way "joe".  
> Can I make qmail read from the "mail" variable as well when looking for
> a username when someone logs in through pop?
> 

You need to patch checkpassword.c:make_filter() so that a filter like
(&(objectclass=...)(|(uid=...)(mail=...))) is created.

Replace the block where LDAP_UID is used with:
        if (!stralloc_cats(filter, "|(") || 
            !stralloc_cats(filter, LDAP_UID) ||
            !stralloc_cats(filter, "=") ||
            !stralloc_cat(filter, &tmp) ||
            !stralloc_cats(filter, ")(") ||
            !stralloc_cats(filter, LDAP_MAIL) ||
            !stralloc_cats(filter, "=") ||
            !stralloc_cat(filter, &tmp) ||
            !stralloc_cats(filter, "))") ) {
                qldap_errno = ERRNO;
                return 0;
        }

That should do the job.

-- 
:wq Claudio

Reply via email to