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 setting up an email server with Postfix and Dovecot. Remote email clients can read email, but cannot reply to it or send new messages. (Email clients local to the server receive and send email just fine.) For example, Alpine tries until told to give up, when it says "Error sending: SMTP greeting failure 421 SMTP connection went away".

When I run alpine -d 4, the debug output shows:

=== sending:
Sending mail...
call_mailer: via TCP
IMAP 11:34:01 9/14 mm_log babble: Try IP address [xx.xx.xxx.xxx]
IMAP DEBUG 11:34:02 9/14: * OK Dovecot ready
tcptimeout: waited 15 seconds
tcptimeout: waited 30 seconds
. . . .

To me, that suggests a problem on the server b/w Dovecot and Postfix. But I can't figure out how to diagnose it.

The server's syslog shows a successful imap-login, but none of the logs (remote or client) seem to have any information about the failure to send the message.

Odds are very good that I've screwed up something in the Postfix or Dovecot configuration (SSL / TLS? SASL?) I'd like to trouble-shoot this without guessing endlessly. So, please: What is a good process to debug this?
How can I test the interactions among the various processes so I can find the one that is failing?
Is there a way to increase the debugging / logging output of Postfix and Dovecot?
Is there a way to emulate the Dovecot / Postix interaction, and / or the remote client / IMAP server connection, so I can see if these are proceeding as required?

Thanks.

share|improve this question
add comment

4 Answers 4

Are you sure you have an SMTP mailer running, i.e. telnet into your mail server on port 25 and get a response?

share|improve this answer
    
Sorry, are you running both SSL and plain sending? Either way, you can try running tcplist/sockstat/netstat to find out what programs are listening to what ports to make sure postfix is listening to the port you're trying to send out on. –  Bart Silverstrim Sep 14 '09 at 15:50
    
Yes. $ telnet mail.example.net 25 -> 220 mail.example.net ESMTP Postfix (Debian/GNU) –  chernevik Sep 14 '09 at 15:52
    
The clients, how are they configured to send mail? Plain SMTP? –  Bart Silverstrim Sep 14 '09 at 15:53
    
Haven't run netstat b/c I thought the IMAP login log messages indicated a connection. –  chernevik Sep 14 '09 at 15:56
    
IMAP shouldn't handle outgoing mail. Postfix does. Still need a daemon monitoring incoming connections. –  Bart Silverstrim Sep 14 '09 at 15:58
show 18 more comments

I would also suggest that this is a postfix issue, what is the output of:

postconf -n

and

tail -n 50 /var/log/maillog (mail.log on ubuntu boxes)
share|improve this answer
add comment

First of all, I would start with splitting this into 2 issues. IMAP is handles by Dovecot. If you are able to receive your messages from the server, then Dovecot isn't the issue, it is doing its job.

Sending the mail is done with Postfix. You said "mail clients local to the server receive and send email just fine." - this indicated to me that your mail clients may not be authenticating to the Postfix server on port 25, or it is not listening on your external interfaces on port 25. As Bart mentioned, try to telnet to port 25 and see if you get the Postfix banner. If you do, make sure your clients are authenticating (and you've set up Postfix to allow authentication) so that they can send mail through your server.

share|improve this answer
    
I do get a Postfix banner when I telnet to port 25. netstat shows some process "master" listening to that port. –  chernevik Sep 14 '09 at 16:11
    
"Make sure your clients are authenticating" -- how do I do this? I don't see any authentication failures in the server logs. I do get these when I run Alpine and give a bad server account password. –  chernevik Sep 14 '09 at 16:16
    
You get these when checking mail though, right? Alpine can access both imap and smtp. I would turn off any SSL you have set up and then troubleshoot using telnet to port 25, see if you are getting the banner, and send a message from there (either using AUTH or not) –  Dave Drager Sep 14 '09 at 16:39
add comment

You can pretend to be a client by reading the relevant RFC (particularly around section 4) and pretending to be a mail client. Turn off all SSL/TLS configurations first to see if you are able to send mail properly. Then, turn them on and use telnet-ssl or openssl client to connect to the SSL ports instead.

Also, you need to be clear on whether there are problems with local or external mail delivery. If it is local delivery, you need to check how this is done by postfix. A common way would be to pipe local mail delivery over to procmail but it is also possible to pipe it over to dovecot and you need to make sure that the piping is working correctly. Check the logs.

share|improve this answer
add comment

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.