Linux – Cannot receive greeting message from remote mail server

emailemail-serverlinuxpostfixUbuntu

I am trying to setup a mail server (postfix & dovecot) on Ubuntu. However, I cannot send/receive email, and get a similar error like posted in Postfix: lost connection with *somehost* while receiving the initial server greeting. My error message looks like:

Jan  5 03:46:49 oakwise-12752 postfix/smtp[22531]: 48079C08F4: conversation with gmail-smtp-in.l.google.com[74.125.25.27] timed out while receiving the initial server greeting

When I try to telnet to the google mail server, I can connect to the host, but don't get greeting message (220). Like this:

$ telnet gmail-smtp-in.l.google.com 25
Trying 74.125.25.27...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.

When I try to telnet to my own mail server, I can get the greeting message successfully.

$ telnet localhost 25
Trying 127.0.0.1...
Connected to myhost.mydomain.com
Escape character is '^]'.
220 myhost.mydomain.com ESMTP Postfix (Ubuntu)

Do you know if there is any problem with my hosts configuration? Please tell me if you need any further information.

UPDATE

Here is some result for tcpdump while telnet gmail-smtp-in.l.google.com 25 .

tcpdump host 74.125.25.26
09:20:39.856647 IP myhost.mydomain.com.53742 > fa-in-f26.1e100.net.smtp: Flags [S], seq 2040695833, win 14600, options [mss 1460,sackOK,TS val 274530380 ecr 0,nop,wscale 7], length 0
09:20:40.013693 IP fa-in-f26.1e100.net.smtp > myhost.mydomain.com.53742: Flags [S.], seq 1029741075, ack 2040695834, win 14180, options [mss 1430,sackOK,TS val 128311508 ecr 274530380,nop,wscale 6], length 0
09:20:40.013747 IP myhost.mydomain.com.53742 > fa-in-f26.1e100.net.smtp: Flags [.], ack 1, win 115, options [nop,nop,TS val 274530420 ecr 128311508], length 0
09:20:51.837739 IP myhost.mydomain.com.53727 > fa-in-f26.1e100.net.smtp: Flags [P.], seq 1931780617:1931780622, ack 3676242651, win 115, options [nop,nop,TS val 274533376 ecr 3949456046], length 5
09:22:52.157741 IP myhost.mydomain.com.53727 > fa-in-f26.1e100.net.smtp: Flags [P.], seq 0:5, ack 1, win 115, options [nop,nop,TS val 274563456 ecr 3949456046], length 5
09:24:52.477713 IP myhost.mydomain.com.53727 > fa-in-f26.1e100.net.smtp: Flags [P.], seq 0:5, ack 1, win 115, options [nop,nop,TS val 274593536 ecr 3949456046], length 5
09:26:52.797732 IP myhost.mydomain.com.53727 > fa-in-f26.1e100.net.smtp: Flags [P.], seq 0:5, ack 1, win 115, options [nop,nop,TS val 274623616 ecr 3949456046], length 5
09:28:53.117719 IP myhost.mydomain.com.53727 > fa-in-f26.1e100.net.smtp: Flags [P.], seq 0:5, ack 1, win 115, options [nop,nop,TS val 274653696 ecr 3949456046], length 5
09:30:53.437729 IP myhost.mydomain.com.53727 > fa-in-f26.1e100.net.smtp: Flags [P.], seq 0:5, ack 1, win 115, options [nop,nop,TS val 274683776 ecr 3949456046], length 5

UPDATE 2

Google tells me that logs of ISP will block port 25 to prevent email spam. I am using a virtual host provided by my company cloud. Is this possible that port 25 is blocked by company's firewall or ISP? How can I figure out if it is blocked?

Best Answer

I agree that it is likely to be anti-spam techniques used by google :

Here's the telnet output from another IP :


> telnet gmail-smtp-in.l.google.com 25
Trying 173.194.70.26...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP j49si145368071eep.45
quit
221 2.0.0 closing connection j49si145368071eep.45
Connection closed by foreign host.

And the same telnet for the ip you mention :


> telnet 74.125.39.27 25
Trying 74.125.39.27...
telnet: connect to address 74.125.39.27: Operation timed out
telnet: Unable to connect to remote host