summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/services/mail_sender.py
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2015-11-26 15:49:54 -0200
committerJefferson Stachelski <jstachel@thoughtworks.com>2015-11-26 15:49:54 -0200
commite889a46fdf1b38fcbc9a8338fd2948e564d993cf (patch)
treef82dca3b5ba13f7d56cbc931453d5a5de349be6b /service/pixelated/adapter/services/mail_sender.py
parent243464b44bbc4d78f4c5aa79b4c70b7444456677 (diff)
Issue #532 - Removing name from canonical address
Now the canonical mail address are been parsed to a common one, but it is a Twisted smtp bug that should be fixed in the future
Diffstat (limited to 'service/pixelated/adapter/services/mail_sender.py')
-rw-r--r--service/pixelated/adapter/services/mail_sender.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/service/pixelated/adapter/services/mail_sender.py b/service/pixelated/adapter/services/mail_sender.py
index 8ccfc5a2..4499adbd 100644
--- a/service/pixelated/adapter/services/mail_sender.py
+++ b/service/pixelated/adapter/services/mail_sender.py
@@ -91,4 +91,9 @@ class MailSender(object):
int(self._smtp_config.remote_smtp_port))
def _create_twisted_smtp_recipient(self, recipient):
+ # TODO: Better is fix Twisted instead
+ recipient = self._remove_canonical_recipient(recipient)
return User(str(recipient), NOT_NEEDED, NOT_NEEDED, NOT_NEEDED)
+
+ def _remove_canonical_recipient(self, recipient):
+ return recipient.split('<')[1][0:-1] if '<' in recipient else recipient