[ python-Bugs-875646 ] email.Utils.formataddr doesn't handle whitespace too well

SourceForge.net noreply at sourceforge.net
Mon May 10 18:20:05 EDT 2004


Bugs item #875646, was opened at 2004-01-12 15:30
Message generated for change (Comment added) made by bwarsaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=875646&group_id=5470

Category: Python Library
Group: Python 2.2.3
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: email.Utils.formataddr doesn't handle whitespace too well

Initial Comment:
[forwarded from http://bugs.debian.org/178777]

originally reported for mailman, then reassigned to python

It seems like this problem is because
email.Utils.formataddr doesn't
handle newlines embedded in headers too well.

: tfheen at yiwaz ..man/mailman-2.1.3/Mailman > python
Python 2.3.3a0 (#2, Nov 21 2003, 00:36:53) 
[GCC 3.3.2 (Debian)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> from email.Utils import formataddr
>>> formataddr(("Books is a list for discussing all
aspects of the audio\nand text boox",
'books at spanky.braille.uwo.ca')) 'Books is a list for
discussing all aspects of the audio\nand text boox
<books at spanky.braille.uwo.ca>'
>>> 

IMHO, it should either strip newlines or at least
insert a space in front of them so they aren't
interpreted as a new header.



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

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2004-05-10 18:20

Message:
Logged In: YES 
user_id=12800

It's questionable whether formataddr should do this or not.
 Its docstring could be interpreted either way ('suitable
for an RFC 2822 [...] header').

My inclination is to keep the magic out of formataddr and
leave it up to the application to sanitize the real name. 
I'm closing this as won't fix, but if you still disagree,
feel free to bring it up on the email-sig.


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=875646&group_id=5470



More information about the Python-bugs-list mailing list