Re: Perl script to identify corrupt mbox messages?

Discussion in 'Firefox' started by Tuxedo, Jun 16, 2007.

  1. Tuxedo

    Tuxedo Guest

    Dr.Ruud wrote:

    > Tuxedo schreef:
    > > Dr.Ruud:

    >
    > >> Use formail to repair the file, is why I suggested it.

    > >
    > > This interesting utility is indeed is on my Linux system. But
    > > having neither a remote idea what error(s) the original mailbox may
    > > contain, nor being familiar with formail, it is a bit complicated to
    > > guess how to best process it. Nevertheless, I tried the following
    > > examples:
    > >
    > > formail -ds <my_crappy_mbox >>reinvigorated_mbox
    > >
    > > ... this certainly made some changes, in fact, 10 or so additional
    > > messages appear in the Mozilla index which did not show up earlier,
    > > including a couple without a valid sender which are now listed by
    > > Mozilla as from foo@bar, but which appear to be file fragments, i.e.
    > > not real mail.

    >
    > I assume that you want to find out at which message the problem starts
    > and at which line in the mbox file that is, and start fixing from there.


    Yes. If I only knew. I tried to split it up, delete sections and so on,
    only to find the problem appearing in many sections, but not knowing
    exactly where. The file is just too big to locate the error manually.
    >
    > Be careful not to introduce extra problemes with the move of the mbox
    > file from the Windows to the Linux system (maybe you should do a
    > dos2unix on the file, and then maybe you shouldn't, formail will DWIM).
    >
    > You can use formail together with procmail to convert from mbox to
    > maildir format (the one file per message in new/ cur/ tmp/ structure)
    > like this:
    >
    > formail -defYz \
    > -s procmail -m VERBOSE=yes DEFAULT="test_maildir/" /dev/null <
    > crappy.mbx
    >
    > (the "test_maildir/" will be created in the user's $HOME, include
    > MAILDIR="/some/path" to redirect)
    >
    > The "-defYz" just lists all interesting options for this case, change at
    > will, see man formail.
    >
    > From the maildir structure you should be able to find out at which
    > message the split up breaks.
    >


    Many thanks for all the tips, especially about formail. However, in this
    particular case, I will leave the problematic mbox to rest, because it is
    my ambition not to deal with anything from the Windows user space. In
    realising it is probably a 99% Mozilla bug, my solution became to simply
    transfer the file to a good old BSD mail server and let the file owner
    access it's content via Neomail - an exceptional perl program which handles
    mbox pop-mail via a no-frills web interface. I just tested that and the
    full mbox was read, as fine as it was in MUTT or another native *nix mailer.

    Sooner or later Mozilla developers will likely fix the bug, whatever it is.
     
    Tuxedo, Jun 16, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mkinsman

    NAS Perl/CGI Script

    mkinsman, Nov 23, 2003, in forum: Cisco
    Replies:
    0
    Views:
    598
    mkinsman
    Nov 23, 2003
  2. tomviolin
    Replies:
    9
    Views:
    1,100
    Richard Graves
    Apr 26, 2005
  3. Mumia W.
    Replies:
    1
    Views:
    607
    Tuxedo
    Jun 16, 2007
  4. Tuxedo
    Replies:
    0
    Views:
    517
    Tuxedo
    Jun 17, 2007
  5. business one way

    Is it a Perl program or a Perl script?

    business one way, Jan 5, 2008, in forum: Digital Photography
    Replies:
    0
    Views:
    748
    business one way
    Jan 5, 2008
Loading...

Share This Page