[Kde-pim] Mail loss on copy - the cause

Andras Mantia amantia at kde.org
Thu Sep 29 00:29:44 BST 2011


Hi,

 after a long night I *think* I found the problem for the often reported 
issue that the mail bodies are not copied.
To test do the following:
- create a new folder (I created a new mixedmail resource pointing to an 
empty folder)
- d&d a folder from another resource (e.g a maildir) into it
- watch how the created files are all 1 byte long

The only requirement is that you have NOT looked at the content of the mails 
from the source folder or you did it a long time ago, so Akonadi removed the 
payloads from the cache.

I think you can guess what is the problem. If an item's payload is not in 
the cache, the target resource does not get the payload. It gets an empty 
bytearray instead. Actually not even the server has the data when it 
performs the item copy in src/handler/copy.cpp.
This might sound weird as both copy.cpp and colcopy.cpp has a similar code 
before starting the copy operation:

  // retrieve all not yet cached items of the source
  ItemRetriever retriever( connection() );
  retriever.setCollection( source, true );
  retriever.setRetrieveFullPayload( true );
  retriever.exec();

Even more, this code actually works and gets the payload. But for some 
reason - and this is what I couldn't find - the payload arrives too late(?) 
or it is not visible for the copying code. 

If you copy the same source folder the second time, it does copy the 
content, the payload was loaded.

I admit I don't know how the ItemRetriever works, although I looked briefly 
in the code, I don't have a good overview about its working/locking 
mechanism. 

I hope others can confirm that this is what happens and Volker can come up 
with a fix asap. :)

Andras
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list