
extracting text mail messages from binary mailbox
If I use strings to extract the text from a binary mailbox,
I'm wondering if there is a command that I can use to
extract the mail headers and the body. I have formerly done this
on a _single_ email with:
cat single.msg |sed -e '/^$/ q'
and
cat single.msg |sed -e '1,/^$/ d'
but I don't always get perfect results from those sed commands.
However, it would seem necessary to first split the text
into legitimate mail messages from "<lf>From " to "<lf>From ".
In doing this, I would also have to eliminate any garbage text
(i.e. that text that isn't part of the header or body.
Much of this in the said binary mailbox (Entourage's Database)
is 4- or 5-character lines e.g. 9CTID or FLRC and I'm not sure
how those can be properly identified since a paragraph could end
with something like
this.
Thus, I'm trying to convert a binary mailbox into a
standard sendmail mailbox. Thanks for any ideas, thoughts
or other help.