SpamScope / mail-parser

Tokenizer for raw mails
https://pypi.python.org/pypi/mail-parser
Apache License 2.0
367 stars 87 forks source link

Mime Header Decoding (RFC 2047) does not correctly resolve in case the display name contains an encoded comma #105

Closed Fabma closed 1 week ago

Fabma commented 2 years ago

Describe the bug The Mime Header Decoding (RFC 2047) does not correctly resolve in case the display name contains an encoded comma. The entire mailbox-list is decoded before separated into different mailboxes.

To Reproduce The mail with header From: =?ISO-8859-1?Q?Moore=2C_Keith?= <moore@cs.utk.edu> is parsed to mail._from == [('', 'Moore'), ('Keith', 'moore@cs.utk.edu')] It appears that the header is first decoded to Moore, Keith <moore@cs.utk.edu> before getting the individual addresses.

Expected behavior Correct would be mail._from == [('Moore, Keith', 'moore@cs.utk.edu')]

Raw mail

Delivered-To: bruce@untroubled.org
Received: (fqmail 26559 invoked from network); 21 Aug 2016 10:49:40 -0000
Reply-To: =?ISO-8859-1?Q?Moore=2C_Keith?= <moore@cs.utk.edu>
From: =?ISO-8859-1?Q?Moore=2C_Keith?= <moore@cs.utk.edu>
Subject: PI
Date: Fri, 19 Aug 2016 15:33:29 +0100
MIME-Version: 1.0

Environment:

fedelemantuano commented 1 week ago

To review in the new version. I will open a new issue if needed.