Bug 102063

Summary: KMail does not save messages as read on session exit
Product: [Applications] kmail Reporter: Dominik Karall <dominik.karall>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: bjoern, m.kohn
Priority: NOR    
Version: 1.8   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Screenshot of an unreadable message
Screenshot of a readable copy of an unreadable message
inbox contents

Description Dominik Karall 2005-03-21 10:40:36 UTC
Version:           1.8 (using KDE KDE 3.4.0)
Installed from:    Gentoo Packages

I'm running kmail in kontact, while kmail is minized to systray.
As I don't want to restart kmail everytime I reboot, I exit the kde session without closing kmail/kontact before. When I start kde again, kmail starts up, but shows me unread messages which have been already read.
When I want to select this messages, to read them again, following happens:
I select the folder where the messages are located (folder unread:20 msg, systray unread:20 msg)
After selecting the folder (folder unread:0 msg, systray unread:19 msg)
And there is no more message to select in the folder which is unread!

I think, that kmail may exit in the wrong way, or even crash on exit and so the last incoming messages are not marked as read on next startup.
Comment 1 Thomas McGuire 2007-03-19 15:24:53 UTC
Seems like the same thing as bug #44396. In both cases, the folder list displays the wrong number of unread messages after unclean shutdown of KMail.
Comment 2 Vadym Krevs 2008-03-30 21:47:50 UTC
Created attachment 24128 [details]
Screenshot of an unreadable message
Comment 3 Vadym Krevs 2008-03-30 21:48:21 UTC
Created attachment 24129 [details]
Screenshot of a readable copy of an unreadable message
Comment 4 Vadym Krevs 2008-03-30 21:48:45 UTC
Created attachment 24130 [details]
inbox contents
Comment 5 Vadym Krevs 2008-03-30 21:50:39 UTC
The previous 3 attachments are for this message:

I use Kontact/Kmail exactly as described above, and I've got a similar issue on openSUSE 10.3 for x86_64 using the latest KDE 3.5.9 packages from the KDE:KDE3 repository as of today:

$ rpm -q kdebase3 kdelibs3 kdepim3
kdebase3-3.5.9-69.3
kdelibs3-3.5.9-53.4
kdepim3-3.5.9-20.3

I rearely exit Kontact explicitly via File->Exit. Normally, I use suspend to RAM and occasionally log off from the current KDE session. Sometimes, when KOntact/Kmail are restarted/resumed afterwards, the last new message that had arrived before the log off/suspend to RAM is marked as unread in the inbox (even though I had read it), and moreover selecting this message has no effect - it's contents are never shown anymore, and the message effectively becomes "dead" - you cannot delete it, you cannot move it to another folder. The only thing that works is to make a copy of the message, exit Kontact/Kmail via "File->Exit", then go into .kde/share/apps/kmail/mail/inbox/cur, find the file corresponding to the "dead" message, delete it, and then restart Kontact/Kmail. Until the next time.

I'm attaching two screenshots - one with such a "dead" message selected, one with a copy of a "dead" message selected, and also a compressed tarball with the contents of .kde/share/apps/kmail/mail/inbox/cur and .inbox.index.* files.


Comment 6 Vadym Krevs 2008-03-30 21:52:19 UTC
Note that in this case Kontact/KMail does not crash, so it is not like an "unclean" shutdown scenario discussed in Bug #44396.
Comment 7 Vadym Krevs 2008-03-30 21:53:09 UTC
Final note, this is happening quite frequently - pretty much once a week.
Comment 8 Björn Ruberg 2009-12-07 18:28:18 UTC
Confirmed. I still can reproduce this in 4.3.4
Comment 9 Björn Ruberg 2009-12-07 18:29:52 UTC
*** Bug 216681 has been marked as a duplicate of this bug. ***
Comment 10 Laurent Montel 2015-04-12 10:23:43 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.