Eu tinha o Postfix instalado no CentOS anteriormente (alguns meses atrás) e estava funcionando bem. Devido ao fato de muitas tentativas de força bruta e considerando que eu não usei quase isso, eu encerrei o Postfix.
Agora eu precisava usá-lo, e quando eu comecei e testei: ele pode receber e-mails bem, mas não enviar. Tentei enviar e-mails para o yahoo, google, hotmail, mail.ru, yandex.ru e o resultado foi o mesmo:
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)
Também existem linhas como esta:
postfix/smtp[31728]: C792711A82EB: conversation with gmail-smtp-in.l.google.com[74.125.39.27] timed out while performing the EHLO handshake
O único lugar em que posso enviar e-mails é mail.md
Eu reinstalei o Postfix, mas nada mudou.
Tentei desativar o firewall sem qualquer sorte.
Meu IP não está listado / bloqueado.
A configuração é quase padrão, apenas as mudanças descritas no link que funcionou anteriormente.
Verificou o servidor SMTP em mxtoolbox.com. O resultado é:
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: <[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]
Existe uma coisa estranha (ou talvez não?). Quando eu telnet para o meu servidor smtp e tente o comando HELO eu gen um erro pela primeira vez. Mas responde ok pela segunda vez:
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
Alguém tem alguma idéia do que poderia estar errado?
UPDATE
Eu aumentei o nível de depuração. Aqui estão alguns registros:
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****[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
UPDATE 2
Parece que o Postfix pode enviar mensagens para todos os servidores dentro do meu país, mas não para os servidores fora do meu país. A única diferença (encontrada pelo mailq) entre o exterior e o interior é que o traceroute para servidores externos está passando por 10.1.74.xx mas para dentro não. Entrei em contato com meu provedor e eles dizem que não bloqueiam / filtram nada, e a única coisa que sugeriram é que eu preciso de um registro PTR (que não pode ser o problema).
traceroute:
[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