On some servers Dovecot doesn’t start automatically after reboot. That is a fault of the system administrator, but if you need to bring it back working there is a solution, that seems to be effective with all instances of listen() failed.
Let’s take we’re trying to start dovecot and getting the following error:
Fatal: listen(993) failed: Address already in use means that something else is listening the same port. We need to identify the process, that’s why we need to run
lsof -i :993
This will show us which processes are listening port 993. In order to start Dovecot we need to kill these processes to make this port free. Command output will show us PID numbers of all running processes we need to kill so this will not be so hard to do.
We need to achieve the moment when lsof -i :993 does not return any process. When no process is listenenng this port, we can start Dovecot as usually by entering service dovecot start. That’s all, enjoy :)