diff options
author | Giovane <giovaneliberato@gmail.com> | 2015-11-19 16:20:52 -0200 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2015-11-19 16:21:08 -0200 |
commit | c21a6ddf277514c62a89cbd9214ec4fc905b4988 (patch) | |
tree | 6bfa9cbcb5d2522649d5985bd8d323c9f5491511 /service/pixelated/adapter/services | |
parent | 2615c785260ea168f0eb8d9fe2a8a6576a5392dd (diff) |
Move 'From' initialization to InputMail factory. w/ @bwagner #531
Diffstat (limited to 'service/pixelated/adapter/services')
-rw-r--r-- | service/pixelated/adapter/services/mail_service.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py index 7e6f1c63..6ecf3245 100644 --- a/service/pixelated/adapter/services/mail_service.py +++ b/service/pixelated/adapter/services/mail_service.py @@ -88,10 +88,9 @@ class MailService(object): @defer.inlineCallbacks def send_mail(self, content_dict): mail = InputMail.from_dict(content_dict) - mail.headers['From'] = self.account_email draft_id = content_dict.get('ident') - yield self.mail_sender.sendmail(mail) + sent_mail = yield self.move_to_sent(draft_id, mail) defer.returnValue(sent_mail) @@ -102,7 +101,6 @@ class MailService(object): yield self.mail_store.delete_mail(last_draft_ident) except Exception as error: pass - sent_mail = yield self.mail_store.add_mail('SENT', mail.raw) sent_mail.flags.add(Status.SEEN) yield self.mail_store.update_mail(sent_mail) |