This morning I started doing the standard dist upgrade on a Debian server and Dovecot died with the following error 🙂

[….] Starting IMAP/POP3 mail server: dovecotError: socket() failed: Address family not supported by protocol
Error: service(pop3-login): listen(::, 110) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(pop3-login): listen(::, 995) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(imap-login): listen(::, 143) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(imap-login): listen(::, 993) failed: Address family not supported by protocol
Fatal: Failed to start listeners
failed!

 

If you look closely at it, the mistake catches a person's eye listen(::, 993) failed apparently trying to listen to the ipv6 address i have banned 😈 . The solution is as obvious as the mistake itself – we need to make dovecot only work on ipv4, which is achieved with the following order in /etc/dovecot/dovecot.conf
listen=0.0.0.0
Then we hit a quick restart of Dovecot and everything is in order and we can continue with the distribution upgrade