summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien <pacien.trangirard@pacien.net>2019-11-23 22:16:11 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2019-11-24 09:10:13 +0000
commitf1ceccaa58bb36cac73e6886a0b14230e5518fda (patch)
tree0be85de09ad586748fcc35a1430d6d28bffb0ed3
parent4a590b9d4a62147f83a4ce1011e3c40337de156a (diff)
envelope: add setting for custom Message-ID domain
This allows users to use a custom domain in automatically generated Message-ID headers instead of the local hostname.
-rw-r--r--alot/db/envelope.py3
-rw-r--r--alot/defaults/alot.rc.spec4
-rw-r--r--docs/source/configuration/alotrc_table11
3 files changed, 17 insertions, 1 deletions
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 1e5de309..041b7124 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -279,7 +279,8 @@ class Envelope:
# add Message-ID
if 'Message-ID' not in headers:
- headers['Message-ID'] = [email.utils.make_msgid()]
+ domain = settings.get('message_id_domain')
+ headers['Message-ID'] = [email.utils.make_msgid(domain=domain)]
if 'User-Agent' in headers:
uastring_format = headers['User-Agent'][0]
diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec
index 95a07717..4a8999b3 100644
--- a/alot/defaults/alot.rc.spec
+++ b/alot/defaults/alot.rc.spec
@@ -197,6 +197,10 @@ quit_on_last_bclose = boolean(default=False)
# The string '{version}' will be replaced by the version string of the running instance.
user_agent = string(default='alot/{version}')
+# Domain to use in automatically generated Message-ID headers.
+# The default is the local hostname.
+message_id_domain = string(default=None)
+
# Suffix of the prompt used when waiting for user input
prompt_suffix = string(default=':')
diff --git a/docs/source/configuration/alotrc_table b/docs/source/configuration/alotrc_table
index b0f0fc15..12020398 100644
--- a/docs/source/configuration/alotrc_table
+++ b/docs/source/configuration/alotrc_table
@@ -380,6 +380,17 @@
:default: ,
+.. _message-id-domain:
+
+.. describe:: message_id_domain
+
+ Domain to use in automatically generated Message-ID headers.
+ The default is the local hostname.
+
+ :type: string
+ :default: None
+
+
.. _msg-summary-hides-threadwide-tags:
.. describe:: msg_summary_hides_threadwide_tags