I'm trying to use telnet (debian lenny 5.0.2) to check behavior of a postfix installation, but I can't telnet to smtp.

telnet localhost smtp
telnet: Unable to connect to remote host: Connection refused

telnetting to port 25 doesn't work either. I can telnet to port 110 and pop3.

How should I go about debugging this?

UPDATE: The command ps aux|grep 'postfix' revealed that postfix wasn't running. Inspection of /var/log/mail.err and /etc/postfix/main.cf uncovered a typo in main.cf. After correcting that, postfix ran fine.

Note that 'postfix start' returned a message reporting that postfix was starting. When postfix wasn't starting, no error message or warning was returned.

link|improve this question

79% accept rate
You say in the comments below that you solved the problem. Please edit your question to explain what happened so that others with your problem will learn when they find this question. – Andy Lester May 6 '10 at 17:26
feedback

2 Answers

up vote 3 down vote accepted
  • First: check if Postfix is running: ps aux | grep postfix
  • Second: check if somebody is actually listening on port 25: netstat -lnp | grep :25
  • Third: if all of the above is ok, then probably the system firewall is preventing you from opening that sort of connection; have a look at its configuration using iptables -L.
link|improve this answer
Thanks. Not running postfix. No error message given on 'postfix start' -- had to inspect mail.log to discover fatal error. Off to fix. – chernevik May 6 '10 at 16:57
1  
Found problem, fixed problem, working, many thanks! – chernevik May 6 '10 at 17:00
feedback

For future searchers on this question, it is possible to have postfix (or any other server) running but specifically not listening on localhost. It can bind to individual addresses which are not localhost.

If netstat's output says anything but *.25 or 0.0.0.0:25, there is a good chance you've bound to whatever interface is running and you'll have to telnet to that IP (which is still local!)

In other words, localhost is not the same as the IP running on your machine.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.