Sent: Monday, February 09, 2004 3:22 AM
Subject: Converting from MH to mbox?
I have a lot of mail (a LOT of mail) that is stored in what I believe is
MH folder format. Each message is stored in a single file, consecutively
numbered from 1 to n. Each message file include the entire message,
EXCEPT for the FROM_ line, which is completely absent.
First question, is this a MH formatted directory?
I've been playing around with:
cat /path/tp/MH/* > temp.box
formail -a Date: -ds < temp.box > newbox
but that yields an improperly formatted FROM_. Though I've also tried
piping that through a procmail recipe to fix the FROM_ header.
As a first cut, I might try:
find $MAILDIR -type f -maxdepth 1 | xargs -n1 -i+ sh -c 'formail -a "From "
< +' > all.mbox
You may need to interpose a grep to only apply the script to
filenames with a certain syntax, if there are other files in the mail
directory than just mail files.
procmail mailing list