Explorar el Código

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

Son NK hace 5 años
padre
commit
bd68a52158
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      email_handler.py

+ 4 - 0
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