[TriLUG] I need to fix a corrupted mailspool (mbox)

Jon Carnes jonc at nc.rr.com
Fri Oct 29 00:58:09 EDT 2004


On Fri, 2004-10-29 at 00:15, Errol Casey wrote:
> I have a 300+ MB spool file normal unix mail; but it was created via
> getmail (top pop mail) and the headers got changed such that the From:
> line was not the
> first line, of each message. I thought I could fix it by rewriting the
> file to remove all the headers before From:, and re-save the spool. But
> evidently, I must not have the correct carriage-return/line feed between
> messages, or other lines because the 300 MB spool file is still un-
> readable via mutt or qpopper due to issues with the format.
> 
> I've tried reprocessing what I have with formail -s procmail
> procmail_file < inbox; where procmail_file resaved the processed
> messages to a new spool file.  The outcome is still an unusable spool.
> 
> Anybody have any ideas of I can get this spool, into a readable format?
> other than looking at the entire spool :-)
> 
> I plan to get it readable by qpopper, and pop it into my desktop so I
> can view individual messages.
> -- 
> Errol Casey
errol at nouce.net

I've been down a similar road with Mailman - recreating the MBOX files
using the web archives. It's best to take a minimalist stance. Determine
the headers you really want to keep - write a script to parse the file
and dump any headers that don't match your criteria.

Start by grabbing copying the current spool and paring it down to one
email. Get that conversion to work. Next move to a spool file with about
five emails and get that conversion to work. Finally go for it.

Sounds like you've already done most of the things I would do as a
start.  Good Luck!

Jon




More information about the TriLUG mailing list