Summary: | deleting maildir does not delete associated .index.ids file | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | CSights <csights> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | b.j.fowler |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | proposed fix |
Description
CSights
2007-01-17 16:54:14 UTC
Hi again, It appears as though the .index.ids files are deleted when the folder is deleted, but then erroneously created again later in the delete process. I haven't figured out exactly what is going on, but it looks like "FolderStorage::remove" calls "KMMsgDict::removeFolderIds" which succeeds. Later (I'm not sure how or why) "FolderStorage::deregisterFromMessageDict" is called and that causes the .index.ids to be created again. Hopefully someone with more skills can figure the rest of this out! Thanks, C. --------------------------------------------------------------------------------- output of fileschanged --------------------------------------------------------------------------------- fileschanged -rp -s created,deleted kmail/ ( click on Local Folders ) ( New folder "messykmail" ) A /home/csights/.kde3.5/share/apps/kmail/mail/messykmail A /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index R /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.temp A /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index A /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids ( delete "messykmail" ) (.ids deleted >>>>>) R /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids R /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index R /home/csights/.kde3.5/share/apps/kmail/mail/messykmail/new R /home/csights/.kde3.5/share/apps/kmail/mail/messykmail/cur R /home/csights/.kde3.5/share/apps/kmail/mail/messykmail/tmp R /home/csights/.kde3.5/share/apps/kmail/mail/messykmail R /home/csights/.kde3.5/share/apps/kmail/mail/messykmail (.ids recreated >>>>>) A /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids --------------------------------------------------------------------------------- some crappy tracing of the functions --------------------------------------------------------------------------------- ( New folder "messykmail" ) kmail: WARNING: FolderStorage::writeFolderIdsFile kmail: WARNING: KMMsgDict::readFolderIds kmail: WARNING: KMMsgDict::isFolderIdsOutdated kmail: WARNING: KMMsgDict::readFolderIds - 1st return kmail: WARNING: FolderStorage::invalidateFolder kmail: WARNING: KMMsgDict::writeFolderIds kmail: WARNING: KMMsgDict::openFolderIds - top kmail: WARNING: KMMsgDict::openFolderIds - opened /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: KMMsgDict::openFolderIds - 2nd return (rentry) kmail: WARNING: KMMsgDict::writeFolderIds: truncate file /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: KMMsgDict::writeFolderIds - closing /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: KMMsgDict::writeFolderIds - 4th return ( delete "messykmail" ) kmail: WARNING: FolderStorage::remove() kmail: WARNING: KMMsgDict::touchFolderIds kmail: WARNING: KMMsgDict::openFolderIds - top kmail: WARNING: KMMsgDict::openFolderIds - opened /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: KMMsgDict::openFolderIds - 2nd return (rentry) kmail: WARNING: KMMsgDict::touchFolderIds - closing /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: KMMsgDict::removeFolderIds - unlinking /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: FolderStorage::remove() unlink .sorted kmail: WARNING: FolderStorage::remove() unlink folder kmail: WARNING: KMFolderMgr::removeFolderAux - aFolder -> fileName() messykmail kmail: WARNING: FolderStorage::deregisterFromMessageDict kmail: WARNING: FolderStorage::writeFolderIdsFile kmail: WARNING: KMMsgDict::writeFolderIds kmail: WARNING: KMMsgDict::openFolderIds - top kmail: WARNING: KMMsgDict::openFolderIds - opened /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: KMMsgDict::openFolderIds - 2nd return (rentry) kmail: WARNING: KMMsgDict::writeFolderIds: truncate file /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: KMMsgDict::writeFolderIds - closing /home/csights/.kde3.5/share/apps/kmail/mail/.messykmail.index.ids kmail: WARNING: KMMsgDict::writeFolderIds - 4th return kmail: WARNING: KMFolderMgr::removeFolderAux - parentName kmail: WARNING: Can not find parent folder -------------------------------------------------------------------- Hi! I think I've figured this bug out: The KMFolder destructor calls FolderStorage::deregisterFromMessageDict() and this causes the .index.ids file to be written to disk again after kmail originally deleted it. This can be avoided if "mExportsSernums = false;" after the .index.ids file is deleted in FolderStorage::remove(). This works because just before writing the .index.ids the code (FolderStorage::writeFolderIdsFile()) does not write the .index.ids file if mExportsSernums == false. folderstorage.cpp -------------------------------------------------------- void FolderStorage::remove() if ( mExportsSernums ) + { KMMsgDict::mutableInstance()->removeFolderIds( *this ); + mExportsSernums = false; // do not writeFolderIds after removal + } -------------------------------------------------------- BTW: I don't know what "int FolderStorage::expunge()" does, but because the logic is so similar to "FolderStorage::remove()" someone who knows what is going on might consider modifying it in a similar way. Thanks! C. CSights: The developers of KMail do not monitor the bug database very closly, so they did probably not yet see your patch. Please do the following to get you patch included: 1. Attach the diff output of folderstorage.cpp to this bug report as a patch so it can be found easily by the bugzilla search function 2. Write a mail to the kde-pim mailinglist or contact the developers at the #kontact IRC channel to get their attention I am myself not a developer, so I can not comment on the quality of your fix. Created attachment 19886 [details]
proposed fix
this patch was made from debian's kmail 1.9.5 ( 4:3.5.5.dfsg.1-6 )
SVN commit 639786 by winterz: fix "deleting maildir does not delete associated .index.ids file" Thanks for the patch CSights. BUG: 140195 M +3 -1 folderstorage.cpp --- branches/KDE/3.5/kdepim/kmail/folderstorage.cpp #639785:639786 @@ -723,8 +723,10 @@ clearIndex( true, mExportsSernums ); // delete and remove from dict if necessary close(true); - if ( mExportsSernums ) + if ( mExportsSernums ) { KMMsgDict::mutableInstance()->removeFolderIds( *this ); + mExportsSernums = false; // do not writeFolderIds after removal + } unlink(QFile::encodeName(indexLocation()) + ".sorted"); unlink(QFile::encodeName(indexLocation())); *** Bug 145885 has been marked as a duplicate of this bug. *** |