seawasp: (Default)
[personal profile] seawasp
Well, I switched from Netrape Aggravator to the Mac Mail program for the interim.

So far, I can't get any of the obvious applications to open (a copy of) the original mail file. Word of course doesn't recognize it, TextEdit refuses it, and when I tried:

"formail -e -d -s inboxfile >> newinboxfile"

(substituting "Inbox" for "inboxfile" and "NewInbox" for "newinboxfile")

my console just sorta sat there for, well, a long time until I finally killed it off. There was a new file called "NewInbox", but it had nothing in it.

Any more ideas? I've got like 1.2GB of mail file sitting there mocking me. I'm sure MOST of it must be perfectly fine.

Date: 2009-07-29 10:56 pm (UTC)
From: [identity profile] laptop-mechanic.livejournal.com
Have you tried thunderbird?

Date: 2009-07-29 11:03 pm (UTC)
From: [identity profile] ninjarat.livejournal.com
Fire up Terminal and edit the file with vi: "vi filename". The first few lines should look something like this:

From MAILER-DAEMON Wed Jul 29 18:45:59 2009
Date: 29 Jul 2009 18:45:59 -0400
From: Mail System Internal Data <mumble@mumble>
Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
Message-ID: <mumble@mumble>
X-IMAP: 1172181894 0000005764
Status: RO

If they don't then either you have the wrong file or a compressed copy of the file. BTW, type ":q!" to quit without changing the file.

Date: 2009-07-29 11:45 pm (UTC)
From: [identity profile] ninjarat.livejournal.com
Depends on the nature of the corruption. mbox files have a very specifically defined structure. Any deviation from that structure = your MUA (mail user interface -- the mail program) can't read it. That's why you need to go into the file itself and eyeball it to make sure you really have a valid mail file. If you didn't see anything with vi then just more the file. There should be *something* there.

Date: 2009-07-30 12:00 am (UTC)
From: [identity profile] ninjarat.livejournal.com
Okay, now we're getting somewhere. All those ^M (carriage return) characters are DOS end of lines. Need to get rid of them. Easiest way is with tr:
tr -d '\r' < Inbox > NewInbox
Do that then try to read NewInbox.  If that doesn't work then forcibly open the file with Text Edit and clear out any blank lines at the start of the file.  The first few lines of real message should look like what I posted before.

Date: 2009-07-30 01:47 am (UTC)
From: [identity profile] ninjarat.livejournal.com
The heck? Okay, that's wack. It means you don't have a text file since tr only works on plain text. It doesn't like non-ASCII. I think I'm at the point where I'd have to look at the file to see what's wrong with it and how to fix it. Sorry. That file is really messed up somewhere.

Are you *absolutely* positive that you have the right file?

Date: 2009-07-30 02:58 am (UTC)
From: [identity profile] m0rlock.livejournal.com
The mostly equivalent command in perl to ninjarat's tr command is

perl -npe 's/\r//g' Inbox > NewInbox

It ought to be a little more effective on the non-text portions of your Inbox.

Date: 2009-07-30 05:53 am (UTC)
ckd: (cpu)
From: [personal profile] ckd
Hmm. Maybe not. There are way too many EOL styles.

CRLF - ^M^J - 0x1310 - this is the DOS/Windows standard as well as what most Internet protocols use "on the wire"

CR - ^M - 0x13 - The Mac standard from the days of Mac OS 9 and earlier; a fair number of programs still use this.

LF - ^J - 0x10 - The Unix standard since time immemorial or at least time_t 0. This is what formail is expecting.

What it sounds like is that the Netscape storage may have been using Mac EOLs (CR without LF).

[livejournal.com profile] seawasp: Did Mail's "File: Import Mailboxes" command not do the right thing?

Date: 2009-07-30 05:57 am (UTC)
ckd: small blue foam shark (Default)
From: [personal profile] ckd
(went back to original post: no, it didn't)

Hm.

I'd try replacing the ^Ms with ^Js, to see if that worked. Easy way:

perl -pe 's/\r/\n/g' < oldfile > newfile

Date: 2009-07-30 08:38 am (UTC)
ext_58972: Mad! (Default)
From: [identity profile] autopope.livejournal.com
Did Mail's "File: Import Mailboxes" command not do the right thing?

Suggestion?

1. Download Thunderbird.

2. Tell Thunderbird to import the Netscape mailbox.

3. Then tell Mail.app to import the resultant TBird mailbox. (Mail.app is happy to import TBird mailboxes; I'm assuming TBird gave earlier Netscape users a slick upgrade path.)

4. Remove TBird.
Edited Date: 2009-07-30 08:39 am (UTC)

Date: 2009-07-30 08:36 am (UTC)
ext_58972: Mad! (Default)
From: [identity profile] autopope.livejournal.com
Pointing vi at a 1.2Gb mbox file is a really bad idea.

Instead, use "less" as in "less filename". Less is a pager, used to display one terminal screenful of a file at a time (with backward scrolling, regexp searching, and so on).

Date: 2009-07-30 02:50 am (UTC)
From: [identity profile] m0rlock.livejournal.com
Your formail command is broken. formail doesn't take an input file as an argument - it operates on stdin. So what you probably want is something more like

formail -e -d -s < inboxfile >> newinboxfile

Which probably won't help, but at least it'll do something.

Date: 2009-07-30 11:57 am (UTC)
From: [identity profile] kpreid.livejournal.com
Suggestion: Take the top of the file (say as displayed in 'less', which will replace the ^Ms etc.), drop it in a text editor. blank out any personal information, and show it to us, who might then be able to recognize the format or the way it's mangled.

Date: 2009-07-30 03:12 pm (UTC)
From: [identity profile] ninjarat.livejournal.com
Yeah. I think we're at the point where we're not going to figure it out until we see the file. Something is broken and the guessing game isn't getting it unbroken.

Date: 2009-07-30 03:38 pm (UTC)
From: [identity profile] ninjarat.livejournal.com
Not if it isn't ASCII. That's the rub. Most text editors can't deal with non-text data, and how they deal with it varies. Anyway, there's always Emacs. It will read just about anything. Size might be a problem but content isn't. For a quick check with Emacs, "cat Inbox | head -1000 > tempfile" and then "emacs tempfile". (And for the record, I hate Lj's auto-formatting. It eats > and <.)

Date: 2009-07-30 04:08 pm (UTC)
From: [identity profile] ninjarat.livejournal.com
ASCII is 7-bit, codes 0-127.

That error confirms something: line ends are messed up. So do this instead: "dd if=Inbox of=tempfile bs=1024 count=1024". That will give you an exactly 1MB tempfile. Edit that with Emacs. That will work even if the file is totally mangled. It may not be pretty but it will work.

Date: 2009-07-30 04:08 pm (UTC)
From: [identity profile] kpreid.livejournal.com
You misunderstand:
Open the file with 'less' as you did before. Make your terminal window reasonably large. Select and copy from your terminal and show us the result.

September 2025

S M T W T F S
 123456
78910 111213
14151617181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 18th, 2025 03:34 am
Powered by Dreamwidth Studios