summaryrefslogtreecommitdiff
path: root/alot/settings
diff options
context:
space:
mode:
authorvrs <none>2018-12-08 23:11:24 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2018-12-10 10:25:49 +0000
commitf7c5b841568886be64695a14f341c4c7c58b3fba (patch)
tree415ff08c0d7a9b5e695c4c9e26ede7e000db1eba /alot/settings
parentb981bfe0c61d9aa55652b4b0a01b846aaa9c993a (diff)
match addresses against accounts, not address lists
fixes #1230, fixes an unfiled bug in clear_my_address()
Diffstat (limited to 'alot/settings')
-rw-r--r--alot/settings/manager.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/alot/settings/manager.py b/alot/settings/manager.py
index d1f57083..87ae14c7 100644
--- a/alot/settings/manager.py
+++ b/alot/settings/manager.py
@@ -469,16 +469,16 @@ class SettingsManager(object):
:param str address: address to look up. A realname part will be ignored.
:param bool return_default: If True and no address can be found, then
- the default account wil be returned
+ the default account wil be returned.
:rtype: :class:`Account`
:raises ~alot.settings.errors.NoMatchingAccount: If no account can be
found. This includes if return_default is True and there are no
accounts defined.
"""
_, address = email.utils.parseaddr(address)
- for myad in self.get_addresses():
- if myad == address:
- return self._accountmap[myad]
+ for account in self.get_accounts():
+ if account.matches_address(address):
+ return account
if return_default:
try:
return self.get_accounts()[0]