AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 728641
Accepted
Rob
Rob
Asked: 2015-10-14 06:50:42 +0800 CST2015-10-14 06:50:42 +0800 CST 2015-10-14 06:50:42 +0800 CST

在 postfix 中将 tld 列入黑名单

  • 772

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

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

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

# 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 上的后缀2.8.5-2~build0.10.04。

postfix
  • 1 1 个回答
  • 8293 Views

1 个回答

  • Voted
  1. Best Answer
    Jacob Evans
    2015-10-14T07:45:24+08:002015-10-14T07:45:24+08:00

    哈希用于文字(精确匹配),您想使用正则表达式或 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

    • 9

相关问题

  • Postfix 在特定端口上接受邮件

  • 让 Postfix 以两种方式处理垃圾邮件

  • Postfix 或 exim:自动/程序化和转发电子邮件设置

  • 后缀电子邮件地址

  • 什么是最好的开源电子邮件解决方案包

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve