我早些时候(几个月前)在 CentOS 上安装了 Postfix,它运行良好。由于进行了多次蛮力尝试,并考虑到我几乎根本没有使用它,因此我关闭了 Postfix。现在我需要使用它,当我开始并测试它时:它可以正常接收电子邮件,但不能发送。我尝试向 yahoo、google、hotmail、mail.ru、yandex.ru 发送电子邮件,结果是一样的:
postfix/smtp[30799]: 3EA0C11A82FD: to=<i********@gmail.com>, relay=alt4.gmail-smtp-in.l.google.com[74.125.93.27]:25, delay=0.56, delays=0.02/0.01/0.53/0, dsn=4.4.2, status=deferred (lost connection with alt4.gmail-smtp-in.l.google.com[74.125.93.27] while receiving the initial server greeting)
Run Code Online (Sandbox Code Playgroud)
还有这样的行:
postfix/smtp[31728]: C792711A82EB: conversation with gmail-smtp-in.l.google.com[74.125.39.27] timed out while performing the EHLO handshake
Run Code Online (Sandbox Code Playgroud)
我可以发送电子邮件的唯一地方是 mail.md
我重新安装了 Postfix,但没有任何改变。试图在没有任何运气的情况下禁用防火墙。我的 IP 未列出/阻止。配置几乎是默认的,只是在http://wiki.centos.org/HowTos/postfix中描述的更改之前起作用。
在 mxtoolbox.com 上检查了 SMTP 服务器。结果是:
220 host-static-x-x-x-x.moldtelecom.md ESMTP Postfix
OK - x-x-x-x resolves to host-static-x-x-x-x.moldtelecom.md
OK - Reverse DNS matches SMTP Banner
0 seconds - Good on Connection time
Not an open relay.
1.139 seconds - Good on Transaction time
Session Transcript:
HELO please-read-policy.mxtoolbox.com
250 host-static-x-x-x-x.moldtelecom.md [172 ms]
MAIL FROM: <supertool@mxtoolbox.com>
250 2.1.0 Ok [172 ms]
RCPT TO: <test@example.com>
554 5.7.1 <test@example.com>: Relay access denied [172 ms]
QUIT
221 2.0.0 Bye [172 ms]
Run Code Online (Sandbox Code Playgroud)
有一件奇怪的事情(也许不是?)。当我 telnet 到我的 smtp 服务器并尝试 HELO 命令时,我第一次产生错误。但它第二次响应正常:
220 host-static-x-x-x-x.moldtelecom.md ESMTP Postfix
HELO somedomain.com
502 5.5.2 Error: command not recognized
HELO somedomain.com
250 host-static-x-x-x-x.moldtelecom.md
Run Code Online (Sandbox Code Playgroud)
有没有人知道可能有什么问题?
更新
我已经提高了调试级别。以下是一些日志:
postfix/master[3433]: daemon started -- version 2.3.3, configuration /etc/postfix
postfix/qmgr[3436]: AF95C11A82ED: from=<a****n@i***d.com>, size=597, nrcpt=1 (queue active)
postfix/qmgr[3436]: 89DE011A82EB: from=<a****n@i***d.com>, size=597, nrcpt=1 (queue active)
postfix/smtp[3439]: vstream_buf_get_ready: fd 11 got 45
postfix/smtp[3439]: < gmail-smtp-in.l.google.com[74.125.39.27]: 220 mx.google.com ESMTP a13si2222396fak.134
postfix/smtp[3439]: > gmail-smtp-in.l.google.com[74.125.39.27]: EHLO host-static-x-x-x-x.moldtelecom.md
postfix/smtp[3439]: vstream_fflush_some: fd 11 flush 49
postfix/smtp[3438]: smtp_get: EOF
postfix/smtp[3438]: AF95C11A82ED: lost connection with d.mx.mail.yahoo.com[209.191.88.254] while receiving the initial server greeting
postfix/smtp[3438]: smtp_get: EOF
postfix/smtp[3438]: AF95C11A82ED: lost connection with e.mx.mail.yahoo.com[67.195.168.230] while receiving the initial server greeting
postfix/smtp[3438]: smtp_get: EOF
postfix/smtp[3438]: AF95C11A82ED: lost connection with b.mx.mail.yahoo.com[74.6.136.65] while receiving the initial server greeting
postfix/smtp[3438]: smtp_get: EOF
postfix/smtp[3438]: AF95C11A82ED: lost connection with g.mx.mail.yahoo.com[98.137.54.238] while receiving the initial server greeting
postfix/smtp[3438]: smtp_get: EOF
postfix/smtp[3438]: connect to subsystem private/defer
postfix/smtp[3438]: send attr nrequest = 0
postfix/smtp[3438]: send attr flags = 0
postfix/smtp[3438]: send attr queue_id = AF95C11A82ED
postfix/smtp[3438]: send attr original_recipient = ib****ri@yahoo.com
postfix/smtp[3438]: send attr recipient = ib****ri@yahoo.com
postfix/smtp[3438]: send attr offset = 448
postfix/smtp[3438]: send attr dsn_orig_rcpt = rfc822;ib****ri@yahoo.com
postfix/smtp[3438]: send attr notify_flags = 0
postfix/smtp[3438]: send attr status = 4.4.2
postfix/smtp[3438]: send attr diag_type =
postfix/smtp[3438]: send attr diag_text =
postfix/smtp[3438]: send attr mta_type =
postfix/smtp[3438]: send attr mta_mname =
postfix/smtp[3438]: send attr action = delayed
postfix/smtp[3438]: send attr reason = lost connection with a.mx.mail.yahoo.com[67.195.168.31] while receiving the initial server greeting
postfix/smtp[3438]: private/defer socket: wanted attribute: status
postfix/smtp[3438]: vstream_fflush_some: fd 12 flush 353
postfix/smtp[3438]: vstream_buf_get_ready: fd 12 got 10
postfix/smtp[3438]: input attribute name: status
postfix/smtp[3438]: input attribute value: 0
postfix/smtp[3438]: private/defer socket: wanted attribute: (list terminator)
postfix/smtp[3438]: input attribute name: (end)
postfix/smtp[3438]: AF95C11A82ED: to=<ib****ri@yahoo.com>, relay=a.mx.mail.yahoo.com[67.195.168.31]:25, delay=214, delays=213/0.03/0.77/0, dsn=4.4.2, status=deferred (lost connection with a.mx.mail.yahoo.com[67.195.168.31] while receiving the initial server greeting)
postfix/smtp[3438]: flush_add: site yahoo.com id AF95C11A82ED
postfix/smtp[3438]: match_list_match: yahoo.com: no match
postfix/smtp[3438]: flush_add: site yahoo.com id AF95C11A82ED status 4
Run Code Online (Sandbox Code Playgroud)
更新 2
Postfix好像可以发消息到国内所有的服务器,但是发不了到国外的服务器。外部和内部服务器之间的唯一区别(由 mailq 发现)是到外部服务器的 traceroute 是通过 10.1.74.xx 而不是内部服务器。我联系了我的 ISP,他们说他们不会阻止/过滤任何东西,他们唯一建议的是我需要 PTR 记录(这不是问题)。
跟踪路由:
[root@in-md ~]# traceroute mail.google.com
traceroute to mail.google.com (74.125.39.19), 30 hops max, 40 byte packets
1 host-static-109-185-171-1.moldtelecom.md (109.185.171.1) 0.334 ms 0.330 ms 0.264 ms
2 46.74.1.10.in-addr.arpa (10.1.74.46) 0.792 ms 0.795 ms 0.733 ms
3 host-static-86-106-213-29.moldtelecom.md (86.106.213.29) 1.005 ms 0.875 ms 0.928 ms
4 host-static-86-106-213-30.moldtelecom.md (86.106.213.30) 0.829 ms 0.807 ms 0.811 ms
5 host-static-212-0-199-5.moldtelecom.md (212.0.199.5) 3.959 ms 3.935 ms 3.896 ms
6 host-static-212-0-200-146.moldtelecom.md (212.0.200.146) 2.116 ms 2.133 ms 2.145 ms
7 core1.ams.net.google.com (195.69.144.247) 46.458 ms 46.559 ms 46.499 ms
8 209.85.248.88 (209.85.248.88) 47.109 ms 209.85.248.93 (209.85.248.93) 47.279 ms 209.85.248.88 (209.85.248.88) 47.119 ms
9 209.85.250.141 (209.85.250.141) 54.194 ms 209.85.248.183 (209.85.248.183) 53.980 ms 54.124 ms
10 209.85.254.118 (209.85.254.118) 53.251 ms 53.448 ms 53.849 ms
11 209.85.249.162 (209.85.249.162) 53.631 ms * *
12 fx-in-f19.1e100.net (74.125.39.19) 53.941 ms 54.141 ms 53.749 ms
[root@in-md ~]# traceroute mail.md
traceroute to mail.md (178.17.163.132), 30 hops max, 40 byte packets
1 host-static-109-185-171-1.moldtelecom.md (109.185.171.1) 0.302 ms 0.319 ms 0.243 ms
2 host-static-212-0-192-114.moldtelecom.md (212.0.192.114) 0.986 ms 0.983 ms 0.938 ms
3 host-static-212-0-192-113.moldtelecom.md (212.0.192.113) 1.499 ms 1.366 ms 1.294 ms
4 in-orange.ch.md.trabia.net (195.22.253.10) 1.113 ms 1.080 ms 1.112 ms
5 mx3.mail.md (178.17.163.132) 1.115 ms 1.084 ms 1.043 ms
Run Code Online (Sandbox Code Playgroud)
tcptraceroute:
[root@in-md ~]# tcptraceroute mail.google.com
traceroute to mail.google.com (74.125.39.17), 30 hops max, 40 byte packets
1 host-static-109-185-171-1.moldtelecom.md (109.185.171.1) 0.292 ms 0.267 ms 0.252 ms
2 46.74.1.10.in-addr.arpa (10.1.74.46) 0.812 ms 0.735 ms 0.727 ms
3 host-static-86-106-213-29.moldtelecom.md (86.106.213.29) 0.949 ms 0.861 ms 0.906 ms
4 host-static-86-106-213-30.moldtelecom.md (86.106.213.30) 0.810 ms 0.783 ms 0.828 ms
5 host-static-212-0-199-9.moldtelecom.md (212.0.199.9) 3.766 ms 3.451 ms 3.306 ms
6 host-static-212-0-200-146.moldtelecom.md (212.0.200.146) 2.404 ms 2.243 ms 2.057 ms
7 * * *
8 209.85.248.93 (209.85.248.93) 47.100 ms 46.942 ms 46.986 ms
9 209.85.250.141 (209.85.250.141) 54.503 ms 209.85.248.183 (209.85.248.183) 55.067 ms 54.148 ms
10 209.85.254.114 (209.85.254.114) 53.423 ms 209.85.254.116 (209.85.254.116) 54.150 ms 209.85.254.118 (209.85.254.118) 53.800 ms
11 209.85.254.134 (209.85.254.134) 3060.001 ms * 209.85.254.134 (209.85.254.134) 53.877 ms
12 * * *
13 * * *
14 * * *
15 * * *
16 fx-in-f17.1e100.net (74.125.39.17) 54.176 ms 54.156 ms 54.656 ms
[root@in-md ~]# tcptraceroute mail.md
traceroute to mail.md (178.17.163.132), 30 hops max, 40 byte packets
1 host-static-109-185-171-1.moldtelecom.md (109.185.171.1) 0.371 ms 0.302 ms 0.231 ms
2 host-static-212-0-192-114.moldtelecom.md (212.0.192.114) 0.998 ms 1.011 ms 0.968 ms
3 host-static-212-0-192-113.moldtelecom.md (212.0.192.113) 1.456 ms 1.184 ms 0.977 ms
4 in-orange.ch.md.trabia.net (195.22.253.10) 1.167 ms 1.143 ms 1.391 ms
5 mx3.mail.md (178.17.163.132) 1.908 ms 2.439 ms 2.252 ms
Run Code Online (Sandbox Code Playgroud)
您的 SMTP 守护程序没有问题,但您的 SMTP 客户端有问题。当您连接到您的服务器时,这不是问题,但当您连接到其他服务器时,这不是问题。
所以试着telnet 74.125.39.27 25看看你走了多远。由于其他人可以连接到 Google 或其他任何东西,因此它必须与您的网络有关。您是否有防火墙阻止端口 25 上的传出 SMTP?您的提供商是否阻止端口 25?
Postfix 尝试连接到其他服务器,但无法建立连接。如果您一方阻止连接,或者目标服务器拒绝连接。但正如我所说,它与 Postfix 无关,而是与网络相关。
编辑: 我不会责怪任何人。但经过短暂的远程会话后,我们可以看到有人阻止了到 .md 之外的主机的 SMTP 流量。而且它不是防火墙!即使从服务器本身也无法进行进一步的诊断。
| 归档时间: |
|
| 查看次数: |
54018 次 |
| 最近记录: |