summaryrefslogtreecommitdiff
path: root/alot/commands/utils.py
diff options
context:
space:
mode:
authorvrs <none>2018-12-08 22:20:05 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2018-12-10 10:25:49 +0000
commitb981bfe0c61d9aa55652b4b0a01b846aaa9c993a (patch)
treeb16298ac338ef19758af553b845ddc05b6124fc1 /alot/commands/utils.py
parentfdac378674a3e90413fcfba3dd2c9cc0debbb9cc (diff)
attach accounts to envelopes
simplifies a few tests, fixes #1177
Diffstat (limited to 'alot/commands/utils.py')
-rw-r--r--alot/commands/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/alot/commands/utils.py b/alot/commands/utils.py
index ace63b03..14ca78af 100644
--- a/alot/commands/utils.py
+++ b/alot/commands/utils.py
@@ -46,7 +46,10 @@ async def update_keys(ui, envelope, block_error=False, signed_only=False):
if 'From' in envelope.headers:
try:
- acc = settings.get_account_by_address(envelope['From'])
+ if envelope.account is None:
+ envelope.account = settings.get_account_by_address(
+ envelope['From'])
+ acc = envelope.account
if acc.encrypt_to_self:
if acc.gpg_key:
logging.debug('encrypt to self: %s', acc.gpg_key.fpr)