简体   繁体   English

PHPmailer泄露服务器IP地址,如何隐藏?

[英]PHPmailer disclose server IP address, how to hide it?

I'm using CloudFlare to hide original server IP address (preventing from attacks to the server, DDos...), but when I use PHPmailer on site for sending confirmation e-mails to the customers, it is easy for an attacker to get original IP because it is in email headers.我使用 CloudFlare 隐藏原始服务器 IP 地址(防止对服务器的攻击,DDos...),但是当我在现场使用 PHPmailer 向客户发送确认电子邮件时,攻击者很容易获得原始 IP,因为它位于电子邮件标头中。

PHPmailer is set to send via Google SMTP relay. PHPmailer 设置为通过 Google SMTP 中继发送。

Received: from www.website.com (webhosting2.xxx.cloud. [195.91.163.4])
        by smtp-relay.gmail.com with ESMTPS id 88sm967264wrf.7.2018.01.22.12.34.50
        for <thomas.cook@customer.com>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 22 Jan 2018 12:34:50 -0800 (PST)
X-Relaying-Domain: mywebsite.com
Date: Mon, 22 Jan 2018 20:34:50 +0000
To: thomas.cook@customer.com
From: "Website store" <info@mywebsite.com>
Reply-To: "Website store" <info@mywebsite.com>
Subject: Confirmation and payment instructions
Message-ID: <36830818e32b289e8637b8017a4fccf9@www.mywebsite.com>
X-Mailer: PHPMailer 5.2.23 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8

The problem is in first line " Received: from ... (server hostname and IP) "问题出在第一行“ Received: from ... (server hostname and IP)

Do you have any tips to modify PHPmailer code or other solution to hide originating server where is my website ?您有任何修改 PHPmailer 代码或其他解决方案以隐藏原始服务器的提示吗?

Thanks谢谢

You can't prevent that appearing because it's added by the receiving server, not the sending one, so it's out of your control.您无法阻止它的出现,因为它是由接收服务器添加的,而不是发送服务器添加的,因此它不受您的控制。

Because you're relaying though, there's no particular reason that the origin server needs to be internet-accessible at all;因为你是在中继,所以源服务器根本没有特殊的理由需要可以访问互联网; the only external connection it needs is outbound SMTP to google's mail servers, so you can block everything else.它唯一需要的外部连接是到 google 邮件服务器的出站 SMTP,因此您可以阻止其他所有内容。 If that firewalling is done upstream from your server, then it will be nicely insulated and not actually suffer any of the DDoS traffic.如果防火墙是在您的服务器上游完成的,那么它将被很好地隔离并且实际上不会受到任何 DDoS 流量的影响。

This is more of a security or server fault question.这更像是一个安全或服务器故障问题。

Service PostmarkApp.com is good for this purpose.服务 PostmarkApp.com 非常适合此目的。 It is for transactional emails (not for marketing) and it's hiding IP address of the originating server.它用于交易电子邮件(不用于营销)并且它隐藏了原始服务器的 IP 地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM