dovecot start "Address already in use" error

I'm currently trying to use some "[email protected]" adresses on my dedicated server (Centos5).

To do so, I'm tring to launch dovecot with /etc/init.d/dovecot start, but I get the following error message :

Starting Dovecot Imap: Error: service(pop3-login): listen(*, 110) failed:
Address already in use
Error: service(pop3-login): listen(*, 995) failed: Address already in use
Error: service(imap-login): listen(*, 143) failed: Address already in use
Error: service(imap-login): listen(*, 993) failed: Address already in use
Fatal: Failed to start listeners
                                                           [FAILED]

Something is already listening on these ports, but I don't know what. Qmail was previously installed on my server, so I removed it, but it didn't solve the problem.

Do you know how to fix this ?


This command will show you what's listening:

$ sudo netstat -lnp | grep 993
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      4470/imap-login

The last column gives you the PID and name of the process bound to that particular port.


Just did an upgrade on an AWS Linux instance and dovecot wouldn't start with Address already in use errors (same as original poster).

netstat and lsof didn't show any process attached to those TCP ports.

Eventually I discovered that as part of the upgrade the portreserve package was installed. It had a config file /etc/portreserve/dovecot which had listed the problematic ports. I renamed the file to /etc/portreserve/dovecot~ and now everything works fine.

According to https://bugzilla.redhat.com/show_bug.cgi?id=1570282 because portreserve only does a bind() to the port, and doesn't do a listen() it won't show up in lsof or netstat. That makes it really tricky to troubleshoot.


Edit dovecot conf and replace :

protocols = imap pop3 imaps pop3s

with

protocols = imap pop3

You might be missing the certificate for SSL ports.