only set the X-SimpleLogin-Envelope-From header if user has this option enabled

This commit is contained in:
Son 2022-02-25 12:22:09 +01:00
parent 007aa56551
commit 6c8d4310e5
1 changed files with 2 additions and 1 deletions

View File

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