- 论坛徽章:
- 0
|
系统:Debian/Etch
Postfix 2.3.4-3
main.cf里面加上了这一段:
- smtpd_client_restrictions =
- permit_mynetworks,
- permit_sasl_authenticated,
- check_client_access hash:/etc/postfix/access,
- reject_unknown_client_hostname
复制代码
然后创建一个新文件:/etc/postfix/access,权限为:
- -rw-r--r-- 1 root postfix 143 2007-01-23 17:40 access
复制代码
内容为:
- .hotmail.com REJECT
- .digitalriver.com REJECT
- .absgroup.com REJECT
- .macbilling.com REJECT
- .nobumoto.com REJECT
- .protektedrecords.com REJECT
复制代码
接下来为了使设置生效,运行了如下命令:
- mail:~# postmap hash:/etc/postfix/access
- mail:~# /etc/init.d/postfix reload
复制代码
我仔细看过Postfix的官方文档,关于access的部分是这样描述的:
...
pattern action
When pattern matches a mail address, domain or host
address, perform the corresponding action.
...
...
...
domain.tld
Matches domain.tld as the domain part of an email
address.
The pattern domain.tld also matches subdomains, but
only when the string smtpd_access_maps is listed in
the Postfix parent_domain_matches_subdomains con-
figuration setting (note that this is the default
for some versions of Postfix). Otherwise, specify
.domain.tld (note the initial dot) in order to
match subdomains.
...
...
...
REJECT optional text...
Reject the address etc. that matches the pattern.
Reply with $reject_code optional text... when the
optional text is specified, otherwise reply with a
generic error response message.
...
结合我上面的access文件,设定应该没有写错,可是我用自己的hotmail帐号测试给我的邮件服务器发信,却无法REJECT,mail.log里面是这样的:
- Jan 23 17:41:55 mail postfix/smtpd[28447]: connect from bay0-omc3-s20.bay0.hotmail.com[65.54.246.220]
- Jan 23 17:41:56 mail postfix/smtpd[28447]: 245883A10C: client=bay0-omc3-s20.bay0.hotmail.com[65.54.246.220]
- Jan 23 17:41:56 mail postfix/cleanup[28450]: 245883A10C: message-id=<BAY7-F26A2A495000268406D89C7BDAD0@phx.gbl>
- Jan 23 17:41:56 mail postfix/qmgr[28419]: 245883A10C: from=<wasilylin@hotmail.com>, size=1239, nrcpt=1 (queue active)
- Jan 23 17:41:56 mail postfix/virtual[28451]: 245883A10C: to=<linxiaosong@keynet.com.cn>, relay=virtual, delay=0.71, delays=0.69/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
- Jan 23 17:41:56 mail postfix/qmgr[28419]: 245883A10C: removed
- Jan 23 17:41:56 mail postfix/smtpd[28447]: disconnect from bay0-omc3-s20.bay0.hotmail.com[65.54.246.220]
复制代码
也就是说,这个黑名单根本就没有生效,查过google和postfix的官方列表,都没有找到答案,很明显是我的设置哪里出错了,但是反复检查也没有查出什么问题。 |
|