summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-07-25 18:56:00 +0200
committerRuben Pollan <meskio@sindominio.net>2017-07-27 12:48:58 +0200
commit93afdb4d935d504356adc662426a70cd8b575133 (patch)
tree574245d90e6b18bf1e28925ea373a3163f4a089b /service
parent1359e610bb73f0a8ae476efd4b09d389ee501f9c (diff)
[feat] display the mixnet status on incomming emails
Add support for X-Leap-Mixnet header.
Diffstat (limited to 'service')
-rw-r--r--service/src/pixelated/adapter/mailstore/leap_mailstore.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/service/src/pixelated/adapter/mailstore/leap_mailstore.py b/service/src/pixelated/adapter/mailstore/leap_mailstore.py
index 288223dd..cfda2e52 100644
--- a/service/src/pixelated/adapter/mailstore/leap_mailstore.py
+++ b/service/src/pixelated/adapter/mailstore/leap_mailstore.py
@@ -88,7 +88,8 @@ class LeapMail(Mail):
@property
def security_casing(self):
- casing = dict(imprints=self._signature_information(), locks=[])
+ casing = dict(imprints=self._signature_information(), locks=[],
+ mixnet=self._mixnet())
if self._encrypted() == "decrypted":
casing["locks"] = [{"state": "valid"}]
return casing
@@ -106,6 +107,13 @@ class LeapMail(Mail):
else:
return []
+ def _mixnet(self):
+ mixnet = self.headers.get("X-Leap-Mixnet", "")
+ if mixnet == "":
+ return []
+
+ return [{"state": "valid", "mixnet": mixnet}]
+
@property
def raw(self):
result = u''