[Mailman-Developers] mailman misparses non RFC 822 compliant Email addresses

Barry A. Warsaw barry@digicool.com
Wed, 11 Apr 2001 02:49:15 -0400


>>>>> "MM" == Marc MERLIN <marc_news@valinux.com> writes:

    MM> Correct.  I haven't found the right piece of code in mailman
    MM> yet, but it smells like a regular expression that grabs the
    MM> wrong pattern and ends up with davide.fox instead of
    MM> dfox@m206-157.dsl.tsoft.com

I suspect the problem is in Python's rfc822 module:

>>> a = rfc822.AddrlistClass('David E.Fox <dfox@m206-157.dsl.tsoft.com>')
>>> a.getaddrlist()
[('', 'DavidE.Fox'), ('', 'dfox@m206-157.dsl.tsoft.com')]

Mailman, interestingly enough, has Utils.ParseAddrs() which appears to
try to work around problems in rfc822:

>>> ParseAddrs('David E.Fox <dfox@m206-157.dsl.tsoft.com>')
'dfox@m206-157.dsl.tsoft.com'

which seems to suck out the right address in this case.  What should
probably in MM2.1 is for MailList.HasExplicitDest() to fallback on the
output of ParseAddrs() if the rfc822 method doesn't match.

-Barry