From cd831d1dfc42c2a0d292fe5c1b7f497b2ca393eb Mon Sep 17 00:00:00 2001 From: Giovane Date: Thu, 14 Jan 2016 18:34:00 -0200 Subject: Removes InputMail.FROM_EMAIL_ADDRESS constant #578 - Created the replier component to generate the reply dict for the email. This was needed to decouple the InputMail from the need to know who is the logged user. --- service/pixelated/adapter/model/mail.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'service/pixelated/adapter/model/mail.py') diff --git a/service/pixelated/adapter/model/mail.py b/service/pixelated/adapter/model/mail.py index dd2f4c0d..76df076e 100644 --- a/service/pixelated/adapter/model/mail.py +++ b/service/pixelated/adapter/model/mail.py @@ -141,8 +141,6 @@ class Mail(object): class InputMail(Mail): - FROM_EMAIL_ADDRESS = None - def __init__(self): self._raw_message = None self._fd = None @@ -193,12 +191,12 @@ class InputMail(Mail): }) @staticmethod - def from_dict(mail_dict): + def from_dict(mail_dict, from_address): input_mail = InputMail() input_mail.headers = {key.capitalize(): value for key, value in mail_dict.get('header', {}).items()} input_mail.headers['Date'] = date.mail_date_now() - input_mail.headers['From'] = InputMail.FROM_EMAIL_ADDRESS + input_mail.headers['From'] = from_address input_mail.body = mail_dict.get('body', '') input_mail.tags = set(mail_dict.get('tags', [])) -- cgit v1.2.3