Bug 501754

Summary: Kmail ignores server errors when moving messages and goes out of sync with the IMAP server
Product: [Applications] kmail2 Reporter: James Lyne <jim+kde>
Component: generalAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 6.3.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description James Lyne 2025-03-19 17:04:41 UTC
SUMMARY
If a move operation is rejected by the IMAP server, kmail seems to ignore the error and updates the local cache, causing it to go out of sync with the server.

In my situation, I was attempting to move 6000 emails from my inbox to another folder. According to akonadi console my IMAP server rejected this with "A000544 BAD parse error: maximum request size exceeded", however kmail still proceeded with the move and made it appear successful. When I later refreshed my inbox, kmail performed an extremely long full sync of the folder (with akonadi console warning of a "detected inconsistency in local cache") which restored the previously moved messages. A second copy of the messages still exists locally in the folder I attempted to move them to, which kmail does not sync to the server even when the folder is manually refreshed.

STEPS TO REPRODUCE
1. Attempt a move operation which the IMAP server rejects (e.g move thousands of messages to another folder)
2. Observe kmail completing the move without errors
3. Refresh the source folder

OBSERVED RESULT
Kmail ignores the server error and goes out of sync with the server, making the move appear successful until the source folder is refreshed. Once the refresh completes, duplicate emails from the move remain in the destination folder.

EXPECTED RESULT
Kmail aborts a move if it fails on the server side, ideally with a message explaining what happened.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.13.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 7900X 12-Core Processor
Memory: 30.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
My email provider is Hushmail