summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPol Van Aubel <dev@polvanaubel.com>2015-06-02 12:38:04 +0200
committerPatrick Totzke <patricktotzke@gmail.com>2016-12-06 14:46:38 +0000
commite9062faa5a66ae7b21c7df7cbb0528803ae0b95d (patch)
tree753432432cd4b6d0df1a70387606cb74bdb12e14 /alot
parentff42963e2028c99610f905b6ddd589e98019ffad (diff)
Make header list configurable.
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/thread.py4
-rw-r--r--alot/defaults/alot.rc.spec8
2 files changed, 9 insertions, 3 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index 3dff6855..b6e91c47 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -64,8 +64,8 @@ def determine_sender(mail, action='reply'):
# Process the headers in order of importance: if a mail was sent with
# account X, with account Y in e.g. CC or delivered-to, make sure that
# account X is the one selected and not account Y.
- for candidate_header in ['From', 'To', 'Cc', 'Envelope-To',
- 'X-Envelope-To', 'Delivered-To']:
+ candidate_headers = settings.get("determine_reply_account_from_headers")
+ for candidate_header in candidate_headers:
if realname is not None:
break
candidate_addresses = getaddresses(mail.get_all(candidate_header, []))
diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec
index 0967bf4f..5c8bcd07 100644
--- a/alot/defaults/alot.rc.spec
+++ b/alot/defaults/alot.rc.spec
@@ -229,7 +229,13 @@ prefer_plaintext = boolean(default=False)
# messages in that thread.
msg_summary_hides_threadwide_tags = boolean(default=True)
-# Key bindings
+# The list of headers to match to determine sending account for a reply.
+# Headers are searched in the order in which they are specified here, and the first match
+# is used. If multiple accounts match the same header, the one defined first in the account
+# block is used.
+determine_reply_account_from_headers = force_list(default=list(From,To,Cc,Envelope-To,X-Envelope-To,Delivered-To))
+
+# Key bindings
[bindings]
__many__ = string(default=None)
[[___many___]]