summaryrefslogtreecommitdiff
path: root/mail/src
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-12-19 23:13:43 -0200
committerdrebs <drebs@leap.se>2013-12-19 23:13:43 -0200
commit178c356fc3b330e92bb582fee75dfd345339c267 (patch)
treef0372111912191ad35494088d8c068e2505b148f /mail/src
parentc6d5c0050b3cbefe79e9d1e2e770defc734dcec7 (diff)
Only try to fetch keys for multipart signed or encrypted messages when fetching mail (#4671).
Diffstat (limited to 'mail/src')
-rw-r--r--mail/src/leap/mail/imap/fetch.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mail/src/leap/mail/imap/fetch.py b/mail/src/leap/mail/imap/fetch.py
index f69681a..b1c34ba 100644
--- a/mail/src/leap/mail/imap/fetch.py
+++ b/mail/src/leap/mail/imap/fetch.py
@@ -389,7 +389,9 @@ class LeapIncomingMail(object):
# try to obtain sender public key
senderPubkey = None
fromHeader = msg.get('from', None)
- if fromHeader is not None:
+ if fromHeader is not None \
+ and (msg.get_content_type() == 'multipart/encrypted' \
+ or msg.get_content_type() == 'multipart/signed'):
_, senderAddress = parseaddr(fromHeader)
try:
senderPubkey = self._keymanager.get_key_from_cache(