[Mailman-Users] LDAP and case-sensitive memberlist

Mark Sapiro mark at msapiro.net
Thu Mar 19 21:04:12 CET 2009

C Nulk wrote:
>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.

You could try the following. I haven't studied the member adaptor in
detail to be certain it will work, but I think it's worth a try.

In the definition of __ldap_load_members(self), you will see these two

            for maddr in attrs['mail']:
                self.__member_map[maddr.strip()] = mail

They are indented with tabs which is not good, but it will be OK as
long as you preserve the existing tabs. I have replaced the tabs with
some spaces for this email, but what you need to do is just insert the
string '.lower()' in the second line so it becomes

                self.__member_map[maddr.strip().lower()] = mail

without changing the tabbing.

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list