mirror of
https://github.com/simple-login/app.git
synced 2025-09-16 19:44:26 +08:00
Preserve List-ID (#2420)
This commit is contained in:
parent
3962ab5fb0
commit
bb4d51d6e0
3 changed files with 9 additions and 0 deletions
|
@ -19,6 +19,7 @@ CC = "Cc"
|
|||
DKIM_SIGNATURE = "DKIM-Signature"
|
||||
X_SPAM_STATUS = "X-Spam-Status"
|
||||
LIST_UNSUBSCRIBE = "List-Unsubscribe"
|
||||
LIST_ID = "List-Id"
|
||||
LIST_UNSUBSCRIBE_POST = "List-Unsubscribe-Post"
|
||||
RETURN_PATH = "Return-Path"
|
||||
AUTHENTICATION_RESULTS = "Authentication-Results"
|
||||
|
@ -40,6 +41,7 @@ SL_ENVELOPE_TO = "X-SimpleLogin-Envelope-To"
|
|||
SL_CLIENT_IP = "X-SimpleLogin-Client-IP"
|
||||
SL_ORIGINAL_LIST_UNSUBSCRIBE = "X-SimpleLogin-Original-List-Unsubscribe"
|
||||
SL_ORIGINAL_LIST_UNSUBSCRIBE_POST = "X-SimpleLogin-Original-List-Unsubscribe-Post"
|
||||
SL_ORIGINAL_LIST_ID = "X-SimpleLogin-Original-List-Id"
|
||||
|
||||
# to let Rspamd know that the message should be signed
|
||||
SL_WANT_SIGNING = "X-SimpleLogin-Want-Signing"
|
||||
|
|
|
@ -144,6 +144,12 @@ class UnsubscribeGenerator:
|
|||
add_or_replace_header(
|
||||
message, headers.SL_ORIGINAL_LIST_UNSUBSCRIBE_POST, unsubscribe_data
|
||||
)
|
||||
unsubscribe_data = message[headers.LIST_ID]
|
||||
if unsubscribe_data:
|
||||
add_or_replace_header(
|
||||
message, headers.SL_ORIGINAL_LIST_ID, unsubscribe_data
|
||||
)
|
||||
delete_header(message, headers.LIST_ID)
|
||||
for header in original_unsub_proxied:
|
||||
add_or_replace_header(
|
||||
message, f"X-SL-Proxy-{header}", original_unsub_proxied[header]
|
||||
|
|
|
@ -839,6 +839,7 @@ def forward_email_to_mailbox(
|
|||
headers.IN_REPLY_TO,
|
||||
headers.SL_QUEUE_ID,
|
||||
headers.LIST_UNSUBSCRIBE,
|
||||
headers.LIST_ID,
|
||||
headers.LIST_UNSUBSCRIBE_POST,
|
||||
] + headers.MIME_HEADERS
|
||||
if user.include_header_email_header:
|
||||
|
|
Loading…
Add table
Reference in a new issue