my projects


mh2maildir is a perl script to convert a mailbox in the MH format to the Maildir format. The name of this script shows how imaginative I can be ;-)

A few months ago (it was still 2004), I changed my e-mail habits. I used to use Sylpheed to download all my mails using POP3, and then I realized it was much more convenient to always have my mails available on an IMAP server. I didn't want to use the infamous mbox format, and I quickly found that the Maildir format was the best format to fit my needs. And there I was, wanting to convert my mailbox in the MH format to the Maildir format.

After searching a bit on Internet, I found two scripts handling this task. But both had limitations:

Since I was not satisfied by the solutions I found, I chose to write my own script. This script would use the metadata from Sylpheed, which would make it easy to keep the mails status. I took Robin Slomkowski's script as a basis, and improved it. Here are the features I added:

Of course, before you use this script, it is highly recommended that you backup your mails and you stop the reception of new mails. The theory says no mails of the mailbox in the MH format should be deleted. But that's only theory...

Here's the basic example, where mails will be put in $HOME/Maildir:

mh2maildir /path/to/MH/dir

Here's another example:

mh2maildir /path/to/MH/dir /path/to/new/Maildir

There is no known bug. But since I'm in no way perfect, there should be some bugs ;-) All contributions to improve the script is of course welcome.

This script is released under the GPL 2.0 license.

Release 1.0 (11/10/2004)

Initial release.
Download the script.

by Vincent