Mb2md

From DreamHost
Jump to: navigation, search

Converting mbox format mailboxes to Maildir

Mail servers typically store mail in one of two formats, mbox and Maildir. This process will convert mbox style mail to the Maildir format that Dreamhost uses.

These instructions assume you have enabled SSH access to your Dreamhost account and have located and saved the mbox format mail file from your previous host. For help retreiving this file, please contact your old host's technical support.

Download the conversion script

Although mb2md is available as a Debian packages in the standard distribution, Dreamhost does not have it installed. Luckily, it can be downloaded and run from your home directory.

First download the script from the mb2md web site into your DH home directory:

wget http://batleth.sapienti-sat.org/projects/mb2md/mb2md-3.20.pl.gz

Uncompress the file:

gzip -d mb2md-3.20.pl.gz

Give the script a nicer name and make it executable:

mv mb2md-3.20.pl mb2md
chmod u+x mb2md

The conversion process

All that's left now is the actual conversion process. Upload your mbox file to your home directory using SFTP, SCP, or FTP. Now, the conversion itself, where mbox_file is, obviously, the name of your mbox file:

./mb2md -s mbox_file

Your output should look something like this:

$ mb2md -s mbox_file
Converting /home/username/mbox_file to maildir: /home/username/Maildir
Source Mbox is /home/username/mbox_file
Target Maildir is /home/username/Maildir
23 messages.

That's it! You can now safely delete the original mbox file.

Additional Information