在我的 postfix 设置中,我想“禁用”来自特定 TLD 域的所有传入邮件(在我的情况下,所有域都以“.info”结尾)。我阻止域的常用方法是在 中使用散列文件/etc/postfix/rejected_domains,看起来像这样
[...]
bla.info REJECT Spam
blubb.info REJECT More Spam!
[...]
Run Code Online (Sandbox Code Playgroud)
并在我的main.cf文件中有这段配置:
# domains to be restricted
smtpd_sender_restrictions = hash:/etc/postfix/rejected_domains
reject_unauth_destinations = hash:/etc/postfix/rejected_domains
Run Code Online (Sandbox Code Playgroud)
我阻止所有信息的想法是将这些规则添加到上述文件中:
*.info REJECT Toooo much spam
.info REJECT Toooo much spam
Run Code Online (Sandbox Code Playgroud)
不幸的是,这似乎不起作用。
2.8.5-2~build0.10.04在此处在 Ubuntu LTS 10 上使用 postfix 。
哈希用于文字(完全匹配),您想使用正则表达式或 pcre:
正如Overmind指出的,如果你已经有值,你想附加这些,你可以检查你现有的值
postconf smtpd_sender_restrictions
postconf reject_unauth_destinations
Run Code Online (Sandbox Code Playgroud)
然后你可以用以下方法覆盖它们:
postconf -e smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains
postconf -e reject_unauth_destinations=pcre:/etc/postfix/rejected_domains
Run Code Online (Sandbox Code Playgroud)
/etc/postfix/rejected_domains 的内容:
/\.info$/ REJECT All Info Domains
Run Code Online (Sandbox Code Playgroud)
进而 postfix reload
| 归档时间: |
|
| 查看次数: |
7837 次 |
| 最近记录: |