Fixing Dovecot 1 to 2 migration on Debian Wheezy

09 Jun 2013

I upgraded my mailserver from Squeeze to Wheezy the other day, I was running Dovecot 1, but Wheezy only has Dovecot 2. It tried to upgrade my installation, but this went terribly wrong and it broke the mailserver. Below I will share what errors I encountered and how to fix them.

After running bashaptitude upgrade aptitude failed on installing dovecot-core. To see the error messages you can run:

doveconf -n -c /etc/dovecot/dovecot.conf > dovecot-2.conf

It will show you the error messages on which dovecot currently fails. For me this was SSL:

doveconf: Error: ssl enabled, but ssl_cert not set
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: ssl enabled, but ssl_cert not set

I ended up uncommenting the SSL section and setting the correct paths to the certificates. After this came the following error:

[....] Starting IMAP/POP3 mail server: dovecotFatal: service(auth) access(/usr/lib/dovecot/dovecot-auth) failed: No such file or directory

I had a /usr/lib/dovecot/auth file but not a dovecot-auth file. So I created a symbolic link:

ln -s /usr/lib/dovecot/auth /usr/lib/dovecot/dovecot-auth

This fixed my issues. After this I did an

aptitude upgrade

and all my problems were fixed.