Can't connect to SMTP server

I have trouble connecting to an SMTP server from my PC. I use Debian sid.

telnet mail.example.com 25
Trying 12.23.34.45...
telnet: Unable to connect to remote host: Connection timed out

While from another Debian PC from outside my network:

telnet mail.example.com 25
Trying 12.23.34.45...
Connected to mail.example.com.
Escape character is '^]'.
220 mail.example.com ESMTP Exim 4.63 Mon, 02 Apr 2012 22:14:09 +0200

ping hangs forever as well, and when I hit Ctrl+C it says "100% packet loss". Finally, traceroute is full of asterisks:

traceroute mail.example.com
traceroute to mail.example.com (12.23.34.45), 30 hops max, 60 byte packets
1  * * *
2  * * *
3  * * *
...
27  * * *
28  * * *
29  * * *
30  * * *

When I run nmap against the server port 25:

nmap mail.example.com -p25

Starting Nmap 5.21 ( http://nmap.org ) at 2012-04-02 23:08 EEST
Nmap scan report for mail.example.com (12.23.34.45)
Host is up (0.090s latency).
PORT   STATE    SERVICE
25/tcp filtered smtp

Nmap done: 1 IP address (1 host up) scanned in 0.88 seconds

And finally my iptables:

iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

Any ideas? Thanks a lot for any help.


Solution 1:

For a sanity check, I'd run a couple quick port checking services like:

  • http://www.mxtoolbox.com/diagnostic.aspx
  • http://www.yougetsignal.com/tools/open-ports/

Once you're confident that ONLY your Debian PC is having trouble, try connecting to some other well known mail providers (like gmail, yahoo, etc). That will help narrow down the scope of the issue. If you can't connect to any of them but still have end-to-end connectivity, then it would seem likely that there's a blocked port/service in the mix.

If you CAN connect to some of them, then I'd consider collecting a packet capture (from both sides) to confirm that certain packets aren't making it all the way.

Solution 2:

I think you have a netmask mismatch. Check the routing tables of your computer, router and mailserver.