From ec01098129d885911715260f5bffb701fa65028c Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Tue, 24 Oct 2017 12:46:48 +0200 Subject: [bug] strip leap headers before processing the icnomming mails - Resolves: #9030 --- src/leap/bitmask/mail/incoming/service.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/leap/bitmask') 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) -- cgit v1.2.3