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 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).
Page generated Sep. 18th, 2025 12:35 pm
Powered by Dreamwidth Studios