阻止 Postfix 在退回邮件中透露最终的电子邮件转发地址

阻止 Postfix 在退回邮件中透露最终的电子邮件转发地址

我有一台 Postfix 服务器,它接收虚拟别名的邮件并将其转发到真实目标地址。当最终邮件服务器返回错误时,返回给发件人的退回消息会显示最终目标电子邮件地址。例如,如果我的服务器接收邮件[电子邮件保护]并尝试将其发送到[电子邮件保护]退回邮件内容如下:

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<[email protected]> (expanded from <[email protected]>): host
    final.mail.host.com said: 553 5.1.8
    <[email protected]>... <some error> (in reply to RCPT TO command)

我怎样才能阻止它透露最终地址?

答案1

搞定了。您需要确保邮件被拒绝,而不是被退回,并设置未经验证的收件人拒绝原因以避免泄露真实信息。我以前也试过,但诀窍在于句子中子句的顺序smtpd_recipient_restrictions

smtpd_recipient_restrictions = reject_unknown_recipient_domain, reject_unverified_recipient, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
unverified_recipient_reject_reason = Recipient address verification failed

我之前有过两个允许之前的限制拒绝未经验证的收件人,因此它们首先被处理,来自任何本地或经过身份验证的发件人的邮件均不受收件人地址验证。它只是在被接受后才失败,并生成了退回邮件。

这仍然不完美,因为最终的 MTA 可以将退回邮件发送回原始发件人,但您对此无能为力。相关 Postfix 邮件列表主题:http://tech.groups.yahoo.com/group/postfix-users/message/251715

相关内容