将 Postfix 配置为仅在生产服务器上发送邮件的最佳方法是什么?

x_v*_*i_r 0 security postfix ubuntu-12.04

我正在网上搜索以找到配置 Postfix 的最佳方法。

我不想安装完整的 Postfix 服务器,我唯一想要的就是使用 PHP mail() 发送邮件。我知道这可能很棘手,垃圾邮件发送者喜欢错误配置的邮件服务器。所以,我正在寻找最好的方法来做到这一点。

我找到的最好的文档是Archlinux one

但是在几个博客上我发现了一些像这样更棘手的配置

myhostname = foo.me
mydestination = localhost
mynetworks = 127.0.0.0/8

myorigin = /etc/mailname
mydestination = sd-24300.com , localhost
mail_owner = postfix

smtpd_recipient_restrictions =reject_unknown_sender_domain,reject_non_fqdn_sender,reject_unknown_recipient_domain,reject_non_fqdn_recipient,permit_mynetworks,reject_unauth_destination,permit
smtpd_data_restrictions =reject_unauth_pipelining,permit
inet_interfaces = loopback-only
Run Code Online (Sandbox Code Playgroud)

所以我的问题很简单,最好的方法是什么?最好的我的意思是更安全的。

Ps:我的服务器运行带有 LAMP 的 Ubuntu 12.04

Sve*_*ven 5

使用nullmailer而不是 Postfix,它是为此目的而制作的仅中继服务器。

它在universe回购中可用。