Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am attempting to set up an email server on a VPS running Debian Squeeze. I've setup Postfix according to the instructions at here.

Everything seems to work fine if I connect to the server from localhost:

mark@revolver:~$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 xxxxx.xxxxxx.com ESMTP Postfix (Debian/GNU)
ehlo localhost
250-xxxxx.xxxxxx.com
250-PIPELINING
250-SIZE 30720000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Also, a relevant entry appears in /var/log/mail.log:

May  9 22:03:28 revolver postfix/smtpd[2919]: connect from localhost.localdomain[127.0.0.1]

However, attempting to telnet remotely from my laptop is not working correctly. I can connect to the host on port 25, but the server won't respond to any commands and will close the connection after about 20 seconds. For example:

$ telnet xxxx.xxxxxx.com 25
Trying xxx.xxx.xxx.xxx...
Connected to xxxx.xxxxxxx.com.
Escape character is '^]'.
421 Cannot connect to SMTP server xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx:25), connect timeout
Connection closed by foreign host.

Interestingly, there is nothing in the log files.

Any ideas what might be causing this? I'm especially confused by the 421 error. Why is the server trying to connect itself?

share|improve this question
    
You have a firewall on the VPS, which is not allowing incoming SMTP connections. –  Sandor Marton May 10 '13 at 2:53
    
I've already configured iptables to allow SMTP connections. And the connection is being established, but it just hangs for about 20 seconds before I get the 421 error and the connection is closed. –  Mark May 10 '13 at 3:22
    
the fact that you get a 421 SMTP error code means that some (but maybe not your) MTA/Proxy is accepting the connection. Check if a local firewall/antivirus application or your provider is interfering with outgoing port 25 connections. try to connect from a different place to your vps. –  Gryphius May 10 '13 at 5:45
    
There should be something in error log. But we are not mind readers, so post postfix config and all log which is logged at the time of test (not only what you find relevant). –  Sandor Marton May 10 '13 at 13:33
    
Please post you poatconf -n along with your postfix log messages... –  vijay rajah May 10 '13 at 15:48

1 Answer 1

The problem was the firewall after all. Port 25 was open, but those connections were being forwarded to port 465, which had not been allowed. A simple addition to the firewall solved the problem:

-A INPUT -p tcp --dport 465 -j ACCEPT

Thanks for the help guys!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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