Centos – Cannot telnet to port 25

centostelnet

When I try to telnet to port 25 using this command:

telnet aspmx.l.google.com 25

I get this message

Trying 173.194.69.26...

And nothing more happens. I disabled csf but the problem still exsists. I also asked my VPS co. whether they have blocked port 25 and they said they have not blocked any port.

In postfix logs:

server2 postfix/smtp[30847]: connect to alt2.gmail-smtp-in.l.google.com[173.194.64.27]:25: Connection timed out

Is it possible that google has blocked my server ip address?

Edit:

Tried yahoo (telnet smtp.mail.yahoo.com 25) and it has the same result. I also disabled iptables(service iptables stop) but problem still exists.

Best Answer

There are two obvious possibilities here.

  1. Your hosting provider or their upstream networks or your government have blocked outbound traffic to port 25.

  2. Google and Yahoo have blocked incoming connections from your network.

I see that you are located in Iran. Due to US law, companies in the US are prohibited from doing business with Iran, and sometimes this gets enforced rather aggressively (for instance, simply downloading free software from a web site might be blocked). If your VPS is also in Iran, this might be the cause of the issue.

To find out whether this is an issue, try connecting to a mail server in a country which is more friendly to Iran, such as Russia:

telnet mxs.mail.ru 25

If this is successful, then you are affected by the US embargo. If this also fails, then you are being blocked by the hosting provider or their providers.

In both cases, I recommend you purchase VPS services outside the country, if the service you wish to run can be provided from a server outside the country.

Finally there's a third possibility: Your VPS server's IP address may have been blacklisted due to previous abuse seen from its address. In this case you will have to figure out where it was blacklisted and have it removed from those lists. This could be difficult.