summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/model/mail.py
diff options
context:
space:
mode:
authorPatrick Maia <pmaia@thoughtworks.com>2015-02-13 18:05:17 -0300
committerPatrick Maia <pmaia@thoughtworks.com>2015-02-20 11:15:11 -0300
commitbb723e2cd21339f82c63ede3151d33022c0f029f (patch)
treeadb990b3ff66a56dce1f39147fe61cabdab567b8 /service/pixelated/adapter/model/mail.py
parent6f253b607f7211c1d63973c1f135e1230491d6ca (diff)
Issue #174 - recognizes bounced mails
Diffstat (limited to 'service/pixelated/adapter/model/mail.py')
-rw-r--r--service/pixelated/adapter/model/mail.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/service/pixelated/adapter/model/mail.py b/service/pixelated/adapter/model/mail.py
index 3522f695..b3d2e3a5 100644
--- a/service/pixelated/adapter/model/mail.py
+++ b/service/pixelated/adapter/model/mail.py
@@ -380,6 +380,11 @@ class PixelatedMail(Mail):
return self.hdoc.content["headers"].get("OpenPGP", None) is not None or \
self.hdoc.content["headers"].get("X-Pixelated-encryption-status", "false") == "true"
+ @property
+ def bounced(self):
+ content_type = self.hdoc.content["headers"].get("Content-Type", '')
+ return re.compile('delivery-status').search(content_type)
+
def as_dict(self):
dict_mail = {'header': {k.lower(): v for k, v in self.headers.items()},
'ident': self.ident,