我怎么能阻止传出邮件到一个特定的地址使用Postfix?
我已经部分设法阻止使用header_checks传出的电子邮件。 但是,header_checks不包括BCC。
我也testing了这个解决scheme: http : //www.linuxmail.info/postfix-restrict-sender-recipient/但它没有工作。
如访问(5)中所述 ,只需将一个check_recipient_access映射添加到您的smtpd_recipient_restrictions; 如果您希望为自己的用户阻止这些收件人,请确保将其放置在 permit_mynetworks和/或permit_sasl_authenticated之前。
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/bad_recipients, permit_mynetworks, reject_unauth_destination, permit
并在/ etc / postfix / bad_recipients中:
[email protected] REJECT We don't like him [email protected] REJECT Delivery to this user is prohibited
要阻止任何人(本地(邮件/ sendmail命令)系统用户和SMTP用户)发送到电子邮件地址,您不能依赖smtpd_recipient_restrictions 。 您需要将限制放入qmgr阶段。 为此,我发现transport_maps运作良好。
main.cf : transport_maps = pcre:/etc/postfix/transport_maps
transport_maps : /^user(\+?[^@]+)?@host\.com/ discard: /.*/ :
也许有更好的解决scheme,但这似乎适用于所有交付types。 仅供参考,该正则expression式支持[email protected]和[email protected]并假定使用+分隔符。 它防止To,CC和BCC。
我们有这种情况的用例,我们需要阻止一些用户从列表中接收(select)邮件。 拒绝按这些用户请求的邮件中的“取消订阅”链接的用户 (所以,不,它不是垃圾邮件)。 过了一段时间,我们收到了那些得到那些奇怪的懒惰用户投诉的ISP的滥用邮件,这真是浪费时间。 所以我们决定为postfix创build一个映射。 然而,把它们放在一个REJECT中,通过postfix发送邮件给软件带来了新的问题,所以我们最终做的是映射它:
[email protected] DISCARD Delivery to this user is ignored as a result of annoying abuse-responses from even lazier ISPs.