分类:
2008-03-14 14:34:11
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access regexp:/etc/postfix/pass_ip, reject_unauth_destination, reject_non_fqdn_hostname, reject_unknown_sender_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_invalid_hostname, reject_rbl_client cbl.anti-spam.org.cn=127.0.8.2, reject_rbl_client cdl.anti-spam.org.cn=127.0.8.4, reject_rbl_client cblplus.anti-spam.org.cn=127.0.8.6, reject_rbl_client cblless.anti-spam.org.cn=127.0.8.5
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, check_client_access regexp:/etc/postfix/pass_ip, reject_unknown_client, reject_rbl_client cbl.anti-spam.org.cn=127.0.8.2, reject_rbl_client cdl.anti-spam.org.cn=127.0.8.4, reject_rbl_client cblplus.anti-spam.org.cn=127.0.8.6, reject_rbl_client cblless.anti-spam.org.cn=127.0.8.5
我在/etc/postfix/pass_ip加入被列入RBL的IP地址。例如:(正则表示法)
/203.86.17.3$/ OK
/203.169.153.88$/ OK
运行: /usr/sbin/postmap -q - regexp:/etc/postfix/pass_ip < /etc/postfix/pass_ip 和 /usr/sbin/postfix reload 后
被列入RBL的IP依然被挡了,是不是这个access表不应该加在那两个参数中啊? 应该加在sender check中?
好像应该使用的是check_sender_access而不是check_recipient_access和check_client_access,我先试试
实验证明,的确是用check_sender_access加在那两个参数里。而且maps里面的内容必须是邮件地址或域名
我还尝试了一个解决办法:
smtpd_restriction_classes = from_freemail_host
from_freemail_host = check_client_access hash:/etc/postfix/freemail_hosts, reject
smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/freemail_access
smtpd_client_restrictions = check_sender_access hash:/etc/postfix/freemail_access
/etc/postfix/freemail_access的格式
yahoo.com from_freemail_host
/etc/postfix/freemail_hosts的格式:
yahoo.com OK
以上办法证实是可行的,但要注意一点,如果你的postfix同时配置了防止假冒地址(Preventing sender spoofing)的话,以上动作会使从yahoo.com发过来的信都会显示:'554 5.7.1 <>: Sender address rejected: Access denied'。
解决办法就是把yahoo.com的mx记录的ip地址也加入到freemail_access和freemail_hosts中去。
以上所说的方法同时适用于例外某些没有反解的但又需要正常联系的邮件地址。