diff options
-rw-r--r-- | alot/commands/envelope.py | 3 | ||||
-rw-r--r-- | alot/db/envelope.py | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index 60a9c1f4..17d32f89 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -131,8 +131,6 @@ class SaveCommand(Command): mail = envelope.construct_mail() # store mail locally - # add Date header - mail['Date'] = email.utils.formatdate(localtime=True) path = account.store_draft_mail( mail.as_string(policy=email.policy.SMTP)) @@ -242,7 +240,6 @@ class SendCommand(Command): try: self.mail = self.envelope.construct_mail() - self.mail['Date'] = email.utils.formatdate(localtime=True) self.mail = self.mail.as_string(policy=email.policy.SMTP) except GPGProblem as e: ui.clear_notify([clearme]) 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()] |