From 6c8d4310e5c3ac365e5de16009f3536cdd4c7f03 Mon Sep 17 00:00:00 2001 From: Son Date: Fri, 25 Feb 2022 12:22:09 +0100 Subject: [PATCH] only set the X-SimpleLogin-Envelope-From header if user has this option enabled --- email_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/email_handler.py b/email_handler.py index 3f36eabf..525a30f9 100644 --- a/email_handler.py +++ b/email_handler.py @@ -801,7 +801,8 @@ def forward_email_to_mailbox( add_or_replace_header(msg, headers.SL_DIRECTION, "Forward") msg[headers.SL_EMAIL_LOG_ID] = str(email_log.id) - msg[headers.SL_ENVELOPE_FROM] = envelope.mail_from + if user.include_header_email_header: + msg[headers.SL_ENVELOPE_FROM] = envelope.mail_from # when an alias isn't in the To: header, there's no way for users to know what alias has received the email msg[headers.SL_ENVELOPE_TO] = alias.email