summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/mail/incoming/service.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/leap/bitmask/mail/incoming/service.py b/src/leap/bitmask/mail/incoming/service.py
index a68adc22..504fd7ea 100644
--- a/src/leap/bitmask/mail/incoming/service.py
+++ b/src/leap/bitmask/mail/incoming/service.py
@@ -429,6 +429,7 @@ class IncomingMail(Service):
# parse the original message
encoding = get_email_charset(data)
msg = self._parser.parsestr(data)
+ self._strip_leap_headers(msg)
fromHeader = msg.get('from', None)
senderAddress = None
@@ -461,6 +462,11 @@ class IncomingMail(Service):
d.addCallback(add_leap_header)
return d
+ def _strip_leap_headers(self, msg):
+ for h in [self.LEAP_ENCRYPTION_HEADER, self.LEAP_SIGNATURE_HEADER]:
+ if h in msg:
+ del msg[h]
+
def _decrypt_by_content_type(self, msg, senderAddress, encoding):
if msg.get_content_type() == MULTIPART_ENCRYPTED:
d = self._decrypt_multipart_encrypted_msg(msg, senderAddress)