diff options
author | Patrick Maia <pmaia@thoughtworks.com> | 2015-02-13 18:05:17 -0300 |
---|---|---|
committer | Patrick Maia <pmaia@thoughtworks.com> | 2015-02-20 11:15:11 -0300 |
commit | bb723e2cd21339f82c63ede3151d33022c0f029f (patch) | |
tree | adb990b3ff66a56dce1f39147fe61cabdab567b8 /service/pixelated/adapter | |
parent | 6f253b607f7211c1d63973c1f135e1230491d6ca (diff) |
Issue #174 - recognizes bounced mails
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r-- | service/pixelated/adapter/model/mail.py | 5 |
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, |