列入后缀中的tld

在我的后缀设置中,我想“禁用”来自特定顶级域名(在我的情况下,所有以“.info”结尾的域名)的所有传入邮件。 我通常的方法是使用/etc/postfix/rejected_domains的哈希文件,看起来像这样

 [...] bla.info REJECT Spam blubb.info REJECT More Spam! [...] 

并在我的main.cf文件中有这样的configuration:

 # domains to be restricted smtpd_sender_restrictions = hash:/etc/postfix/rejected_domains reject_unauth_destinations = hash:/etc/postfix/rejected_domains 

我想阻止所有的信息是将这些规则添加到上述文件中:

 *.info REJECT Toooo much spam .info REJECT Toooo much spam 

不幸的是,这似乎并没有工作。

在Ubuntu LTS 10上使用postfix 2.8.5-2~build0.10.04

散列是文字(完全匹配),你想使用正则expression式或pcre:

正如Overmind指出的那样,如果你已经有了值,你可以追加这些值,你可以用你的值来检查你现有的值

 postconf smtpd_sender_restrictions postconf reject_unauth_destinations 

然后你可以重写它们:

 postconf -e smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains postconf -e reject_unauth_destinations=pcre:/etc/postfix/rejected_domains 

/ etc / postfix / rejected_domains的内容:

 /\.info$/ REJECT All Info Domains 

然后postfix reload