diff options
author | Lucas Hoffmann <l-m-h@web.de> | 2017-06-22 23:40:51 +0200 |
---|---|---|
committer | Lucas Hoffmann <l-m-h@web.de> | 2017-06-22 23:54:16 +0200 |
commit | 674d9acabfbc130a2e19acc2dd1811e8843fb483 (patch) | |
tree | 704f81d8269acbf0cabc09f838761803a0aae8fc /alot | |
parent | f3337159112a8342403e54e9dff241f5f3a6af27 (diff) |
Remember matched account explicitly
Otherwise the next account in the for loop might have been returned if
the account was found to match with its last alias.
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/thread.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index df22e0f1..5fa254c4 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -54,6 +54,7 @@ def determine_sender(mail, action='reply'): assert action in ['reply', 'forward', 'bounce'] realname = None address = None + matching_account = None # get accounts my_accounts = settings.get_accounts() @@ -93,17 +94,18 @@ def determine_sender(mail, action='reply'): address = account.address else: address = seen_address + matching_account = account # revert to default account if nothing found if realname is None: - account = my_accounts[0] - realname = account.realname - address = account.address + matching_account = my_accounts[0] + realname = matching_account.realname + address = matching_account.address logging.debug('using realname: "%s"', realname) logging.debug('using address: %s', address) from_value = formataddr((realname, address)) - return from_value, account + return from_value, matching_account @registerCommand(MODE, 'reply', arguments=[ |