Preserve original from header in X-SimpleLogin-Original-From (#1784)
* Preserve original from in the headers * Update the settings page --------- Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
This commit is contained in:
parent
8512093bfc
commit
d3aae31d45
|
@ -33,6 +33,7 @@ DKIM_HEADERS = [
|
|||
SL_DIRECTION = "X-SimpleLogin-Type"
|
||||
SL_EMAIL_LOG_ID = "X-SimpleLogin-EmailLog-ID"
|
||||
SL_ENVELOPE_FROM = "X-SimpleLogin-Envelope-From"
|
||||
SL_ORIGINAL_FROM = "X-SimpleLogin-Original-From"
|
||||
SL_ENVELOPE_TO = "X-SimpleLogin-Envelope-To"
|
||||
SL_CLIENT_IP = "X-SimpleLogin-Client-IP"
|
||||
|
||||
|
|
|
@ -897,6 +897,7 @@ def forward_email_to_mailbox(
|
|||
msg[headers.SL_EMAIL_LOG_ID] = str(email_log.id)
|
||||
if user.include_header_email_header:
|
||||
msg[headers.SL_ENVELOPE_FROM] = envelope.mail_from
|
||||
msg[headers.SL_ORIGINAL_FROM] = contact.website_email
|
||||
# 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
|
||||
|
||||
|
|
|
@ -684,7 +684,8 @@
|
|||
SimpleLogin forwards emails to your mailbox from the <b>reverse-alias</b> and not from the <b>original</b>
|
||||
sender address.
|
||||
<br />
|
||||
If this option is enabled, the original sender addresses is stored in the email header <b>X-SimpleLogin-Envelope-From</b>.
|
||||
If this option is enabled, the original sender addresses is stored in the email header <b>X-SimpleLogin-Envelope-From</b>
|
||||
and the original From header is stored in <b>X-SimpleLogin-Original-From<b>.
|
||||
You can choose to display this header in your email client.
|
||||
<br />
|
||||
As email headers aren't encrypted, your mailbox service can know the sender address via this header.
|
||||
|
|
|
@ -24,6 +24,7 @@ References:
|
|||
<af07e94a66ece6564ae30a2aaac7a34c@frontapp.com>
|
||||
From: {{ sender_address }}
|
||||
To: {{ recipient_address }}
|
||||
CC: {{ cc_address }}
|
||||
Subject: Something
|
||||
Message-ID: <af07e94a66ece6564ae30a2aaac7a34c@frontapp.com>
|
||||
X-Mailer: Front (1.0; +https://frontapp.com;
|
||||
|
|
|
@ -17,7 +17,11 @@ def test_original_headers_from_preserved():
|
|||
original_sender_address = random_email()
|
||||
msg = load_eml_file(
|
||||
"replacement_on_forward_phase.eml",
|
||||
{"sender_address": original_sender_address, "recipient_address": alias.email},
|
||||
{
|
||||
"sender_address": original_sender_address,
|
||||
"recipient_address": alias.email,
|
||||
"cc_address": random_email(),
|
||||
},
|
||||
)
|
||||
envelope = Envelope()
|
||||
envelope.mail_from = f"env.{original_sender_address}"
|
||||
|
@ -28,6 +32,7 @@ def test_original_headers_from_preserved():
|
|||
assert len(send_requests) == 1
|
||||
request = send_requests[0]
|
||||
assert request.msg[headers.SL_ENVELOPE_FROM] == envelope.mail_from
|
||||
assert request.msg[headers.SL_ORIGINAL_FROM] == original_sender_address
|
||||
assert (
|
||||
request.msg[headers.AUTHENTICATION_RESULTS]
|
||||
== msg[headers.AUTHENTICATION_RESULTS]
|
||||
|
|
Loading…
Reference in New Issue