Merge 0.2.22 bugfix release updates, update copyright year in license, specify python 3.6 or above in setup

This commit is contained in:
Garret Wassermann
2020-07-30 04:46:15 -04:00
17 changed files with 2390 additions and 1642 deletions

View File

@@ -439,7 +439,13 @@ def object_from_message(message, queue, logger):
sender = message.get('from', _('Unknown Sender'))
sender = decode_mail_headers(decodeUnknown(message.get_charset(), sender))
sender_email = email.utils.parseaddr(sender)[1]
# to address bug #832, we wrap all the text in front of the email address in
# double quotes by using replace() on the email string. Then,
# take first item of list, second item of tuple is the actual email address.
# Note that the replace won't work on just an email with no real name,
# but the getaddresses() function seems to be able to handle just unclosed quotes
# correctly. Not ideal, but this seems to work for now.
sender_email = email.utils.getaddresses(['\"' + sender.replace('<', '\" <')])[0][1]
body_plain, body_html = '', ''