diff options
-rw-r--r-- | changes/properly_parse_addr | 2 | ||||
-rw-r--r-- | src/leap/mx/mail_receiver.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/changes/properly_parse_addr b/changes/properly_parse_addr new file mode 100644 index 0000000..a41ba05 --- /dev/null +++ b/changes/properly_parse_addr @@ -0,0 +1,2 @@ + o Properly parse mail address of the form "Name + <user@domain>". Fixes #3653.
\ No newline at end of file diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py index 77e7cf4..6f9b8a7 100644 --- a/src/leap/mx/mail_receiver.py +++ b/src/leap/mx/mail_receiver.py @@ -24,6 +24,7 @@ import os import uuid as pyuuid import json +import email.utils from email import message_from_string @@ -218,6 +219,7 @@ class MailReceiver(Service): "Delivered-To: field") log.msg("Mail owner: %s" % (owner,)) + owner = email.utils.parseaddr(owner)[1] log.msg("%s received a new mail" % (owner,)) dpubk = self._users_cdb.getPubKey(owner) duuid = self._users_cdb.queryByAddress(owner) |