[Alpine-info] bug reports
Mike Miller
mbmiller at taxa.epi.umn.edu
Tue May 6 16:09:38 PDT 2008
On Wed, 7 May 2008, Guido Ostkamp wrote:
> Personally, I would like to stick with mbox, because it is the only
> format that is fully supported by 3rd party tools like Perl's Mail::Box
> and other Email clients, and there is no pure binary stuff in it (except
> attachments) that can break things easily, e.g. make searching with grep
> and other indexing tools etc. impossible.
Isn't MH another format with a lot of support? I am not 100% sure on
this, but I think MH is like mbox except that every message has its own
file and the files are in a directory. So instead of an mbox file named
"saved-messages", say, that contains 2,000 messages concatenated together,
you'd have a directory called "saved-messages" that held 2,000 separate
files -- one file per message.
I found this perl script somewhere, but I'm not sure where. Either it was
called mbox2mh or that was the name I gave to it:
-------------begin perl script "mbox2mh" on next line------------------
# syntax:
#
# mbox2mh mbox_file
perl -e '$x = 0; while (<>) { if (m/^From /) { $x++; open(MAIL, "> $x"); }; print MAIL $_; }' $1
-------------end perl script "mbox2mn" on previous line----------------
I have used the script and it worked. I just tested it again, as follows:
$ mkdir mh
$ cd mh
$ mbox2mh ~/mail/some_mbox
There were 148 messages in ~/mail/some_mbox so the mbox2mh command created
149 files in the default directory. The files were named 1, 2, ..., 149.
The first file was Pine's "internal data" file. I continued:
$ cat ? ?? ??? > mbox2
$ diff ~/mail/some_mbox ./mbox2
The files were not different. That exercise showed that to recreate the
mbox file from MH files all one need do is concatenate the MH files in the
correct order.
Anyway, that's all I know about MH and it might be wrong!
Mike
More information about the Alpine-info
mailing list