Bug 232962

Summary: Stale dimap folders confuse kmail after forcing resync of imap cache
Product: [Applications] kmail Reporter: Dennis Schridde <dschridde+kde>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: bjoern, djander
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: backtrace after SIGINT while message boxes are displayed
console log

Description Dennis Schridde 2010-04-01 14:47:12 UTC
Version:            (using KDE 4.4.1)
Compiler:          gcc 4.4.3 Gentoo 4.4.3 p1.0
OS:                Linux
Installed from:    Gentoo Packages

I recently forced a resync of my imap cache, which made a problem appear:
Upon startup, and when pressing OK or Accept in the configuration dialogue, KMail presents me 10 windows with following content:
"Error when opening /home/$USER/.kde4/share/apps/kmail/dimap/1668694697. This folder does not exist." [Translated]

A console log and a backtrace of that state is attached.

Examining the apps/kmail/dimap folder showed several .NUMBER.directory folders with no accompanying NUMBER folder.
Appart from several .SOMETHING.uidcache files, they contain only some .SOMETHING.directory folders:
.kde4/share/apps/kmail/dimap/.130708501.directory
.kde4/share/apps/kmail/dimap/.130708501.directory/.INBOX.directory
.kde4/share/apps/kmail/dimap/.1402182378.directory
.kde4/share/apps/kmail/dimap/.1402182378.directory/.somenamespace.directory
.kde4/share/apps/kmail/dimap/.1587347013.directory
.kde4/share/apps/kmail/dimap/.1668694697.directory
.kde4/share/apps/kmail/dimap/.1785330918.directory
.kde4/share/apps/kmail/dimap/.1785330918.directory/.somefolder.directory
.kde4/share/apps/kmail/dimap/.1991805192.directory
.kde4/share/apps/kmail/dimap/.1991805192.directory/.INBOX.directory

My theory is that I am seeing three different issues:
1) When deleting some IMAP accounts KMail "forgot" to delete all folders.
2) When resyncing imap caches, instead of ignoring or deleting the stale folders, KMail started messing with them, probably trying to recreate the uid caches.
3) The error handling during recreation of the uid caches is not verbose enough and displays just a default and uninformative error message.

This bug shows similarities with problem 1 in bug #209208.
Comment 1 Dennis Schridde 2010-04-01 14:49:32 UTC
Created attachment 42422 [details]
backtrace after SIGINT while message boxes are displayed
Comment 2 Dennis Schridde 2010-04-01 14:49:56 UTC
Created attachment 42423 [details]
console log
Comment 3 Dennis Schridde 2010-04-01 14:50:39 UTC
I deleted the stale folders inside the dimap dir I mentioned above. The error messages are now gone.
Comment 4 Dennis Schridde 2010-04-01 14:54:31 UTC
P.S: I recognize these folders (somenamespace and somefolder) as parts of imap accounts I had setup earlier.
Comment 5 Björn Ruberg 2010-04-02 11:59:25 UTC
Problem 1 in bug #209208 is yours. As this report is much more clean about this I mark 209208 as a duplicate.
Comment 6 Björn Ruberg 2010-04-02 11:59:31 UTC
*** Bug 209208 has been marked as a duplicate of this bug. ***
Comment 7 Dennis Schridde 2010-04-02 12:25:23 UTC
My statement "KMail presents me 10 windows with following content" above is inaccurate. Of course the actual folder varies, and the 10 windows each mention a different of the 10 folders.
Comment 8 Laurent Montel 2015-04-12 10:14:13 UTC
Thank you for taking the time to file a bug report.

KMail2 was released in 2011, and the entire code base went through significant changes. We are currently in the process of porting to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2.

We welcome you to try out KMail 2 with the KDE 4.14 release and give your feedback.