summaryrefslogtreecommitdiff
path: root/alot/commands/utils.py
diff options
context:
space:
mode:
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)