rfc822.parseaddress() in Util.py Invalid

Bug #265713 reported by Jijo-users
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Invalid
Medium
Unassigned

Bug Description

The reference to rfc822.parseaddress() on line 160 of
Util.py in Mailman 2.0.12 is invalid. As of at least
Python 2.1 and Python 2.2, the rfc822 module does not
contain this function. This makes it impossible to use
add_members from the command line, although web-based
subscription still seems to work.

The pertinent traceback:

Traceback (most recent call last):
  File "/usr/sbin/add_members", line 221, in ?
    main()
  File "/usr/sbin/add_members", line 195, in main
    nres = ml.ApprovedAddMembers(nmembers, None, 0,
send_welcome_msg)
  File "/usr/lib/mailman/Mailman/MailList.py", line
1097, in
    ApprovedAddMembers
    Utils.ValidateEmail(name)
  File "/usr/lib/mailman/Mailman/Utils.py", line 160,
in ValidateEmail
    realname,str = rfc822.parseaddress(str)
AttributeError: 'rfc822' module has no attribute
'parseaddress'

The fix is pretty simple. Simply replace

realname,str = rfc822.parseaddress(str)

on line 160 of Utils.py with

realname,str = rfc822.parseaddr(str)

[http://sourceforge.net/tracker/index.php?func=detail&aid=594913&group_id=103&atid=100103]

Revision history for this message
Barry Warsaw (barry) wrote :

Where did you get Mailman 2.0.12 from? There is no
parseaddress() call in Utils.py in the official Mailman
2.0.13 release, and there was no change to this since
MM2.0.12. Are you using some non-standard patch or local hack?

Revision history for this message
Jijo-users (jijo-users) wrote :

This is from the Debian package. I just downloaded the
package sources for the 2.0.12-3 package, and there is
nothing that changes the Utils.py file, and the Utils.py
file as claimed indeed comes with rfc822.parseaddr(str) and
not rfc822.parseaddress(str). Unfortunately because I
already modified my installed Utils.py to fix the problem I
was having, I cannot trace to see when the file was last
updated (this wasn't a fresh install but was an upgrade from
a previous version) to find out why it got changes.

My apologies for the hassles. Thank you for pointing out
that the distributed tarball comes with a Utils.py that was
not broken to begin with.

Cheers.

Revision history for this message
Barry Warsaw (barry) wrote :

Ok, thanks for the update.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.