[Mailman-Developers] [ mailman-Bugs-594913 ] rfc822.parseaddress() in Util.py Invalid

noreply@sourceforge.net noreply@sourceforge.net
Fri, 16 Aug 2002 08:51:49 -0700


Bugs item #594913, was opened at 2002-08-14 02:19
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=594913&group_id=103

Category: command line scripts
Group: 2.0.x
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Federico Sevilla III (jijo)
Assigned to: Nobody/Anonymous (nobody)
Summary: rfc822.parseaddress() in Util.py Invalid

Initial Comment:
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)

----------------------------------------------------------------------

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2002-08-16 11:51

Message:
Logged In: YES 
user_id=12800

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?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=594913&group_id=103