summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/mailstore/leap_mailstore.py
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2015-09-08 22:22:57 -0300
committerJefferson Stachelski <jstachel@thoughtworks.com>2015-09-08 22:25:08 -0300
commit3802f0a55a383fa9314236e0d0905b963ea8f297 (patch)
treed5fcc931098eaf943b1733bd0aa3444770fd2675 /service/pixelated/adapter/mailstore/leap_mailstore.py
parentb50a8ac110fc08e543a78d063844e60b7b28efae (diff)
Some progress on the issue #441
I added some comments and TODOs in some parts of the code where I think should be changed
Diffstat (limited to 'service/pixelated/adapter/mailstore/leap_mailstore.py')
-rw-r--r--service/pixelated/adapter/mailstore/leap_mailstore.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py
index a27ce5c4..6dad12b0 100644
--- a/service/pixelated/adapter/mailstore/leap_mailstore.py
+++ b/service/pixelated/adapter/mailstore/leap_mailstore.py
@@ -162,6 +162,24 @@ class LeapMail(Mail):
return [recipient for recipient in recipients if recipient != InputMail.FROM_EMAIL_ADDRESS]
+ @property
+ def bounced(self):
+ # TODO: Must be implemented for the search engine identify bounced mails
+ return False
+
+ @staticmethod
+ def from_dict(mail_dict):
+ # TODO: implement this method and also write tests for it
+ headers = {key.capitalize(): value for key, value in mail_dict.get('header', {}).items()}
+ headers['Date'] = date.iso_now()
+ body = mail_dict.get('body', '')
+ tags = set(mail_dict.get('tags', []))
+ status = set(mail_dict.get('status', []))
+ attachments = []
+
+ # mail_id, mailbox_name, headers=None, tags=set(), flags=set(), body=None, attachments=[]
+ return LeapMail(None, None, headers, tags, set(), body, attachments)
+
def _extract_filename(content_disposition):
match = re.compile('.*name=\"(.*)\".*').search(content_disposition)