I have a confession. I’ve stopped believing in Evolution. I don’t know how it happened, but it slowly evolved (or devolved) into one shitpile of an email/calendar/groupware application. The latest version packaged with Ubuntu is slower and buggier than ever. It will occasionally crash while using it (some of the controls in the configuration panel will crash it instantly on activation). While running in the background, idle, doing nothing, it will suddenly crash for no reason. As my friend Mike has joked, “They call it ‘Evolution’, because it’s not intelligently-designed.”
This stability problem is untenable. So I’ve decided to migrate to Thunderbird.
For some reason (documented on the dev wiki, I’m sure), Novell has decided to start using Maildir as the backing storage format for emails instead of the venerable mbox format. Maildir puts every message in its own file sorted by folder, whereas mbox stores all messages in a folder into one large file. The benefits of having thousands of small files is obvious if you consider how easy it would be to lose every message contained in an mbox file should it become corrupted. Novell included a conversion module to be run after the Evolution app upgrade that automatically converts the entire mbox store to Maildir. Since it leaves an archival copy of the mbox folders, this is not a problem…as long as you don’t receive any new mail for Evolution to pile into the Maildir folders.
Enter Thunderbird. It doesn’t natively support Maildir (yet), so it requires mbox for its local storage. Normally, I would just take the folder of mbox files and copy them over into the area used by the new mail client, but I can’t do that this time; can’t use the mbox archive without losing all of the mail collected into the Maildir folders since the upgrade back in June. So what to do? I thought about using some scripts to do the conversion, but most of the ones I found online wouldn’t handle the nested folder hierarchies of my emails. Next solution: use Evolution to push my entire mailstore, one folder at a time, up to an IMAP mail server, and then fetch it with Thunderbird. Well, that would swamp the server and take a while to chew through. Lots of hand-work.
Third solution? Set up a local (on this machine) mail server and copy my messages from there. Brilliant! Enter Dovecot, an email server that handles both IMAP (where mail is stored on the server and accessible from anywhere) and POP3 (where mail is fetched from the server by the email client and stored locally on disk). It natively supports different mail stores, is quick, highly configurable, and fits the job nicely. So here’s my migration path:
- In Evolution, make a backup of all emails into a tarball (likely named “evolution-backup-<date>.tar.gz”). At this point, stop using Evolution. Configure its email account settings it to leave mail on the server of all the email accounts it accesses. Wash your hands.
- Open the tarball and navigate down to “/.local/share/evolution/mail/”; pull out a copy of “local”, rename it “Maildir”, and drop it into your home folder (“/home/<username>/Maildir/”). This is where Dovecot will store your messages.
- Install Dovecot (you’ll need root or sudo privileges). It’s preferred to install the dovecot-imapd package since it comes preconfigured for IMAP support.
- in “/etc/dovecot/dovecot.conf”, uncomment “listen = *, ::” This tells Dovecot to listen to all network interfaces.
- in “/etc/dovecot/conf.d/10-mail.conf”, uncomment “mail_location =” and set the value to “~/Maildir”. This tells Dovecot that each user’s mail is in their home directory in the folder “Maildir”.
- restart Dovecot.
- Install Thunderbird and configure it to connect to the localhost server using your system username and password. Follow these instructions if you need handholding. Tell Thunderbird to subscribe to all of your mail folders if they’re not visible.
Some finagling later, and I got Thunderbird talking to and browsing all my mail. Success! And it was at this point that I had an epiphany. One of the problems I’ve had over the years is that all of my email (the stuff that wasn’t hosted on an IMAP server somewhere) is stored locally on my desktop’s disk and inaccessible from anything that wasn’t a mail client running on the system. This made it difficult to dig through old messages or check my POP3 mail if I wasn’t at home. So, why did I really need to copy everything from the “temporary” Dovecot server into the “local folders” of my email client? Why can’t I just, I dunno, actually keep using Dovecot as my own email server so I can access it from anywhere? Bully of an idea!
So what I’ve done is set up port forwarding on my home cable modem router to allow inbound connections on such-and-such a port to be routed internally to my desktop. With a little bit of work last night, I was able to install Thunderbird on my laptop and configure it to access emails, hosted in my house, at the cafe. Two birds, one stone.
The next step is to install something like fetchmail to periodically pull all of the mail sent to my POP3 boxes (I have several addresses across all my domains) and drop them into Dovecot’s inbox so I can check for new messages from anywhere.
This is all very rewarding for me. After some time mired in frustration, to have a project finish so successfully is a welcome bit of cheer. And cheer is what I need going into this next year. 2012 was alright, but it ended on a down note. Every day is a rollercoaster ride of neurochemicals and social currency, so any sort of positive news is like a sigh of relief. May 2013 be better for us all.