After upgrading Debian 6 to 7 I wanted to upgrade openSSL:
apt-get install openssl
This gave me the following error:
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf
Dovecot must have failed during the upgrade process.
To fix open the dovecot.conf file and update the following line:
mail_plugin_dir = /usr/lib/dovecot/modules/lda
mail_plugin_dir = /usr/lib/dovecot/modules
Dovecot will now be installed properly when you try upgrading any new package.