Postfix SMTP 服务器无法向域外的任何人发送消息

Postfix SMTP 服务器无法向域外的任何人发送消息

这是最近对我的 SMTP 服务器进行的测试的结果,我只想让这台服务器发送电子邮件,而大约一周前,这台服务器还运行正常

Resolving hostname...
Connecting...
SMTP -> FROM SERVER:
220 mail.testinstall.com ESMTP Postfix
SMTP -> FROM SERVER: 
250-mail.testinstall.com
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: [email protected]
SMTP -> FROM SERVER:
250 2.1.0 Ok
RCPT TO: [email protected]
SMTP -> FROM SERVER:
454 4.7.1 : Relay access denied
SMTP -> ERROR: RCPT not accepted from server: 454 4.7.1 : Relay access denied

Message sending failed.

服务器详细信息

CentOS     : 6.4
PostFix mail_version = 2.6.6
zpanel is the control panel software used

postfile 的 main.cf 文件已复制到http://pastebin.com/jqJMv1TM

任何域上的服务器的邮件都无法正常工作,因此我确信这不是特定于域的问题,而是与服务器有关。我还尝试了公共测试,使用 php 发送电子邮件,也使用 zpanel 附带的 webmail,但所有测试都无法发送域外的邮件。

我尝试在类似这样的帖子中找到多种解决方案(Postfix:从网络外部发送邮件时中继访问被拒绝),其中大多数与外部软件中的其他配置有关。我们只在此服务器上安装了 apache、zpanel、php、mysql(mysql Ver 14.14 Distrib 5.1.69,用于 redhat-linux-gnu (x86_64) 使用 readline 5.1)和 postfix,据我所知,没有其他软件会影响此行为。我们最近更改了域名(主域名),这个问题似乎从那时起就一直存在。

Maillog 没有报告任何与此问题相关的重要内容,并报告了以下内容,但内容一直以惊人的速度增长,我认为这是一个单独的问题

Sep 22 18:19:12 IS-21075 postfix/qmgr[23793]: 5F4943226F9: from=<>, size=3539, nrcpt=1 (queue active)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 5F4943226F9: to=<[email protected]>, relay=none, delay=263738, delays=263738/0.05/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for testinstall.com loops back to myself)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 52B9733CC4F: from=<[email protected]>, size=843, nrcpt=1 (queue active)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 52B9733CC4F: to=<[email protected]>, relay=none, delay=397370, delays=397370/0.12/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for testinstall.com loops back to myself)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 5C66E8B0FE0: from=<[email protected]>, size=844, nrcpt=1 (queue active)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 5C66E8B0FE0: to=<[email protected]>, relay=none, delay=57108, delays=57108/0.03/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for testinstall.com loops back to myself)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 536E87C1B6E: from=<>, size=2903, nrcpt=1 (queue active)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 536E87C1B6E: to=<[email protected]>, relay=none, delay=63290, delays=63290/0.03/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for testinstall.com loops back to myself)
  • 注意 - 虽然 mydomainname.com 已更改,但 testinstall.com 是我们使用的实际域名。

我已经将 main.cf 完全清空,但错误仍然存​​在,但错误代码不同

Resolving hostname...
Connecting...
SMTP -> FROM SERVER:
220 IS-21075.localdomain ESMTP Postfix
SMTP -> FROM SERVER: 
250-IS-21075.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: [email protected]
SMTP -> FROM SERVER:
250 2.1.0 Ok
RCPT TO: [email protected]
SMTP -> FROM SERVER:
554 5.7.1 : Relay access denied
SMTP -> ERROR: RCPT not accepted from server: 554 5.7.1 : Relay access denied

消息发送失败。

答案1

您的mynetworks指令无效。此设置控制 Postfix 允许从哪些 IP 地址范围进行中继。它应该仅由您的内部服务器和网络组成。

内容如下:

mynetworks = all,localhost

这显然不是IP 地址或 CIDR 范围列表

将其更改为反映应允许通过此 Postfix 中继的服务器/网络的实际地址。例如:

mynetworks = 127.0.0.1 [::1] 10.118.87.0/24

相关内容