如何在Postfix中列出主机/ IP地址
版本1.0
作者:Falko Timme
如果您正在管理邮件服务器并使用黑名单来阻止垃圾邮件(例如本文中: 如何在进入服务器之前阻止垃圾邮件(Postfix) ),您可能知道这个问题:您的客户不时抱怨他们无法接收来自某些免费电话的电子邮件。 最常见的情况是因为免费电话被滥用发送垃圾邮件,因此被列入黑名单。 此简短指南显示如何在Postfix中将这样的邮件服务器列入白名单,以使您的客户再次开心。
我不会保证这将为您工作!
如果黑名单服务器尝试将邮件发送到您的服务器,您应该在邮件日志中找到这样的信息:
SMTP error from remote mail server after RCPT TO:<bla@example.com>: host mail.example.com [4.3.2.1]: 554 5.7.1 Service unavailable; Client host [1.2.3.4] blocked using dnsbl.sorbs.net; Currently Sending Spam See: http://www.sorbs.net/lookup.shtml?1.2.3.4
在此示例中,邮件服务器1.2.3.4
被列入黑名单,因此被阻止。
要将该服务器列入白名单,请创建文件/ etc / postfix / rbl_override
,其中列出要列入白名单的所有IP地址或主机名(每行一个!):
vi /etc/postfix/rbl_override
1.2.3.4 OK 1.2.3.5 OK mail.freemailer.tld OK |
创建/修改该文件后,必须运行
postmap /etc/postfix/rbl_override
接下来打开/etc/postfix/main.cf
并搜索smtpd_recipient_restrictions
参数。 将check_client_access哈希:/ etc / postfix / rbl_override添加
到该参数后,在reject_unauth_destination
之后,但在第一个黑名单之前。
所以如果smtpd_recipient_restrictions
看起来像这样现在...
vi /etc/postfix/main.cf
[...] smtpd_recipient_restrictions = reject_invalid_hostname, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client multi.uribl.com, reject_rbl_client dsn.rfc-ignorant.org, reject_rbl_client dul.dnsbl.sorbs.net, reject_rbl_client list.dsbl.org, reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client dnsbl.sorbs.net, reject_rbl_client cbl.abuseat.org, reject_rbl_client ix.dnsbl.manitu.net, reject_rbl_client combined.rbl.msrbl.net, reject_rbl_client rabl.nuclearelephant.com, permit [...] |
...修改它,使其看起来如下:
[...] smtpd_recipient_restrictions = reject_invalid_hostname, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_client_access hash:/etc/postfix/rbl_override, reject_rbl_client multi.uribl.com, reject_rbl_client dsn.rfc-ignorant.org, reject_rbl_client dul.dnsbl.sorbs.net, reject_rbl_client list.dsbl.org, reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client dnsbl.sorbs.net, reject_rbl_client cbl.abuseat.org, reject_rbl_client ix.dnsbl.manitu.net, reject_rbl_client combined.rbl.msrbl.net, reject_rbl_client rabl.nuclearelephant.com, permit [...] |
而已! 重新启动Postfix,你完成了:
/etc/init.d/postfix restart
链接
- Postfix: http : //www.postfix.org