From aa1cac521b60fa628dfba8c039e4fae883daf735 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Tue, 27 Oct 2020 11:03:56 +0100 Subject: [PATCH] Set X-SimpleLogin-Envelope-From header in forward phase --- email_handler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/email_handler.py b/email_handler.py index 2ce22576..0b4f914c 100644 --- a/email_handler.py +++ b/email_handler.py @@ -125,6 +125,7 @@ _IP_HEADER = "X-SimpleLogin-Client-IP" _MAILBOX_ID_HEADER = "X-SimpleLogin-Mailbox-ID" _EMAIL_LOG_ID_HEADER = "X-SimpleLogin-EmailLog-ID" _MESSAGE_ID = "Message-ID" +_ENVELOPE_FROM = "X-SimpleLogin-Envelope-From" # fix the database connection leak issue @@ -650,6 +651,7 @@ def forward_email_to_mailbox( add_or_replace_header(msg, _MAILBOX_ID_HEADER, str(mailbox.id)) add_or_replace_header(msg, _EMAIL_LOG_ID_HEADER, str(email_log.id)) 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) # change the from header so the sender comes from @SL # so it can pass DMARC check