Bug 316521

Summary: triggerExpunge called on mail folders, loosing many messages that need to be resynced
Product: [Applications] kmail2 Reporter: Torsten Grote <grote>
Component: miscAssignee: András Manţia <amantia>
Status: RESOLVED FIXED    
Severity: major CC: dvratil, lbeltrame
Priority: NOR    
Version: Git (master)   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:

Description Torsten Grote 2013-03-11 10:21:40 UTC
Around the time the code that should fix disconnected IMAP was pushed, I started to see a severe and nasty problem in kmail: Some folders with thousands of mails 'loose' the latest mails and need to resync them everytime I click on this folder.

Some people in IRC have the same problem. They said this might be due to mails with empty body that cause triggerExpunge being called.

I also see a lot of KIMAP::ExpungeJob::handleResponse: Unhandled response:  * 5721 EXISTS but I don't know i this is related.

Reproducible: Always

Steps to Reproduce:
1. Click on an affected folder and see how mail count drops and how new mails vanish
2. Wait for resync or select the folder again, to see news mails being fetched from server again
Comment 1 Luca Beltrame 2013-03-11 10:30:03 UTC
Observed this on openSUSE as well. Some other features of this bug:

1. Does not target the whole account, only specific folders
2. The IMAP resource specifically asks for deletion of the messages
3. It only occurs if you have messages with missing bodies in the resource, using disconnected mode: removing the messages with missing bodies makes the problem disappear
Comment 2 Torsten Grote 2013-04-09 08:21:17 UTC
There is a review request  now that should fix the problem: http://git.reviewboard.kde.org/r/109914/
Comment 3 Luca Beltrame 2013-04-09 08:29:32 UTC
In data martedì 09 aprile 2013 08:21:17, hai scritto:

> There is a review request  now that should fix the problem:
> http://git.reviewboard.kde.org/r/109914/

Works when applied to latest master.
Comment 4 Daniel Vrátil 2013-04-09 12:09:59 UTC
Git commit 21d70d539c4b9a33939e75c28f2b2536ebe985d2 by Dan Vrátil.
Committed on 09/04/2013 at 14:08.
Pushed by dvratil into branch 'master'.

Use itemsRetrievedIncremental() when fetching missing bodies

REVIEW: 109914

M  +15   -3    resources/imap/retrieveitemstask.cpp

http://commits.kde.org/kdepim-runtime/21d70d539c4b9a33939e75c28f2b2536ebe985d2