Message299568
parseaddr does what you expect if the message has been read using universal newline mode (ie: the linesep is \n):
>>> parseaddr('"=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=\n =?UTF-8?Q?omo=C5=9Bci?=" <anita.wiecklinska@pato.com.pl>"')
('=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=\n =?UTF-8?Q?omo=C5=9Bci?=', 'anita.wiecklinska@pato.com.pl')
I suppose this wouldn't be *that* hard to fix. If it isn't too complex and you want to propose a patch I'll take a look.
In any case it works fine in python3 using the new policies:
>>> from email import message_from_string as mfs
>>> from email.policy import default
>>> m = mfs('From: "=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=\r\n =?UTF-8?Q?omo=C5=9Bci?=" <anita.wiecklinska@pato.com.pl>"\r\n\r\ntest', policy=default)
>>> m['from'].addresses
(Address(display_name='Anita =W4\udc86iecklińska | PATO Nieruch omości', username='anita.wiecklinska', domain='pato.com.pl'),) |
|
Date |
User |
Action |
Args |
2017-07-31 15:32:47 | r.david.murray | set | recipients:
+ r.david.murray, barry, robertus |
2017-07-31 15:32:47 | r.david.murray | set | messageid: <1501515167.06.0.374969537962.issue31089@psf.upfronthosting.co.za> |
2017-07-31 15:32:47 | r.david.murray | link | issue31089 messages |
2017-07-31 15:32:47 | r.david.murray | create | |
|