Bug 327979

Summary: The body of some emails is missing
Product: [Frameworks and Libraries] Akonadi Reporter: Éric Brunet <eric.brunet>
Component: IMAP resourceAssignee: Christian Mollekopf <chrigi_1>
Severity: normal CC: dvratil, kdepim-bugs, mollekopf, tuju, vkrause
Priority: NOR    
Version: 1.10.3   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Éric Brunet 2013-11-23 16:07:56 UTC
I have set up an imap account with "disconnected mode" enabled and configure to always fetch the whole messages.

In one folder, I have two messages where the body is missing.
* I have checked with another imap client that the messages do have a body on the server
* I have tried to look at the source of the message in kmail, there are all the headers (The first line missing is "This is a multi-part message in MIME format')
* I have tried to look at the messages in akonadiconsole: no difference
* I have tried to fetch all the mails, to quit and restart kmail, to quit kmail, quit akonadi, restart akonadi, restart kmail, and to reboot the computer, nothing changes: the messages are not complete.

Apart from this, things are working nicely.

Note that around the time the messages where received, my laptop died because it ran out of battery. It is possible that it died at the time akonadi was fetching the mails.

So, of course akonadi should be able to maintain the collection in sync even in the case of a power failure at a critical time, but this is a hard problem and, hey, bugs exist. What I would really like to do is a button or a menu entry in kmail which forces akonadi to refetch a given message from the server, or to refetch a given folder from the server, or to refetch all the messages posterior to a given date. I have tried to look for such an option in kmail and in akonadiconsole, and couldn't find any. It looks as if the only way to force a refetch is to erase completely the database, and this is quite brutal...

Reproducible: Couldn't Reproduce

akonadi is configured to use the internal MySQL server.

There is an actual bug report, which will be difficult to fix as I cannot reproduce it, and a wishlist.
Comment 1 Daniel Vrátil 2013-11-25 13:47:02 UTC
"Fetch all emails" in KMail only does incremental fetch, it won't fetch mails that are already in Akonadi.

Quit KMail, open Akonadi Console, got to Browser tab, right-click the folder in which the emails are and click 'Clear Akonadi Cache'. This will delete the folder from Akonadi (but not from the server!). Then start KMail and click "Fetch all emails" . This will refetch the folder from scratch.

I should probably add a button to purge single item from Akonadi Console, writing SQL queries is PITA :-)
Comment 2 Éric Brunet 2013-11-25 17:12:19 UTC
> right-click the folder in which the emails are and click 'Clear Akonadi Cache'

Ah, yes, thank-you. I looked for a button, I looked for an entry in the menus, I looked in the contextual menu of the item, and I didn't look in the contextual menu of the folder....

Everything is now in order, thanks.
Comment 3 Christian Mollekopf 2013-12-11 09:10:57 UTC
From 4.12 I think we even have a body checker that checks that all bodies are available everytime a folder is synced.
Comment 4 Juha Tuomala 2018-12-09 19:33:35 UTC
Has anyone considered reopening this one? Constant problem. Why there can't be "reload" or something that would re-download given folder/message?
Comment 5 Juha Tuomala 2018-12-09 19:45:26 UTC
Well, running: 
   akonadictl fsck 

fixed it. Great.