diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-08-22 13:00:09 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-08-25 10:29:22 +0200 |
commit | 5292016becad94bfe603cdb7c4833b82ac07723a (patch) | |
tree | 832a48eee35bd00399811b832f7d8db457336652 /src | |
parent | 7179ed5829a879c88292a8a57b59ad108a74af67 (diff) |
[bug] replace content-type after removing the signature
- Resolves: #9003
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/bitmask/mail/incoming/service.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/leap/bitmask/mail/incoming/service.py b/src/leap/bitmask/mail/incoming/service.py index 00e7ee4..a68adc2 100644 --- a/src/leap/bitmask/mail/incoming/service.py +++ b/src/leap/bitmask/mail/incoming/service.py @@ -614,6 +614,14 @@ class IncomingMail(Service): return buf.getvalue() def _extract_signature(self, msg): + """ + Extract and return the signature from msg. + + Remove the signature part from msg. For that we modify the content type + from multipart/signed to multipart/mixed. Even for single part messages + we do multipart/signed, other options will require modifying the part + to extract it's MIME headers and promote them into the main headers. + """ body = msg.get_payload(0).get_payload() if isinstance(body, str): @@ -621,6 +629,7 @@ class IncomingMail(Service): detached_sig = msg.get_payload(1).get_payload() msg.set_payload(body) + msg.set_type('multipart/mixed') return detached_sig def _decryption_error(self, failure, msg): |