summaryrefslogtreecommitdiff
path: root/alot/db
diff options
context:
space:
mode:
authorpacien <pacien.trangirard@pacien.net>2019-11-23 21:36:26 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2019-11-23 22:07:07 +0000
commit4a590b9d4a62147f83a4ce1011e3c40337de156a (patch)
tree2269b7728ae257a28d3ce1ddfead665d29201023 /alot/db
parent59227e42199066ee5759abf681aff468ed05a4c8 (diff)
envelope: do not add another Date header if one is already present
Fixes https://github.com/pazz/alot/issues/1435: Do not add a Date header if it is already present
Diffstat (limited to 'alot/db')
-rw-r--r--alot/db/envelope.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 7e08289c..1e5de309 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -272,6 +272,11 @@ class Envelope:
outer_msg = unencrypted_msg
headers = self.headers.copy()
+
+ # add Date header
+ if 'Date' not in headers:
+ headers['Date'] = [email.utils.formatdate(localtime=True)]
+
# add Message-ID
if 'Message-ID' not in headers:
headers['Message-ID'] = [email.utils.make_msgid()]