Deleting several thousand mails at once only deletes them in the local store and not on the IMAP server. If I try to delete 30000 mails at once they are only deleted locally but not on the IMAP server. It works with less then 100 just fine. The IMAP server is dovecot-2.2. In the log you see: S: A000016 BAD Error in IMAP command UID STORE: Too long argument. Reproducible: Always Steps to Reproduce: 1. Setup dovecot 2. Create a mailbox with several thousend mails 3. Try to delete those mails at once
Git commit 6b8101c42bf96c54499da7aea61f1b70904fc450 by Dan Vrátil. Committed on 03/10/2014 at 09:08. Pushed by dvratil into branch 'KDE/4.14'. [IMAP Resource] Remove RemoveItemsTask and use ChangeItemsFlagsTask instead Removing emails means appending the \Deleted flag, so RemoteItemsTask is just a simpler version of ChangeItemsFlagsTask with hardocded flag to append. To avoid code duplication and make use of flags-related fixes in ChangeItemsFlagsTask, we can just use that instead of RemoveItemsTask. REVIEW: 120447 M +0 -1 resources/imap/CMakeLists.txt M +2 -2 resources/imap/imapresourcebase.cpp D +0 -106 resources/imap/removeitemstask.cpp D +0 -46 resources/imap/removeitemstask.h M +0 -1 resources/imap/tests/CMakeLists.txt D +0 -105 resources/imap/tests/testremoveitemstask.cpp http://commits.kde.org/kdepim-runtime/6b8101c42bf96c54499da7aea61f1b70904fc450
Git commit 6cc5af5b150628a250e67b12ee1ee195a0d8859c by Dan Vrátil. Committed on 03/10/2014 at 09:13. Pushed by dvratil into branch 'KDE/4.14'. [IMAP Resource] Split large UID STORE commands to multiple smaller ones Although not specified in RFC, IMAP servers usually have some limit on maximal length of a command send by clients. This is best visible in case of ChangeItemsFlagsTask, which would create an insanely long STORE command when user marked as read thousands of emails at once. To prevent servers from rejecting our requests, we split large STORE requests to multiple smaller ones, each of 2000 UIDs at most. 2000 sounds like a good compromise between not hitting it too often (i.e. users usually mark as read few emails at once, hundreds at best) and not hitting the server-side limits (every server out there should handle 2000 UIDs in a request). This number can be tuned later of course if we find out it's too much/not enough. REVIEW: 120446 FIXED-IN: 4.14.2 M +23 -9 resources/imap/changeitemsflagstask.cpp M +3 -0 resources/imap/changeitemsflagstask.h http://commits.kde.org/kdepim-runtime/6cc5af5b150628a250e67b12ee1ee195a0d8859c