This bug has been around for a while, and as far as I can see it keeps coming back.
I’ve found a workaround that fixes the cause that makes Akonadi (and in turn Kmail) throw this error and stop syncing the emails.
I use Gmail and that’s the only thing I’ve tested it with, I have no idea if it works with other providers, actually I don’t know if you (still) have this problem with other providers.
So here it goes: the error is usually thrown when you move messages around folders, what I’ve seen is after I move my sent messages from the Sent folder to the folder with the discussion.
I’ve solved this by going to the web interface of Gmail, creating a new label (called temp) and moving all the messages* from the folder that throws the error to the new temp folder (or label, call them what ever you want).
After this, go to KMail, and sync. Make sure both the original folder and the temp folder get synced, and that you see all your messages in the temp folder and no messages in the original folder.
When this is done, go to GMail (web interface) again and move all the messages back in the original folder. Let Kmail sync again. Check all messages are moved. When this is done, you can delete the temp folder. I deleted it from GMail.
This has solved my issue every time this error has been thrown.
I’ve tested this with KMail version 5.0.2 and Akonadi version 5.0.51.
P.S. This error might also be thrown but no notification is shown. The symptom is getting stuck while syncing a folder, and then this blocks the sync of anything else.
P.P.S. You might have to restart Kmail and Akonadi in between these steps if the sync happens but no changes are visible in KMail.
- A „select all messages in label” option appears after you select all visible messages