diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/pixelated/adapter/mail.py | 14 | ||||
-rw-r--r-- | service/pixelated/controllers/features_controller.py | 2 | ||||
-rw-r--r-- | service/test/unit/adapter/mail_test.py | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/service/pixelated/adapter/mail.py b/service/pixelated/adapter/mail.py index fc32366a..124a16b1 100644 --- a/service/pixelated/adapter/mail.py +++ b/service/pixelated/adapter/mail.py @@ -79,7 +79,7 @@ class Mail: 'ident': self.ident, 'tags': list(self.tags), 'status': list(self.status), - 'security_casing': {}, + 'security_casing': self.security_casing, 'body': self.body, 'mailbox': self.mailbox_name.lower(), 'attachments': self.parts['attachments'] if self.parts else [] @@ -243,7 +243,10 @@ class PixelatedMail(Mail): @property def security_casing(self): - return {} + casing = {"imprints": []} + if self.signed: + casing["imprints"].append({"state": "valid", "seal": {"validity": "valid"}}) + return casing @property def tags(self): @@ -304,3 +307,10 @@ class PixelatedMail(Mail): def has_tag(self, tag): return tag in self.tags + + @property + def signed(self): + return self.hdoc.content["headers"].get("X-Leap-Signature", "").startswith("valid") + + def encrypt(self): + pass diff --git a/service/pixelated/controllers/features_controller.py b/service/pixelated/controllers/features_controller.py index f3fa9dff..b91aa183 100644 --- a/service/pixelated/controllers/features_controller.py +++ b/service/pixelated/controllers/features_controller.py @@ -19,7 +19,7 @@ import os class FeaturesController: - DISABLED_FEATURES = ['draftReply', 'signatureStatus', 'encryptionStatus'] + DISABLED_FEATURES = ['draftReply', 'encryptionStatus'] def __init__(self): pass diff --git a/service/test/unit/adapter/mail_test.py b/service/test/unit/adapter/mail_test.py index eaa6efb4..adc17e44 100644 --- a/service/test/unit/adapter/mail_test.py +++ b/service/test/unit/adapter/mail_test.py @@ -85,7 +85,7 @@ class TestPixelatedMail(unittest.TestCase): }, 'ident': 'chash', 'mailbox': 'inbox', - 'security_casing': {}, + 'security_casing': {'imprints': []}, 'status': ['recent'], 'tags': [], 'attachments': [] |