[Mailman-Users] Another case sensitivity problem: message held for approval

Mark Martinec Mark.Martinec at ijs.si
Fri Feb 11 15:47:51 CET 2000

Using Mailman 1.1 and Python 1.5.2.

I found another case-sensitivity problem (besides the one
in sync_members and remove_members as reported earlier - on Jan 11, 2000)
in Utils.FindMatchingAddresses or in the use of it from MailList.py.

This one is preventing the sender who _does_ match the list
of allowed posters to post to the list without
administrators approval due to a character case mismatch.
The message is inappropriately being held for approval.

I have:

  must posts be approved by an administrator?  YES

  restrict posting privilege to list members? (member_posting_only) NO


  posters dict as returned by Utils.List2Dict(self.posters)
    and passed as the second argument to Utils.FindMatchingAddresses
    from MailList.Post: {'Rdeca.Kapica at crni.gozd': 1}

  'name' as passed as the first argument to Utils.FindMatchingAddresses:
    Rdeca.Kapica at crni.gozd

As you can see the sender matches exactly the only entry in the posters list.
The problem is in FindMatchingAddresses where sender name is first
lowercased and then matched to the dictionary which contains the
mixed-case address - and the has_key fails to match an entry:

def FindMatchingAddresses(name, dict, *dicts):
    """Given an email address, and any number of dictionaries keyed by
    email addresses, returns the subset of the list that matches the
    given address.  Should sort based on exactness of match,
    just in case."""
    dicts = list(dicts)
    dicts.insert(0, dict)
    if not mm_cfg.SMART_ADDRESS_MATCH:
        for d in dicts:
            if d.has_key(string.lower(name)):
==>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                return [name]
        return []

I think the proper solution would be to keep lowercased
addresses in the list/dictionary in the first place.
(The workaround is to manually lowercase all addresses
in the 'posters' list of every mailing list.)

Is somebody reading this? Is there a hope for a patch now
and a fix in the next release?


  !!  Mark Martinec (system manager)     tel +386 61 177-3575 !!
  !!  J. Stefan Institute, Jamova 39     fax +386 61  219-385 !!
  !!  SI-1000 Ljubljana, Slovenia        mark.martinec at ijs.si !!
  !!!!!!!!!!!!!!!!!!!!!!!!!! http://www.ijs.si/people/mark/ !!!!

More information about the Mailman-Users mailing list