Bug 243252 - autosaved messages deleted before saved again, getting lost forever
Summary: autosaved messages deleted before saved again, getting lost forever
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 15:01 UTC by kavol
Modified: 2015-04-12 09:59 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kavol 2010-06-30 15:01:57 UTC
Version:           unspecified (using KDE 4.4.4) 
OS:                Linux

If I start writing an email, and kmail gets terminated for some reason, on subsequent kmail start the unfinished message is not restored in a composer window. This has worked up to KDE 4.3

Note: this is NOT a duplicate of bug #230466 - I can't find the unfinished messages in ~/.kde4/share/apps/kmail/autosave/ and subdirs, unlike comments #3 to #5 to bug #230466 say.

Reproducible: Always
Comment 1 Denis Prost 2010-07-10 09:08:06 UTC
I met the same problem. I found the message I was writing  when kmail got terminated in .kde/share/apps/kmail/autosave folder, but it was not automatically reopen on kmail start.
Comment 2 Nancy Anthracite 2010-07-10 18:36:33 UTC
I am having the same problem, and THANK YOU for pointing out the autosave directory.  That is a big help as now I have a chance at retrieving my work that I forgot to save in the drafts folder.  My recent mail is in .kde/share/apps/kmail/autosave/cur  but does not come up on restarting Kontact ever any more.
Comment 3 kavol 2010-07-14 13:05:45 UTC
Denis, Nancy - if you can find the message within the autosave directory then please take a look at the bug #230466, I think that one is your case

meanwhile, after some experimenting ... the initial bug description is not correct, and also the subject - what really happens to me and how to reproduce:

1. start kmail
2. set some autosave time like e.g. 5 minutes
3. create a new message, write some text into it
4. wait until the message gets saved, check the ~/.kde4/share/apps/kmail/autosave/cur directory
5. kill kmail
6. check ~/.kde4/share/apps/kmail/autosave/cur directory - the autosaved message is still there
6. start kmail
7. the new message may or may not appear in the editor, depending whether you hit bug #230466

if the message does not appear in the editor:
8. the chance is that you can find the autosaved message in the ~/.kde4/share/apps/kmail/autosave/cur directory

if the message appears in the editor:
8. the autosaved message disappears from the ~/.kde4/share/apps/kmail/autosave/cur directory
9. kill kmail before the autosave timeout is reached
10. boom, you've just lost all your work, the message is not stored anywhere

eventually, you can hit bug #230466 in the way that the message is not opened in the editor AND the message gets deleted anyways

what needs to be changed - the message should not be deleted from the autosave directory before a new copy is saved, otherwise the crash/network disconnect/power failure/whatever can hit the time frame when there is no copy of the message stored on a harddisk

I'd also suggest autosaving immediately after the new message creation and not waiting for the timeout at first - imagine a case of a reply quoting the previous email on an imap server which may get deleted meanwhile and if you cannot restore the reply, you've lost the quoted text forever

below there is a part of kmail console log regarding autosaves - what is interesting, there is no mention of the message '1279102908.4061.ZHE4K' (my testing message) being deleted but kmail tries to delete '1279103354.7912.S3zV1' which did not exist anytime during my experiments (rather than listing the ~/.kde4/share/apps/kmail/autosave/cur directory, I've used 'find' to list everything under ~/.kde4/share/apps/kmail/autosave)

(oh, and why the autosave index gets created twice?)


kmail(7912) KMFolderMaildir::createIndexFromContents: Creating index for "/home/kavol/.kde4/share/apps/kmail/autosave"
kmail(7912) KMFolderMaildir::createIndexFromContents: Creating index for "/home/kavol/.kde4/share/apps/kmail/autosave"
kmail(7912) KMFolderMaildir::getDwString: KDE_fopen(abs_file= "/home/kavol/.kde4/share/apps/kmail/autosave/cur/1279102908.4061.ZHE4K" , "r") == stream ==  0x2fd31e0
kmail(7912) KMFolderMaildir::getDwString: fclose(mIndexStream =  0x2fd31e0 )
kmail(7912): No language dictionaries for the language :  "cs" 

kmail(7912) Sonnet::DictionaryComboBox::reloadCombo: Populate combo: "Český" : "cs"
kmail(7912) Sonnet::DictionaryComboBox::reloadCombo: Populate combo: "Český (Česká republika)" : "cs_CZ"
kmail(7912) KMComposeWin::slotUpdateFont:
kmail(7912) KMComposeWin::readConfig: "kavol@hajnet.cz"
kmail(7912) KMComposeWin::slotUpdateFont:
kmail(7912) KMComposeWin::rethinkFields:
kmail(7912) KMComposeWin::initAutoSave:
kmail(7912) loadPlugins: BodyPartFormatterFactory: found 4  plugins.
kmail(7912) insertBodyPartFormatter: BodyPartFormatterFactory: overwriting previously registered formatter for " application / octet-stream "
kmail(7912) insertBodyPartFormatter: BodyPartFormatterFactory: instantiating new Subtype Registry for " text "
kmail(7912) <unnamed>::UrlHandler::UrlHandler: UrlHandler() (iCalendar)
kmail(7912) KMFolderMaildir::removeFile: Can't delete "/home/kavol/.kde4/share/apps/kmail/autosave/new/1279103354.7912.S3zV1" "Adresář nebo soubor neexistuje"
kmail(7912) KMailApplication::newInstance:
kmail(7912) KMKernel::openReader:
QObject::connect: Cannot queue arguments of type 'KParts::WindowArgs'
(Make sure 'KParts::WindowArgs' is registered using qRegisterMetaType().)
kmail(7912)/kdepimlibs (kpgp) Kpgp::Module::checkForPGP: Kpgp: gpg found
kmail(7912) KMFolderMaildir::reallyDoClose: fclose(mIndexStream =  0x35b09d0 )
Comment 4 Jaroslav Reznik 2010-07-14 14:26:49 UTC
I can confirm this odd behaviour.
Comment 5 Laurent Montel 2015-04-12 09:59:09 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.