I upgraded a MySQL installation today and broke the dovecot POP/IMAP daemon. Fortunately, the fix wasn't too hard, and hopefully this will be useful to someone.
The MySQL upgrade was from 4.1 to 5.1, so it was a pretty big move. I compiled the new release, shut down the web server, dumped all the databases, removed the RPMs, installed the new version, restarted things and restored the databases. Things were pretty much working... although I had had to uninstall the old RPMs with
rpm -e --nodeps since the dovecot POP3 daemon had MySQL as a dependency. But running
/usr/sbin/dovecot showed no dependency on the MySQL client library, so I figured maybe that was just a spec file thing. Wrong!
I restarted dovecot and the process died leaving this in the log:
Not good. One of the dovecot options is to get passwords from a database. I use PAM, but dovecot still depended on MySQL. Blah!
Fortunately, the fix was pretty easy. I hunted down the source RPM, installed it with
rpm -i dovecot-0.99.11-4.EL4.src.rpm, and edited
/usr/src/redhat/SPECS/dovecot.spec. Here are the changes I made:
7/30/09 update: Better yet, just set these options:
Then a quick build and install:
Enable dovecot to start on boot with
/sbin/chkconfig --level 345 dovecot on and you're back in business. Hope this helps someone!
Incidentally, if you need a Postfix book, try The Book of Postfix: State-of-the-Art Message Transport by Ralf Hildebrandt and Patrick Koetter. It's a few years old but still very relevant... and of course Postfix is a great mail server. Enjoy!