set "date" header in forward phase if needed

This commit is contained in:
Son NK 2020-11-02 14:53:22 +01:00
parent 38877598cf
commit c41c36acaa
1 changed files with 4 additions and 0 deletions

View File

@ -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