延期:连接超时

延期:连接超时

我正在 Debian 机器上安装 Sendmail。我现在已经尝试了两次,每次都收到连接延迟错误。我运行了以下过程:

apt-get purge sendmail*
apt update
apt install sendmail sendmail-cf m4
sendmailconfig (I answered Y to all)
sendmail -vt < ~/mail.txt (FAILED)
nano /etc/mail/local-host-names (added web1 and web1.mydomain.com)
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart
sendmail -vt < ~/mail.txt

hostnamectl 的内容:

root@web1:~# hostnamectl
   Static hostname: web1.mydomain.com
     Icon name: computer-vm
       Chassis: vm
    Machine ID: bf9dd17320f042e1b8715468578181b6
       Boot ID: 8981063e23dd4c07905ea630f2ab0a75
    Virtualization: kvm
  Operating System: Debian GNU/Linux 10 (buster)
        Kernel: Linux 4.19.0-9-amd64
      Architecture: x86-64

/etc/hosts 的内容

127.0.0.1       localhost web1.mydomain.com
213.168.250.175 web1

Sendmail 接受了我的邮件并发送成功,但始终无法完成。通常,此问题可能是 telnet 端口 25 出现错误,但我已经对此进行了测试,并且成功了。

这是我运行 sendmail 命令的结果:

root@web1:~# sendmail -vt < ~/mail.txt
[email protected]... Connecting to [127.0.0.1] via relay...
220 web1.mydomain.com ESMTP Sendmail 8.15.2/8.15.2/Debian-14~deb10u1; Wed, 1 Jul 2020 18:08:16 +0100; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
>>> EHLO web1.mydomain.com
250-web1.mydomain.com Hello 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 DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<[email protected]> SIZE=156 [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 reception.mail-tester.com. via esmtp...
050 <[email protected]>... Deferred: Connection timed out with reception.mail-tester.com.
250 2.0.0 061H8GYO004063 Message accepted for delivery
[email protected]... Sent (061H8GYO004063 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 web1.mydomain.com closing connection
root@web1:~# sendmail -vt < ~/mail.txt -i -t
[email protected]... Connecting to [127.0.0.1] via relay...
220 web1.mydomain.com ESMTP Sendmail 8.15.2/8.15.2/Debian-14~deb10u1; Wed, 1 Jul 2020 18:09:32 +0100; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
>>> EHLO web1.mydomain.com
250-web1.mydomain.com Hello 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 DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<[email protected]> SIZE=156 [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 reception.mail-tester.com. via esmtp...
050 <[email protected]>... Deferred: Connection timed out with reception.mail-tester.com.
250 2.0.0 061H9Wwn004147 Message accepted for delivery
[email protected]... Sent (061H9Wwn004147 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 web1.mydomain.com closing connection

为什么我的连接会被延迟?我只是不明白还有什么原因导致了这个问题。

经过额外调试的结果:

root@web1:~# sendmail -vt < ~/mail.txt -i -t -d8.20 -d60.5 -Am -i
_res.options = 52c3, HasWildcardMX = 0
map_lookup(dequote, mydomain, %0=mydomain) => NOT FOUND (0)
map_lookup(host, srv1.mail-tester.com, %0=srv1.mail-tester.com) => dns_getcanonname(srv1.mail-tester.com, trymx=1)
dns_getcanonname: trying srv1.mail-tester.com. (AAAA)
    NO: errno=0, h_errno=4
dns_getcanonname: trying srv1.mail-tester.com. (A)
    NO: errno=0, h_errno=4
dns_getcanonname: trying srv1.mail-tester.com. (MX)
    YES
dns_getcanonname: srv1.mail-tester.com
srv1.mail-tester.com. (0)
getmxrr(srv1.mail-tester.com., droplocalhost=1)
[email protected]... Connecting to reception.mail-tester.com. via esmtp...
[email protected]... Deferred: Connection timed out with reception.mail-tester.com.

相关内容