Postfix:在接收到初始服务器问候语时与* somehost *失去连接

我早些时候(几个月前)在CentOS上安装了Postfix,它工作正常。 由于许多蛮力企图的事实,考虑到我几乎没有使用它,所以我closures了Postfix。 现在我需要使用它,当我开始testing它时:它可以收到电子邮件罚款,但不发送。 我试图发送电子邮件到雅虎,谷歌,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) 

也有这样的线路:

 postfix/smtp[31728]: C792711A82EB: conversation with gmail-smtp-in.l.google.com[74.125.39.27] timed out while performing the EHLO handshake 

我可以发送电子邮件的唯一地方是mail.md

我重新安装了Postfix,但没有任何改变。 试图禁用防火墙没有任何运气。 我的IP没有被列出/被阻止。 这个configuration几乎是默认的,只是在http://wiki.centos.org/HowTos/postfix上描述的更早的工作。

在mxtoolbox.com上检查SMTP服务器。 结果是:

 220 host-static-xxxx.moldtelecom.md ESMTP Postfix OK - xxxx resolves to host-static-xxxx.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-xxxx.moldtelecom.md [172 ms] MAIL FROM: <[email protected]> 250 2.1.0 Ok [172 ms] RCPT TO: <[email protected]> 554 5.7.1 <[email protected]>: Relay access denied [172 ms] QUIT 221 2.0.0 Bye [172 ms] 

有一件奇怪的事情(或者不是?)。 当我telnet到我的smtp服务器,并尝试HELO命令,我第一次发生错误。 但它第二次回应:

 220 host-static-xxxx.moldtelecom.md ESMTP Postfix HELO somedomain.com 502 5.5.2 Error: command not recognized HELO somedomain.com 250 host-static-xxxx.moldtelecom.md 

有人有什么想法可能是错的?

UPDATE

我增加了debugging级别。 这里是一些日志:

 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-xxxx.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****[email protected] postfix/smtp[3438]: send attr recipient = ib****[email protected] postfix/smtp[3438]: send attr offset = 448 postfix/smtp[3438]: send attr dsn_orig_rcpt = rfc822;ib****[email protected] 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****[email protected]>, 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 

更新2

看来,Postfix可以发送消息到我国内的所有服务器,但不能到我国以外的服务器。 外部和内部唯一的差别(由mailq发现)是到外部服务器的traceroute是通过10.1.74.xx而不是内部的。 我联系了我的ISP,他们说他们不会阻塞/过滤任何东西,他们唯一build议的是我需要一个PTRlogging(这不是问题)。

路由跟踪:

 [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 

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 

您的SMTP守护程序没有问题,但与您的SMTP客户端无关。 当您连接到您的服务器,但连接到其他服务器时,这不是一个问题。

所以尝试telnet 74.125.39.27 25 ,看看你有多远。 正如其他人可以连接到谷歌或任何它必须是你的networking的东西。 你有防火墙阻止端口25上的传出SMTP吗? 您的提供商是否阻止端口25?

Postfix尝试连接到其他服务器,无法build立连接。 无论是你的方阻止连接,或者另一方面,目标服务器拒绝连接。 但正如我所说,这是不是Postfix相关,但networking相关。

编辑:我不会责怪任何人。 但是在短暂的远程会话之后,可以看到有人阻止SMTPstream量到.md之外的主机。 这不是防火墙! 进一步的诊断不能从服务器本身进行。

这听起来与networking有关(不是与postfix相关的),并且确定有人(或某事)阻止了除“可信主机”以外的所有端口的25端口stream量。 您需要:A)对mail.google.com进行traceroute,并确定哪些networking通过(可能不是您的ISP,但您的ISP的ISP?)或B)smarthost所有邮件到您的ISP的邮件服务器。

你尝试过tcptraceroute吗?

你可以分享跟踪路由到'工作'邮件服务器与'非工作'的邮件服务器?