diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2013-04-24 08:38:17 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2013-04-24 08:38:17 +0100 |
commit | ce59541e92dc2b163a269e3fbacecb0175b3ffaa (patch) | |
tree | 3221a78575c30e3b39a89bdb9f0291d3786d2cfb /alot | |
parent | b3cba1b83b5ea67de891f6e3b050293b5952e408 (diff) |
make reply code slightly more readable
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/thread.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index e894e5b2..8ec46b84 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -55,22 +55,22 @@ def determine_sender(mail, action='reply'): my_accounts = settings.get_accounts() assert my_accounts, 'no accounts set!' - # extract list of recipients to check for my address - recipients = getaddresses(mail.get_all('To', []) - + mail.get_all('Cc', []) - + mail.get_all('Delivered-To', []) - + mail.get_all('From', [])) - - logging.debug('recipients: %s' % recipients) - # pick the most important account that has an address in recipients - # and use that accounts realname and the found recipient address + # extract list of addresses to check for my address + candidate_addresses = getaddresses(mail.get_all('To', []) + + mail.get_all('Cc', []) + + mail.get_all('Delivered-To', []) + + mail.get_all('From', [])) + + logging.debug('candidate addresses: %s' % candidate_addresses) + # pick the most important account that has an address in candidates + # and use that accounts realname and the address found here for account in my_accounts: acc_addresses = account.get_addresses() for alias in acc_addresses: if realname is not None: break regex = re.compile(alias) - for seen_name, seen_address in recipients: + for seen_name, seen_address in candidate_addresses: if regex.match(seen_address): logging.debug("match!: '%s' '%s'" % (seen_address, alias)) if settings.get(action + '_force_realname'): |