[NTLUG:Discuss] mbox repair util/script?

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 20 11:04:27 CST 2006


On Mon, Nov 20, 2006 at 09:13:15AM -0600, . Daniel wrote:
> Well this has happened twice so far and I'm wondering why.  My wife's 
> account on my mail server has twice managed to become corrupted in some 
> way.  (The time in between the incidents is greater than a year so I'm not 
> so much worried about the cause as I am about the correction.)
> 
> I have done a cursory search for a utility to scan and correct a damaged 
> mbox mail file and I am so far surprised that I haven't found any.  Perhaps 
> I have been searching for the wrong terms though (in my case, I searched 
> "mbox repair").  It's surprising to me because the mbox file format is just 
> so simple.  I'm sure I have overlooked something and that someone here will 
> have a recommendation right off the top of their heads.
> 
> Anyone have a suggestion for a simple, preferably command-line interfaced, 
> utility to repair damaged mbox mailboxes?

Perhaps formail?  From "man formail":

    DESCRIPTION
       formail is a filter that can be used to force mail into mailbox format,
       perform `From ' escaping, generate  auto-replying  headers,  do  simple
       header  munging/extracting  or split up a mailbox/digest/articles file.
       The mail/mailbox/article contents will be expected on stdin.

"man formail" also says:

       To convert a non-standard mailbox file into a standard mailbox file you
       can use:
              formail -ds <old_mailbox >>new_mailbox

Pm



More information about the Discuss mailing list