Explorar el Código

make sure user original email not revealed in Received-SPF header

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

+ 4 - 1
email_handler.py

@@ -110,7 +110,7 @@ class MailHandler:
 
 
         gen_email = GenEmail.get_by(email=alias)
         gen_email = GenEmail.get_by(email=alias)
         if not gen_email:
         if not gen_email:
-            LOG.d("alias %s not exist")
+            LOG.d("alias %s not exist", alias)
 
 
             # check if alias is custom-domain alias and if the custom-domain has catch-all enabled
             # check if alias is custom-domain alias and if the custom-domain has catch-all enabled
             alias_domain = get_email_domain_part(alias)
             alias_domain = get_email_domain_part(alias)
@@ -264,6 +264,9 @@ class MailHandler:
             msg, "List-Unsubscribe-Post", "List-Unsubscribe=One-Click"
             msg, "List-Unsubscribe-Post", "List-Unsubscribe=One-Click"
         )
         )
 
 
+        # Received-SPF is injected by postfix-policyd-spf-python can reveal user original email
+        delete_header(msg, "Received-SPF")
+
         LOG.d(
         LOG.d(
             "send email from %s to %s, mail_options:%s,rcpt_options:%s",
             "send email from %s to %s, mail_options:%s,rcpt_options:%s",
             alias,
             alias,