Subject: Weird MBX parse error

From: Nick Hodulik <[email-masked]>
Date: Mon, 7 Jun 2004 00:03:54 -0700

We had a disk fill up this weekend and corrupt some mailboxes. I'm now 
getting a parse error. I have been successful at repairing mailboxes 
before, but this one is confounding, as the resulting error code is not 
covered in the FAQ and cannot be found in the file.

It is:

SELECT failed: unable to parse message date at 32230033: 8:39 -0800

Searching for any combination of any of these numbers in the file via 
emacs' ctrl-s comes up with nothing. What is the IMAP server trying to 
tell me?

And why, when it encounters a corrupt header, can't it just skip to the 
next one?

n

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Mon, 7 Jun 2004 00:37:06 -0700 (PDT)

On Mon, 7 Jun 2004, Nick Hodulik wrote:
> getting a parse error. I have been successful at repairing mailboxes before, 
> but this one is confounding, as the resulting error code is not covered in 
> the FAQ and cannot be found in the file.

That error message is covered in the FAQ:
 	http://www.washington.edu/imap/IMAP-FAQs/index.html#7.15

That FAQ answer also explains how you would go about fixing it.

If you've repaired mailboxes before, I'm a bit surprised that you are 
having trouble with this problem because the same strategy is used to 
repair this problem.

> Searching for any combination of any of these numbers in the file via emacs' 
> ctrl-s comes up with nothing.

As those numbers are data as opposed to numeric error codes, they wouldn't 
appear in any documentation file.  Try searching for the text "unable to 
parse message date" instead.

> What is the IMAP server trying to tell me?

At byte 32,230,033 in the file, it expected to find an mbx format internal 
date, which is in the form:
 	29-Feb-1984 01:23:45 -0800
but instead it found:
 	8:39 -0800

The text that it found looks like the last 10 characters of a date; so the 
first 16 characters of the date seem to be missing.  Are they really 
missing?  My guess is that the size count of the previous message is 16 
character too high, thus the previous message ate into the next message.

An examination of the file around byte 32,230,033 will tell for sure. 
The result of that examination will determine the best way to fix it.

Please read the FAQ answer in:
 	http://www.washington.edu/imap/IMAP-FAQs/index.html#7.15
and then ask again if you still have questions.

> And why, when it encounters a corrupt header, can't it just skip to the next 
> one?

There are two religions on how best to handle data corruption problems.

One is to make the problem go away automatically, even at the cost of 
discarding salvagable user data.

The other is to report what is wrong and demand that an expert fix it; and
above all else, *never* do anything that will cause loss of data.

I believe in the latter religion.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.