summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/src/leap/mail/incoming/service.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mail/src/leap/mail/incoming/service.py b/mail/src/leap/mail/incoming/service.py
index c7d194d6..f60921aa 100644
--- a/mail/src/leap/mail/incoming/service.py
+++ b/mail/src/leap/mail/incoming/service.py
@@ -524,10 +524,20 @@ class IncomingMail(Service):
self._add_decrypted_header(msg)
return (msg, signkey)
+ def verify_signature_after_decrypt_an_email(res):
+ decrdata, signkey = res
+ if not isinstance(signkey, OpenPGPKey):
+ try:
+ return self._verify_signature_not_encrypted_msg(decrdata, senderAddress)
+ except:
+ pass
+ return res
+
d = self._keymanager.decrypt(
encdata, self._userid, OpenPGPKey,
verify=senderAddress)
d.addCallbacks(build_msg, self._decryption_error, errbackArgs=(msg,))
+ d.addCallbacks(verify_signature_after_decrypt_an_email)
return d
def _maybe_decrypt_inline_encrypted_msg(self, origmsg, encoding,