Bug 186932

Summary: draft email lost after suspend to disk
Product: [Unmaintained] kmail Reporter: Xavier Brochard <xavier>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: bluedzins, jtamate
Priority: NOR    
Version: 1.11.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Xavier Brochard 2009-03-12 10:05:27 UTC
Version:           1.11.1 (using 4.2.1 (KDE 4.2.1), Debian packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.26-1-amd64

Reopening my laptop after suspend to disk, an email opened in background has disappear. This email was previously in the draft folder.
I was expecting to find it opened or at least to find a copy in the draft folder (even an old version).

Fortunatly I've found a copy in kmail/autosave folder.

Step I followed:
---------------------
Two days ago, I worked on a draft email, I saved it as a draft before closing kmail and closing my computer.
Yesterday, I continued the work on that email. I used suspend to disk (through powerdevil) to close the computer. The draft email was still open.
This morning, the email has disappear: it is not in draft, nor open in background.
Comment 1 Jaime Torres 2009-03-14 22:36:08 UTC
*** Bug 187138 has been marked as a duplicate of this bug. ***
Comment 2 Jaime Torres 2009-03-14 22:38:40 UTC
The working draft should not disappear until it is replaced by a new copy or the mail is queued to send or sent.
Comment 3 Maciej Pilichowski 2009-03-14 23:37:57 UTC
Jaime, you mean it should not disappear from folder -- it is deleted right away, it has been that way since KDE3.

The same applies not only to drafts but to any editing (outbox for example).
Comment 4 Jaime Torres 2009-03-14 23:51:01 UTC
I guess in that way we get:
* The draft is not lost in a power failure.
* It should check if the message is being editted when trying to edit again the same draft to not allow a duplicated message (or create duplicated messages with different IDs?)
* The composing message can be saved (manually or at intervals) replacing the existing draft.
Comment 5 Maciej Pilichowski 2009-03-15 09:00:29 UTC
a) it is the aim, not the current state

b) it could be done similar how yast works -- store the composer process id when editing, then check if such process exists, if yes -- the mail is still edited, if not -- it means composer crashed, you can edit the mail, if there is no value -- it means the mail was/is not edited

c.1) intervals -- yes, this is of course always useful, but please note, it should be auto-backup not auto-save (it is common misconception which can lead to data loss)

c.2) manual save -- yes, yes, yes :-) 

ad.c) of course with such feature (any of them) the edited mail cannot be deleted/moved on edit.
Comment 6 Laurent Montel 2015-04-12 10:09:06 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.