[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Corrupted kmail folders (was Re: magellan)
From:       Lars Knoll <Lars.Knoll () mpi-hd ! mpg ! de>
Date:       1999-10-27 8:54:39
[Download RAW message or body]

On Wed, 27 Oct 1999, Don Sanders wrote:

> On Wed, 27 Oct 1999, Lars Knoll wrote:
> > On Wed, 27 Oct 1999, Sven Radej wrote:
> > > Which kmail version was that? If around 1.0.28 (KDE-1.1.2), did you use "Compact
> > > mailboxes on exit"? 
> > 
> > Some version just before 1.1.2, compiled on Digital Unix. I don't use
> > compact folders on exit, and it looks like kmail didn't like one mime
> > attachment I got. The mailbox was truncated in the middle of it, all mails
> > after it got lost. And I think, I had enough free disk space.
> 
> I am interested in knowing what you (or really what kmail) was doing before/at
> the time of the mailbox truncation.
> 
> The thing is AFAIK kmail really doesn't mess with mail folders much at all. I
> mean only the following operations affect mail folders. (By mail folder I mean a
> file in you ~/Mail directory whose name doesn not begin with a ".").
> 
> 1) Creating/Deleting a folder
> 2) Appending new mail to the end of a folder
> 3) Compacting a folder
> 4) Emptying a folder.
> 5) The trash folder might be a special case.
> 
> Operations like reading, deleting mail don't modify a mail folder file.
> Operations like moving/copy mail don't modify the source mail folder file.

That's why I was so surprised, it scrweded up my mail box.

> These operations however do affect the KMail index files (the .*.index files) in
> the ~/Mail directory. If an index file gets corrupted (and this does seem to
> happen) then it will look as if the Mail folder has been trashed as the view
> of header messages in KMail will get messed up. (Showing null for the title of
> fields bizarre dates and stuff like that). If a single entry in the index file
> gets messed up it can and frequently does corrupt the entire index file.

I know that. So the first thing I did was leave kmail, delete the index
file and restart it, because I thought the index file must have become
corrupted. But it didn't really help. The messages with null for the title
field were gone, but unfortunately also the last 10-15 mails in my
inbox. Fortunately I had already answered most of them. The inbox was
truncated in the middle of a long attachment, but that could also be by
chance.

> But this doesn't corrupt the real mail folder file.

Sorry, but it did. 

> So I suggest trying the following. Grep the inbox file in your ~/Mail directory
> is the mail still there? If not the I don't know how it got deleted if you
> didn't compact/delete/empty the folder.
> 
> If the lost mail is there then you can perform a binary search in order to find
> the troublesome mail file that is causing kmail to produce an invalid .index
> file. Open up the inbox file in a text editor save the first half of the
> messages to one folder "folderA" and the other half to another folder
> "folderB" (make sure you divide the folder at a message boundary not in the
> middle of a message). Read all the messages in folderA and do the same for
> folderB (this causes the inex file to be updated). Does the list of message
> headers contain bad entries for one of the folders? If so repeat the process
> dividing the Mail folder up into two halves, until you find the guilty mail.

I don't think that was the problem. I could read the mails at first, then
I read all my other mails, and came back to the folder, which was
corrupted at that time then. 

Could it have some relation with the fact that I was gone for a few days
and downloaded something like 1300 mails at once? Another problem could be
the quota I have on this partition (although I checked afterwards, and I
think this wasn't the problem). Anyway it downloaded all mails correctly,
and as you said, then it shouldn't have changed the mailboxes anymore.

> If you do find a troublesome mail then depending on whether it's sensitive you
> can forward it to me and I'll fix the problem.
> 
> Sorry if you already know all of this, but even if that's the case other people
> are welcome to follow this procedure to help debug kmail if there list of
> messages headers is corrupted.

I knew/guessed part of it, but after your explanation I'm even more
puzzled, why the folder got corrupted.

Cheers,
Lars (using pine again for the moment :)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic