summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/next-changelog.rst1
-rw-r--r--src/leap/mail/incoming/service.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/changes/next-changelog.rst b/changes/next-changelog.rst
index 21b1010..2731460 100644
--- a/changes/next-changelog.rst
+++ b/changes/next-changelog.rst
@@ -11,6 +11,7 @@ I've added a new category `Misc` so we can track doc/style/packaging stuff.
Features
~~~~~~~~
- `#8031 <https://leap.se/code/issues/8031>`_: Adapt to the new KeyManager API without key types.
+- `#7429 <https://leap.se/code/issues/7429>`_: Remove senders X-Leap-* headers if the email came with them.
- `#1234 <https://leap.se/code/issues/1234>`_: Description of the new feature corresponding with issue #1234.
- New feature without related issue number.
diff --git a/src/leap/mail/incoming/service.py b/src/leap/mail/incoming/service.py
index fea3ecb..da63dd8 100644
--- a/src/leap/mail/incoming/service.py
+++ b/src/leap/mail/incoming/service.py
@@ -459,6 +459,7 @@ class IncomingMail(Service):
signkey.fingerprint)
return decrmsg.as_string()
+ self._remove_headers(msg)
if msg.get_content_type() == MULTIPART_ENCRYPTED:
d = self._decrypt_multipart_encrypted_msg(
msg, encoding, senderAddress)
@@ -480,6 +481,10 @@ class IncomingMail(Service):
msg.add_header(self.LEAP_ENCRYPTION_HEADER,
self.LEAP_ENCRYPTION_DECRYPTED)
+ def _remove_headers(self, msg):
+ del msg[self.LEAP_ENCRYPTION_HEADER]
+ del msg[self.LEAP_SIGNATURE_HEADER]
+
def _decrypt_multipart_encrypted_msg(self, msg, encoding, senderAddress):
"""
Decrypt a message with content-type 'multipart/encrypted'.