summaryrefslogtreecommitdiff
path: root/src/leap/mail/incoming/service.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2015-09-16 12:26:11 +0200
committerRuben Pollan <meskio@sindominio.net>2015-09-16 12:26:11 +0200
commit818ea26ec559174302ddf9095f26ed624b5cd507 (patch)
tree9b44bf85e2cfbd0534b3ba0a0d72c21dce3da786 /src/leap/mail/incoming/service.py
parent64aea2effaa503a31c10f04a6243c6fbc8c7baea (diff)
[bug] don't fail importing mismatched attached key
We can't import attached keys with different email address than the sender. Now we don't fail in this case, just log it. - Resolves: #7454
Diffstat (limited to 'src/leap/mail/incoming/service.py')
-rw-r--r--src/leap/mail/incoming/service.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/leap/mail/incoming/service.py b/src/leap/mail/incoming/service.py
index 2a3a86a..8d8f3c2 100644
--- a/src/leap/mail/incoming/service.py
+++ b/src/leap/mail/incoming/service.py
@@ -686,6 +686,10 @@ class IncomingMail(Service):
"""
MIME_KEY = "application/pgp-keys"
+ def failed_put_key(failure):
+ logger.info("An error has ocurred adding attached key for %s: %s"
+ % (address, failure.getErrorMessage()))
+
deferreds = []
for attachment in attachments:
if MIME_KEY == attachment.get_content_type():
@@ -694,6 +698,7 @@ class IncomingMail(Service):
attachment.get_payload(),
OpenPGPKey,
address=address)
+ d.addErrback(failed_put_key)
deferreds.append(d)
return defer.gatherResults(deferreds)