diff options
author | Lucas Hoffmann <l-m-h@web.de> | 2017-06-22 17:37:59 +0200 |
---|---|---|
committer | Lucas Hoffmann <l-m-h@web.de> | 2017-06-23 00:22:34 +0200 |
commit | e072bb81c34df5516b95029022b0bff1a7c69341 (patch) | |
tree | a645ab4647762d768638ef5edf65ddcfe2764290 /alot | |
parent | 48d23e1593f6ddad644e951072ab08ec8eb06c3a (diff) |
Use account instead of realname to break loops
This fixes a bug in determine_sender where an account that did match but
did not have a realname set was "not found" in case force_realname was
set.
Helped-By: Pol Van Aubel <dev@polvanaubel.com>
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/thread.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 5fa254c4..c1743264 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -68,7 +68,7 @@ def determine_sender(mail, action='reply'): # account X is the one selected and not account Y. candidate_headers = settings.get("reply_account_header_priority") for candidate_header in candidate_headers: - if realname is not None: + if matching_account is not None: break candidate_addresses = getaddresses(mail.get_all(candidate_header, [])) @@ -80,7 +80,7 @@ def determine_sender(mail, action='reply'): if account.alias_regexp is not None: acc_addresses.append(account.alias_regexp) for alias in acc_addresses: - if realname is not None: + if matching_account is not None: break regex = re.compile('^' + alias + '$', flags=re.IGNORECASE) for seen_name, seen_address in candidate_addresses: @@ -97,7 +97,7 @@ def determine_sender(mail, action='reply'): matching_account = account # revert to default account if nothing found - if realname is None: + if matching_account is None: matching_account = my_accounts[0] realname = matching_account.realname address = matching_account.address |