I am trying to set up postfix with dovecot. I can telnet to localhost 25 and send a message to accounts on the server.

However, when I try to telnet to port 25 on this server from another server I get "421 Cannot connect to SMTP server" ... "connect error 10060".

The firewall is open right now:

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

Is there some setting in main.cf which tells it whether or not it should listen on port 25 or 587 or whatever?

  • 1
    Doesn't make sense. How do you get an SMTP status code from a telnet session that fails to connect?
    – Mel
    Commented May 20, 2011 at 13:35

2 Answers 2


It sounds like you are listening on but not or whatever your specific interface address is. This means the port is open to the local host but not the external interface. Check the postfix config file for what interface is being listened on.

Check this setting in particular:

inet_interfaces = all
  • you can also determine what interfaces are being listened on via netstat or lsof, e.g. lsof -ni:25
    – jmtd
    Commented May 20, 2011 at 12:45
  • inet_interfaces is already set to all. Any other ideas? I ran the lsof -ni:25 command and I got the following "master 7361 root 11u IPv4 1856221 TCP *:smtp (LISTEN)". Commented May 23, 2011 at 5:03
  • 1
    That result sounds like it's listening! Check what interface it's listening on with netstat -lntp.
    – Caleb
    Commented May 23, 2011 at 10:28
  • Here is the line for port 25 "tcp 0 0* LISTEN 7361/master". Is "master" the name used by postfix? If so, what else could be blocking my server? If it helps it's a godaddy server. That shouldn't be a problem for inbound connections though. Commented May 23, 2011 at 23:36
  • Um, according tothat you are listening. now we have to ask you what test you are using to say it isn't.Are there firewall rules in play?
    – Caleb
    Commented May 24, 2011 at 14:45

The problem was that my MX records were not set up properly on my domain. The port 25 thing was a red herring. Godaddy just forbids servers from directly connecting to port 25 on other Godaddy servers.

  • Thanks for updating on this - had basically the exact same problem
    – Nilzor
    Commented Nov 15, 2012 at 20:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .