It is actually quite easy to convert from mbox format to maildir format.
Fire an command “mb2md” can save you tons of works.
Important: you must logon as the user who owns the directory or using the sudo command.
testuser@hostname$ mb2md -s <sourcefile> -d <destinationdir>
For example:
testuser@hostname$ mb2md -s ~/Maildir/spam -d ~/Maildir/.spam/
which ~/Maildir/spam is an spam file in mbox file wrongly deliver by procmail
and ~/Maildir/.spam/ is the destination Maildir I wish the command send all the email to.
Then, wait a few minutes or hours depends on the size of the original mailbox.
The resulting should be :
1. ~/Mailbox/spam unmodified.
2. Maildir created as ~/Maildir/.spam/{cur,new,tmp}
3. Every mail in the mbox ~/Mailbox/spam is placed under ~/Maildir/.spam/cur individually.
Enjoy!
RSS feed for comments on this post · TrackBack URI
Leave a reply