[Alpine-info] Mbox file not recognized properly
Mark Crispin
mrc+uw at panda.com
Thu Nov 5 09:38:55 PST 2009
On Thu, 5 Nov 2009, Thomas Gramstad wrote:
> Can anyone see what is wrong with the file and how to fix it?
I saw what was wrong at once. The very first line of the file contains:
From erik at naggum.no 04 Feb 1997 03:13:47 UT
That is not a valid mbox date/time format. Your best bet is NOT to copy
date/time from the From: header, where there can be any sort of garbage,
but instead simply to substitute the output from the UNIX "date" command.
If you want to be fancy, get the mtime from the source file and then
convert that to the mbox internal date using the ctime() function.
In case you wonder why is so fussy about the format: that fussiness means
that it is completely unnecessary to insert stupid ">" characters in front
of lines that happen to begin with the word "From". Only lines that match
the syntax requirements of a "From" line are treated as a "From" line.
One last point. From your script, it appears that the source messages
were in a one file/one message format. If they were in mh format, you
could have used mailutil to do the conversion. mailutil will even do the
fancy step mentioned above.
-- Mark --
http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
More information about the Alpine-info
mailing list