diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-04-19 18:03:57 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-04-19 18:03:57 +0200 |
commit | ab5af955801972f313f6b7fb541d790b7a1a22bb (patch) | |
tree | 2f7a86bcb2ffe4f950cf4bab2655b8880868ce2a /alot/db/message.py | |
parent | 26f5a8cb8684544ac9d7918e4b679c16e3eadc22 (diff) |
db/message: fix handling undecryptable mail
Diffstat (limited to 'alot/db/message.py')
-rw-r--r-- | alot/db/message.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/alot/db/message.py b/alot/db/message.py index 1c7a9eb2..74685466 100644 --- a/alot/db/message.py +++ b/alot/db/message.py @@ -276,9 +276,12 @@ class _MimeTree: # method is used, currently this prevents the interpretation of the # recovered plain text mail. maybe that's a feature. self.crypt_error = 'Failed to decrypt message: %s' % str(e) + sigs = None + d = None - child = email.message_from_bytes(d, policy = email.policy.SMTP) - self.children = [_MimeTree(child, session_keys)] + if d: + child = email.message_from_bytes(d, policy = email.policy.SMTP) + self.children = [_MimeTree(child, session_keys)] if sigs: self.is_signed = True |