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 / 问题 / 981289
Accepted
Marco
Marco
Asked: 2019-08-31 02:32:29 +0800 CST2019-08-31 02:32:29 +0800 CST 2019-08-31 02:32:29 +0800 CST

Postfix 拒绝来自一些 4.7.25 的(好)服务器的传入邮件,但它们具有正确的反向 DNS

  • 772

设想:

这是一个 4 年以来的生产邮件服务器,在大约 50 个域上有大约 2000 个邮箱,并且几乎可以与任何其他邮件服务器配合使用。日志不断受到关注,最近出现了以下问题。

编辑 1:Ubutntu 16.04.6 - 后缀(3.1.0-3ubuntu0.3)

问题:

有一个邮件服务器似乎无法将邮件传递到该系统。

它失败,4.7.25 客户端主机被拒绝。

NOQUEUE: reject: RCPT from unknown[159.135.224.3]: 450 4.7.25 Client host rejected: cannot find your hostname, [159.135.224.3]

这就是我配置后缀的方式,因为我想避免没有反向 dns 记录的中继器。

root@mail:~# grep restrictions /etc/postfix/main.cf
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client zen.spamhaus.org, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf, check_policy_service unix:private/policy-spf
smtpd_helo_restrictions = permit_sasl_authenticated, permit_mynetworks, check_helo_access regexp:/etc/postfix/helo_access, reject_invalid_hostname, reject_non_fqdn_hostname, reject_invalid_helo_hostname, reject_unknown_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo
smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/tag_as_originating.re , permit_mynetworks, permit_sasl_authenticated, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, check_sender_access regexp:/etc/postfix/tag_as_foreign.re, reject_unknown_sender_domain, reject_unknown_reverse_client_hostname, check_client_access hash:/etc/postfix/client_access, reject_unknown_client_hostname
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf

但它有一个有效的,在邮件服务器上本地执行的测试:

159.135.224.3 上的 DNS 测试

root@mail:~# nslookup 159.135.224.3
Server:         1.1.1.1
Address:        1.1.1.1#53

Non-authoritative answer:
3.224.135.159.in-addr.arpa      name = relay.teamgioia.it.

Authoritative answers can be found from:

root@mail:~# dig 159.135.224.3

; <<>> DiG 9.10.3-P4-Ubuntu <<>> 159.135.224.3
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 23656
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;159.135.224.3.                 IN      A

;; AUTHORITY SECTION:
.                       10165   IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2019083000 1800 900 604800 86400

;; Query time: 6 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Fri Aug 30 12:18:21 CEST 2019
;; MSG SIZE  rcvd: 117

在 resolv.conf 中:

nameserver 1.1.1.1
nameserver 1.0.0.1

问题:

为什么没有reject_unknown_client_hostname按我的预期工作?

如果这不是这台服务器的错,而是发件人的错,我怎样才能将一些发件人列入白名单以避免他们的邮件被拒绝?

你能否解释或推测他们的错是什么?

linux
  • 1 1 个回答
  • 1116 Views

1 个回答

  • Voted
  1. Best Answer
    Gerald Schneider
    2019-08-31T04:48:23+08:002019-08-31T04:48:23+08:00

    IP 地址与域查找不匹配。

    从文档中引用:

    reject_unknown_client_hostname
    在以下情况拒绝请求:1)客户端IP地址->名称映射失败,或2)名称->地址映射失败,或3)名称->地址映射与客户端IP地址不匹配。

    如果您查找客户端 IP 地址,则再次查找解析的 DNS 名称并进行比较:

    $ nslookup 159.135.224.3
    3.224.135.159.in-addr.arpa      name = relay.teamgioia.it.
    $ nslookup relay.teamgioia.it.
    Non-authoritative answer:
    relay.teamgioia.it      canonical name = mailgun.org.
    Name:   mailgun.org
    Address: 52.2.180.207
    Name:   mailgun.org
    Address: 52.4.250.90
    

    您会看到,原始 IP 地址与 DNS 解析地址不匹配。这就是它无法通过检查的原因。

    • 1

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

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