MTA-sendmail stat=Deferred:XXXX 拒绝连接

MTA-sendmail stat=Deferred:XXXX 拒绝连接

时髦大猩猩

本地 sendmail 无法传递本地邮件。本地主机没有响应,还需要检查什么?

echo "Subject: sendmail test" | sendmail -v root
root... Connecting to [127.0.0.1] via relay...
220 zika.gattaca.net ESMTP Sendmail 8.15.2/8.15.2/Debian-20; Mon, 12 Apr 2021 10:02:30 -0400; (No UCE/UBE) logging access from: ip6-localhost(OK)-ip6-localhost [127.0.0.1]
>>> EHLO zika.gattaca.net
250-zika.gattaca.net Hello ip6-localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<[email protected]> SIZE=23 [email protected]
250 2.1.0 <[email protected]>... Sender ok
>>> RCPT To:<[email protected]>
>>> DATA
250 2.1.5 <[email protected]>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <[email protected]>... Connecting to 192.168.1.4. via esmtp...
050 <[email protected]>... Deferred: Connection refused by 192.168.1.4.
250 2.0.0 13CE2UWq079303 Message accepted for delivery
root... Sent (13CE2UWq079303 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 zika.gattaca.net closing connection

在 /etc/hosts 中:

127.0.0.1       localhost.localdomain   localhost
127.0.1.1       localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

 192.168.1.4    zika.gattaca.net        zika

/etc/mail/sendmail.mc:

dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl

听:

tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      32911/sendmail: MTA 
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN      32911/sendmail: MTA 

防火墙已禁用,但允许 25/TCP 和 587/TCP 流量

谢谢!

答案1

您的本地 (127.0.0.1) 已接受电子邮件。
无法将其中继/转发至 192.168.1.4:25。
详细信息:sendmail -v 使 sendmail 在 SMTP 会话中使用 VERB 命令。接受后,它使 sendmail 跟踪也跟踪“下一跳”SMTP 会话

最有可能的

  • 您的 sendmail 配置为使用 192.168.1.4:25 作为本地电子邮件的中继,请参阅 /etc/mail/sendmail.cf 中以(MAIL_HUB) 或(LOCAL_RELAY)
    开头的行DHDR
  • 识别“此主机电子邮件名称”时出现问题

相关内容