停止Postfix显示退回邮件中的最终电子邮件转发地址

我有一个Postfix服务器接收邮件的虚拟别名,并将其转发到真正的目标地址。 当最终邮件服务器返回错误时,返回给发件人的退回邮件显示最终的目标电子邮件地址。 例如。 如果我的服务器收到[email protected]的邮件,并尝试将邮件发送到[email protected],则退回邮件看起来像这样:

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) 

我如何阻止它泄露最后的地址?

弄清楚了。 你需要确保邮件被拒绝,而不是反弹,并设置unverified_recipient_reject_reason,以避免泄露真实的消息。 我之前尝试过,但诀窍是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 

我之前在reject_unverified_recipient之前有两个许可限制,因此它们被首先处理,并且来自任何本地或经过身份validation的发件人的邮件都不受收件人地址validation的限制。 它只有在被接受后才会失败,并产生一个退信消息。

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