From bd68a5215843cf2421c763e8f37cbdad68bb5023 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sat, 9 May 2020 17:30:21 +0200 Subject: [PATCH] make sure to remove "X-SimpleLogin-Client-IP" during forward --- email_handler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/email_handler.py b/email_handler.py index 3bba6e54..7bd87a9d 100644 --- a/email_handler.py +++ b/email_handler.py @@ -91,6 +91,8 @@ from server import create_app # can happen when user "Reply All" on some email clients _SELF_FORWARDING_STATUS = "550 SL self-forward" +_IP_HEADER = "X-SimpleLogin-Client-IP" + # fix the database connection leak issue # use this method instead of create_app @@ -367,6 +369,8 @@ def handle_forward(envelope, smtp: SMTP, msg: Message, rcpt_to: str) -> (bool, s delete_header(msg, "Reply-To") delete_header(msg, "Sender") + delete_header(msg, _IP_HEADER) + # change the from header so the sender comes from @SL # so it can pass DMARC check # replace the email part in from: header