This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author robertus
Recipients robertus
Date 2017-07-31.14:43:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501512198.85.0.996248445964.issue31089@psf.upfronthosting.co.za>
In-reply-to
Content
email.utils.parseaddr() does not successfully parse a
field value into a (comment, address) pair if the
FROM header has 2 lines (or more) containing odd number of double quotes in each of them. 
The address in such tuple is not e-mail address but a part of comment.

For example:

"=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=
 =?UTF-8?Q?omo=C5=9Bci?=" <anita.wiecklinska@pato.com.pl>

is parsed into:

('', '=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=')

Full example on Python 2.7.12, email 4.0.2:

Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.utils import parseaddr
>>> parseaddr('"=?UTF8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=\r\n =?UTF-8?Q?omo=C5=9Bci?=" <anita.wiecklinska@pato.com.pl>')
('', '=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=')

When double quotes or \r\n are removed, header is parsed without problems.

The same issue exists on python 3.5.2 and email 6.0.0a1.

From headers analysis I know that e-mail was made in Outlook 14.0 then send through Exim 4.87 to outlook.com servers.
History
Date User Action Args
2017-07-31 14:43:18robertussetrecipients: + robertus
2017-07-31 14:43:18robertussetmessageid: <1501512198.85.0.996248445964.issue31089@psf.upfronthosting.co.za>
2017-07-31 14:43:18robertuslinkissue31089 messages
2017-07-31 14:43:18robertuscreate