虚拟主机/Postfix邮件日志,显示发送网站

发布于 2024-12-27 09:24:48 字数 248 浏览 2 评论 0原文

我已经在谷歌上搜索了一段时间,但无法找到任何解决方案或任何信息。

我需要做的是配置 postfix,以便当我们的网站之一使用 PHP 发送邮件(通过联系我们表格或 w/e)时,邮件日志将显示发送网站是什么。通过这种方式,我们可以识别受感染的网站/表单等,以防我们的 IP 地址之一被列入黑名单。我们运行虚拟主机,因此每台服务器上可以有数十到数百个网站。如果我们手动追踪它们可能会花费很长时间。

这可能吗?如果我在谷歌上找不到任何东西,也许就不是了:(

I've been googling around for awhile now and have been unable to find any sort of solution or any information at all.

What I need to do is to configure postfix so that when one of our websites sends mail using PHP (via a contact us form or w/e) the mail log will show what the sending website was. This way we can identify a compromised website/form, etc in case one of our IP addresses should get blacklisted. We run virtual hosts so each server could have dozens to hundreds of websites on them. For us to otherwise track them down manually could take forever.

Is this even possible? Perhaps its not if I couldn't find anything on google :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

熊抱啵儿 2025-01-03 09:24:48

考虑使用 PHP 5.3 的新 mail.log 配置指令。它将允许您定义一个日志文件,其中记录对 mail() 函数的所有调用,包括“收件人”地址、标头以及进行调用的脚本的完整路径。

如果您没有运行 5.3,请考虑升级到它,或者在几周后发布到 5.4。

不幸的是,这只是解决方案的一半。有许多支持 SMTP 的 PHP 邮件库。如果您允许本地 SMTP 连接(大多数优秀的网络托管提供商都应该这样做),那么用户将有办法绕过该日志。

Consider using PHP 5.3's new mail.log configuration directive. It will allow you to define a log file where all calls to the mail() function are recorded, including the To address, the headers, and the full path to the script that made the call.

If you aren't running 5.3, consider upgrading to it, or to 5.4 once it's out in a few weeks.

Unfortunately this is only half of a solution. There are numerous PHP mail libraries that speak SMTP. If you permit local SMTP connections (as most good web hosting providers should), then users would have a way to bypass that log.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文