Converting mbx to Maildir format

From DreamHost
Jump to: navigation, search
WARNING

This no longer works due to a system change as of April, 2008.
New and existing email address may no longer be tied to a shell user if they are not already, though email may be forwarded to a shell account.
See Shell-linked E-mail for details.

Unix, Eudora, and numerous other programs use mbx format for mail, which stores all mail in a single file. Squirrelmail uses Maildir format, which stores each separate mail in a separate file in a particular directory.

To convert between mbx and maildir on Dreamhost, you need to set up a user with diskspace (SFTP or shell account); copy the mbx file to the new user's account; and convert the file.

  1. Set up a full user with disk space (SFTP or shell user; pop mailbox only users (m123456) won't work
  2. Copy the mbx file to the new user's account (e.g., sftp/ftp or chmod file permissions & cp the file to the correct user account).
  3. Convert the file. You can do this with a script, such as mb2md (google mb2md-3.20.pl).
    1. google for the file; one current location is pkgsrc.se
    2. install on the user's account; be sure to make the file executable by the user or group
    3. run the file on the .mbx; e.g., mb2md-3.20.pl -s yourmailboxname.mbx
    4. It will create a maildir in /home/username/Maildir
      1.  !!! Be careful !!! If you have a preexisting folder, it will overwrite it!

The Maildir structure looks like this:

$ tree -a /home/''username''
/home/''username''

: |-- Maildir
: |   |-- .''Foldername''
: |   |-- .''Foldername2''
: |   |-- .''Foldername3''
: |   |-- courierimapkeywords
: |   |-- courierimapsubscribed
: |   |-- courierimapuiddb
: |   |-- courierpop3dsizelist
: |   |-- cur
: |   |   |-- 1181751105.000000.mbox:2,S
: |   |   |-- ''many other messages''
: |   |   `-- 1181751105.006159.mbox:2,
: |   |-- new
: |   `-- tmp
: |-- chill-theplanet-060612
: `-- logs
:     `-- resources
:         |-- chiller.sa.analyzed.0
:         |-- chiller.sa.itemized.0
:         `-- sa.analysis.pl

(If there are thousands of messages, then it will be a verrry long tree.)