[Mailman-Users] LDAP and case-sensitive memberlist

C Nulk CNulk at scu.edu
Thu Mar 19 17:29:24 CET 2009



Mark Sapiro wrote:
> 
> ----- Original Message ---------------
> 
> Subject: [Mailman-Users] LDAP and case-sensitive memberlist
>    From: "Chris Nulk" <CNulk at scu.edu>
>    Date: Tue, 17 Mar 2009 14:22:59 -0700
>      To: <mailman-users at python.org>
> 
>> Hello all,
>>
>> I have recently set up Mailman v2.1.19 and added the LDAPMemberAdaptor I picked up from
>>
>>>> See
>>>> <http://sourceforge.net/tracker/index.php?func=detail&aid=871062&group_id=103&atid=300103>.
>>>>
>> I did check the FAQ and search the list for the LDAP stuff.  I configured it as per the docs and it works fine.  When I look at the member list (via Mailman's web interface), all the email addresses are there with proper capitalization (it is how it is defined in our LDAP and I CANNOT change the LDAP entries).
>>
>> The problem is when anyone sends to the list, their posts are held for moderation because they are not a member of the list.  I have looked at the detailed message source on the moderator's page to view the message source.  It shows the sender's email address with the correct capitalization.  However, Mailman appears to be comparing a lowercase version of the sender's email address to the properly capitalized member list derived from the LDAPMemberAdapter.
>>
>> Is there a way to force the comparison to be case-insensitive?  Or, modify the LDAPMemberAdaptor to lowercase all the email addresses?
> 

Thank you for replying Mark.

> 
> This particular member adaptor assumes all email addresses in the LDAP
> database are lower case. Mailman itself has the concept of a "case
> preserved email" (CPE) and a "lower case email" (LCE) It uses the LCE
> as the key to look up a CPE or to verify if an LCE is a member. The
> member adaptor you are using doesn't distinguish between LCE and CPE
> and it only works if the email addresses in the LDAP database are
> lower case.

That Mailman understands CPE is great.
That the adaptor only works if email addresses in the LDAP database are
lower case is not great.

I have no way of changing how the email addresses are represented in the
LDAP database.  I have spoken with the administrator about making the
change but it is not possible without disrupting everyone's email.

> 
> In order to fix it, you would first need to have a way of finding the
> correct record in the LDAP database given only the LCE as a key. Since
> the member adaptor seems (via its __ldap_load_members() method) to
> keep all the list member emails in memory anyway, you could augment
> that method to build another dictionary with LCE as key and CPE as
> data and use that.

Okay.  I know enough Python to break things.  I know, I have done it.
My knowledge of Python consists of, well, zero.

> 
> Then you would need to modify the member adaptor to do what it's
> supposed to do. It seems to preserve the doc strings which define what
> the methods should do. You'd just need to make them do that.
> 

Is there anyway to modify the member adaptor to make sure everything it
stores in memory is lowercase when it loads via __ldap_load_members()?
And when it comes to the checking if an address is member, convert it to
lowercase prior to checking?  Since everything should be in lowercase,
it should find if an address is a member or not.

Alternatively, if you, or anyone else, would like to take this offline
and help me make the changes, I will do changes and testing and once
working, post the code back to the list.

Thank you,
Chris


More information about the Mailman-Users mailing list