summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-10-24 12:46:48 +0200
committerRuben Pollan <meskio@sindominio.net>2017-10-26 18:37:05 +0200
commitec01098129d885911715260f5bffb701fa65028c (patch)
treee4186907e727f53fcd6caea63e1ac447e7770cdf /src
parent5243c7eb4c58a4419da2103af8c1e4004f01053b (diff)
[bug] strip leap headers before processing the icnomming mails
- Resolves: #9030
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)