Bug 281552 - Copying messages to mbox copies only headers, no body or attachments
Summary: Copying messages to mbox copies only headers, no body or attachments
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.7
Platform: Gentoo Packages Linux
: NOR critical
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-07 14:37 UTC by subscryer
Modified: 2012-01-07 15:50 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description subscryer 2011-09-07 14:37:42 UTC
Version:           4.7 (using KDE 4.7.0) 
OS:                Linux

As per the summary, it's as simple as that. The mbox is small and doesn't really have anything inside except the headers. If I used move instead of copy I'd have lost my data.
Coupled with bug 276078 this one makes kmail2 prison of sorts, I'm utterly unable to my messages elsewhere.

Reproducible: Sometimes

Steps to Reproduce:
I tried this twice, once it did work as expected, the other time it didn't.
1) create an mbox resource (not read only)
2) copy some messages to the resource
3) delete the resource
4) open the mbox file with thunderbird (actually copied it verbatim in it's directory structure)
Comment 1 Laurent Montel 2011-09-07 15:20:51 UTC
I already see this bug. And it's critical !
We need to fix it.
Comment 2 subscryer 2011-09-08 08:14:17 UTC
I have to make a correction. Actually it's kmail that can't load the message bodies for some reason, even if they are ok in the maildir structure.
In this case I'm talking about old mail messages that were left in the "kmail folders" resource.
An important difference, however I'm still unable to export my mail in any way.
Comment 3 András Manţia 2011-09-23 07:13:36 UTC
Does it matter from where you copy the mail? (same mbox, different mbox, maildir, imap)
Comment 4 subscryer 2011-09-23 07:38:15 UTC
Not really.
Kmail seems to have forgotten the mail bodies for some folders, maildir or mbox doesn't matter.
I don't know the inner workings of kmail2 but my assumption is that akonadi failed in indexing them and its database is being used instead of the files.

For reasons only slightly related to this issue I have now switched to thunderbird on windows, if you need tests I'll do my best but I can't promise I will be able to perform them.
Comment 5 thomas gahr 2011-09-23 13:31:27 UTC
I can confirm this and it is really annoying and alarming - looking in .local/share/.local-mail.directory/  it seems the bodies of the mail are really lost, not just "not displayed" by kmail:

http://fpaste.org/touk/

...bummer

If it matters: this mail was moved from one maildir (pop3 account) to my local folders, also maildir. The moving was done by a filter.
Comment 6 thomas gahr 2011-09-28 13:11:40 UTC
I know "this bug is still around" messages and alike don't help anyone, but I noticed something that might help the devs reproduce this: for some reason I am seeing the "body is lost when moving email" behaviour excessively on the qt5-feedback mailinglist I subscribed to [1]. Just in case somebody is already trying to investigate this.

Maybe this is of interest: I created a simple "filter on mailinglist" filter that moves the messages into "Local Folders"->"green"->"MLs"->"Qt5 Feedback" - who knows, maybe the folder hierarchy matters...

I currently have a build of KDE's 4.7 branch stuff lying around along with kdepimlibs and kdepim, as soon as I get around to it I will setup a user and make kmail2 fetch qt5-feedback from there as well, my plan was trying to reproduce it in a reliable way and hook into KMCopyCommand, maybe modifying it to check for consistency of the moved Akonadi::Item[s]. Unless someone here tells me it's the wrong place to look at to find the cause of the problem, of course ;)
I'll keep you updated on whether this approach succeeds in prividing new info.


[1] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
Comment 7 András Manţia 2011-09-29 20:31:22 UTC
Git commit 9d1da9403d64f41baed701817fc44e6a54e3c6ad by Andras Mantia.
Committed on 29/09/2011 at 22:29.
Pushed by amantia into branch 'master'.

Temporary workaround for data loss on copy/move bugs.
BUG: 281552
BUG: 279722
FIXED-IN: 4.8

M  +6    -0    akonadi/pastehelper.cpp

http://commits.kde.org/kdepimlibs/9d1da9403d64f41baed701817fc44e6a54e3c6ad
Comment 8 András Manţia 2011-09-29 20:33:19 UTC
Git commit 5b7322266992bf4ddace45c47d711fd77da737dc by Andras Mantia.
Committed on 29/09/2011 at 22:33.
Pushed by amantia into branch 'KDE/4.7'.

Temporary workaround for data loss on copy/move bugs.
BUG: 281552
BUG: 279722
FIXED-IN: 4.7.2
(cherry picked from commit 9d1da9403d64f41baed701817fc44e6a54e3c6ad)

M  +6    -0    akonadi/pastehelper.cpp

http://commits.kde.org/kdepimlibs/5b7322266992bf4ddace45c47d711fd77da737dc
Comment 9 thomas gahr 2012-01-07 14:26:28 UTC
It looks like this bug shows up again in 4.8 rc2. Has the "temporary workaround" been reverted?
Comment 10 thomas gahr 2012-01-07 15:50:07 UTC
Arrgh... This seems to be another bug, not this one. The message just was displayed empty until five minutes ago.
I'll try to reproduce and file a new bug.
Sorry for the noise :)