make sure to remove "X-SimpleLogin-Client-IP" during forward

This commit is contained in:
Son NK 2020-05-09 17:30:21 +02:00
parent 4cf868e5f1
commit bd68a52158
1 changed files with 4 additions and 0 deletions

View File

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