Migrating from uw-imapd to Dovecot

From the I-should-have-done-this-much-earlier department … I recently migrated my IMAP daemon from uw-imapd to Dovecot.

For those of you who wonder what on earth I’m talking about: uw-imapd and Dovecot are so called IMAP servers, IMAP being a protocol that allows you to read your e-mails (a bit like POP3 but IMAP is designed to allow managing mails on the server, supporting stuff like folders and so on). I mostly use IMAP to access my mail through a web interface (using RoundCube Webmail that is) when I’m not at home and while uw-imapd worked fine for me as far as functionality was concerned, one of my mail accounts with thousand mails in its Inbox would always take ages to access. Knowing that, I started looking around for alternatives to uw-imapd and found the Courier IMAP server but that one would’ve required me to change my mailbox format from ‘mbox’ to ‘maildir’ which in turn would have forced me to reconfigure all other programs handling mail on my machine (the SMTP server being the most scary one). Months went on and then I finally stumbled across Dovecot which can apparently handle my mbox-type mailboxes.

So I decided to give it a try and migrate my box. Step 1 was getting the software which, given my mail server is running Debian, was as easy as typing:

aptitude install dovecot-imapd

and hitting the ENTER key a few times. At the same time, removing uw-imapd seemed like a good idea (to make sure it doesn’t run simultaneously, …). This is done with:

aptitude remove uw-imapd

It should be noted, that Debian by default doesn’t remove all of a package’s configuration files which is useful if you ever decide you want to reinstall it again. To actually remove all files related to a package, use ‘purge’ instead of ‘remove’.

Now, with uw-imapd gone and dovecot-imapd ready to roll I inspected the /etc/dovecot/dovecot.conf file and added/uncommented this line to ensure proper locking of the mailboxes while it was working in them:

mbox_write_locks = dotlock fcntl

Next, I went into each of my user’s home directories and moved the mbox files to where Dovecot expects them to be (uw-imapd just put them in ~/, the home directory itself, Dovecot wants them to be in ~/Mail/). To finish, I should probably have moved over the IMAP subscriptions by doing “mv .mailboxlist Mail/.subscriptions” but I just deleted .mailboxlist from the home directories and recreated the subscriptions in Roundcube.

So there you go, the final result of the operation: My archive mailbox now opens within 10 to 20 seconds and allows me to delete mails with a few seconds response time as opposed to the several minutes those operations took under uw-imapd. If I feel like it, I might try giving dovecot-pop3d a try too, but for now my current POP3 server does the trick fine.

Leave a comment

Your email address will not be published. Required fields are marked *

Bear