Skip to content


postfix如何过滤某个域名邮件的发送?

mail日志中可以看到有些无效的域名邮件可以直接丢弃

5305 example.com[93.184.216.119]:25: Connection timed out
1265 mail.qq.co[50.23.198.74]:25: Connection refused
394 Host not found, try again
374 qqq.com[98.126.157.163]:25: Connection refused

设置check_recipient_access访问表
在smtpd_recipient_restrictions参数中增加check_recipient_access hash:/etc/postfix/recipient_access
例:

smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_access,permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination

/etc/postfix/recipient_access内容为:

[email protected] REJECT #具体地址
example.com REJECT #对整个域实现访问控制

postmap /etc/postfix/recipient_acces
之后执行 postfix reload

Posted in Mail/Postfix.

Tagged with .


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.