diff options
author | drebs <drebs@leap.se> | 2013-12-19 23:13:43 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-12-19 23:13:43 -0200 |
commit | 05884e9fd9a6131eaff6f86b37af8dc7b0a88217 (patch) | |
tree | 204f7abb9a6bf5e0e752f148c3c6f2ce760172ab | |
parent | e14cbdd27cfae72c3fa851441853d1bd93a33dda (diff) |
Only try to fetch keys for multipart signed or encrypted messages when fetching mail (#4671).
-rw-r--r-- | changes/feature_4671_only-try-to-fetch-keys-for-multipart-signed-or-encrypted | 1 | ||||
-rw-r--r-- | src/leap/mail/imap/fetch.py | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/changes/feature_4671_only-try-to-fetch-keys-for-multipart-signed-or-encrypted b/changes/feature_4671_only-try-to-fetch-keys-for-multipart-signed-or-encrypted new file mode 100644 index 0000000..de3bb86 --- /dev/null +++ b/changes/feature_4671_only-try-to-fetch-keys-for-multipart-signed-or-encrypted @@ -0,0 +1 @@ + o Only try to fetch keys for multipart signed or encrypted emails (#4671). diff --git a/src/leap/mail/imap/fetch.py b/src/leap/mail/imap/fetch.py index f69681a..b1c34ba 100644 --- a/src/leap/mail/imap/fetch.py +++ b/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( |