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

List:       kde-core-devel
Subject:    Corrupted kmail folders (was Re: magellan)
From:       Don Sanders <dsanders () cch ! com ! au>
Date:       1999-10-27 0:27:40
[Download RAW message or body]

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.

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.

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

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.

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.

BFN,
Don.

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

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