Browse Source

set "date" header in forward phase if needed

Son NK 4 years ago
parent
commit
c41c36acaa
1 changed files with 4 additions and 0 deletions
  1. 4 0
      email_handler.py

+ 4 - 0
email_handler.py

@@ -672,6 +672,10 @@ def forward_email_to_mailbox(
     add_or_replace_header(msg, _MESSAGE_ID, make_msgid(str(email_log.id), EMAIL_DOMAIN))
     add_or_replace_header(msg, _ENVELOPE_FROM, envelope.mail_from)
 
+    if not msg["Date"]:
+        date_header = formatdate()
+        msg["Date"] = date_header
+
     # change the from header so the sender comes from a reverse-alias
     # so it can pass DMARC check
     # replace the email part in from: header