![]()
From: Martin Schulze (joey@finlandia.Infodrom.North.DE)
Date: Thu Oct 28 1999 - 14:45:00 CDT
Pat Barron wrote:
> I have a directory (actually, a few hundred directories....) containing a
> bunch of files. Each file contains a single e-mail message, in RFC822
> format. Can anyone point me to a utility to gather up all those files,
> and convert them to a single "mbox" format file, suitable for feeding into
> Hypermail?
find -type f|while read f; do cat $f >> /foo/bar/mbox; done
If they're in proper RFC822 format, i.e. start with From_ and end with a
newline, that's it. If not, you want to use formail -f or something in
between.
> I do have to be able to preserve the message dates, so any solution
> must get the message date from the RFC822 "Date:" header, and put it into
> the mbox "From_" line.
Ah, cat $f|formail -f or something similar.
Regards,
Joey
-- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
![]()