Maildir to mbox? Ha! Impossible
All I want to do is convert a freaking giant folder full of mail, in maildir format, to some mbox files that Hula can understand. Why? Because I want to move my email server from Courier-imap to Hula.
One would think this would be easy… I mean, after all, they’re all plain text files. Eric S Raymond tells us that, as long the files are in plaintext, they’re forever useful, and can never be lost. While ultimately that’s true, practically, it’s not.
There are two popular scripts I’ve found for converting maildir to mbox, both of which do nothing useful (YMMV):
xfmail2mbox.sh and maildir2mbox. Loathesome vile code! From making me do gymnastics with where my mail is actually stored on the hard drive, to converting random characters in my emails to their numeric ascii equivalents, both of these conversion scripts create mbox files that Hula thinks are single giant email messages. Maybe it’s Hula, maybe it’s the script, but this crap is frustrating.
There are some tools out there that can convert imap folders from one imap server to another, given that you have two imap servers. I nuked one (Courier-imap) in favor of the other (Hula), and don’t want to try and get both of these beasts set up on the same machine just for the sake of copying! Hula is ok, but setting up courier is an odious experience that I would only inflict as torture as a last resort in an attempt to recover hoarded medicine.
Finally, as someone helpfully suggested in #hula, it turns out that I can open an email client that supports importing a maildir, and then I can copy over the emails from the maildir to my running Hula server via drag and drop. Hackish, I know, but at this point, I’m willing to try anything. KMail doesn’t have support for importing maildirs directly, nor does thunderbird at the time of writing. Thankfully, Novell Evolution has this one covered. You can create an account with a server of type “maildir,” point it at your maildir on disk, and Evo will pick up all the mails. From there, it’s just a simple drag-and-drop to the running imap server, which took a few hours copying a few gigs of email. Fine by me.