Bug 155910

Summary: mail folder management: old contents blocks changes (major; potential data loss)
Product: [Applications] kmail Reporter: Maciej Pilichowski <bluedzins>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: dominik.tritscher
Priority: NOR Keywords: triaged
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Maciej Pilichowski 2008-01-16 14:17:23 UTC
Version:            (using KDE 3.5.8)
Installed from:    SuSE RPMs

This bug is serious however if user won't panic it is possible to recover from KMail error.

Let's say we have A folder with B, C, D subfolder. We work for a while, KMail stores some data, like indices for those subfolders. Then we delete D.

Some time later we create _A folder with B and C, we move all from B and from C (to B and C in _A). Delete A, rename _A to A.

KMail restart and... B and C are gone. What happened? There was some date about D not deleted from A (on the disk) so A was deleted from KMail but not from disk. Since it was not deleted, rename _A -> A was possible but without B and C (they left in _A structure).

So there are several bugs here:
* KMail keeps some leftovers from deleted subfolders
* KMail does not check if rename is possible
* KMail does not warn about problems with rename
* KMail does not check the integrity of the data (on start at least)

Workaround:
* do not panic
* quit KMail
* find A directory in KMail (on disk)
* delete it
* rename _A directory (containing B and C) to A
* run KMail -- you should be able to see correct A folder with B and C subfolders
Comment 1 Jaime Torres 2009-04-04 10:43:39 UTC
Using kmail 1.11.90 (opensuse kde 4.2.68). I've followed your detailed steps, and those are my good results.
The four points:
* The folders keep their respective mail.
* kmail checks if rename is possible. (it shows a warning saying there is an existing folder with that name and does nothing).
* same as previous
* The folders have their respective mail.

So this looks fixed.
Comment 2 Dominik Tritscher 2009-04-11 13:09:13 UTC
I also tried to reproduce that bug by following the steps described in the initial report. Everything worked fine here, no data loss, everything is as it should be. So I'm closing this bug.