Bug 309486

Summary: Checksum SHA for IMAP mail, detect broken message body and redownload from server
Product: [Applications] kmail2 Reporter: Mark <markotahal>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: wishlist CC: chaofeng111
Priority: NOR    
Version: 4.9.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Mark 2012-11-03 16:38:02 UTC
This is a feature request for the old bug of accidentally missing (IMAP) email bodies. 
This is similar to bug https://bugs.kde.org/show_bug.cgi?id=302337 but mine just occured on 4.9.2 (gmail).
Related:
http://forums.opensuse.org/english/get-technical-help-here/applications/474124-kmail-4-8-2-340-1-x86_64-eating-my-message-bodies.html
https://bugs.kde.org/show_bug.cgi?id=298962

This is even mentioned here: 
http://userbase.kde.org/KMail/FAQs_Hints_and_Tips#You_have_empty_.27ghost-mails.27_in_your_inbox_.28or_other_folder.29
but the solution to 'Rebuild index' is not available anymore. 

My proposal: 
a) implement again the "rebuild index"
b) SHA checksums - when downloading email, store message ID together with the hash of whole mail in some file. 
Offer a "redownload broken" tool, that goes through all messages in given folder, makes their hash, and if it does not match with the stored original hash, redownload the message (messageID) from server again (for IMAP; it doesnt have to be possible always, but for many cases-gmail-is.)

This could be a commandline tool, or a button in Kmail settings/folder menu. 

The workaround for me is quite painful: delete whole .kmail folder, set-up accounts again and download _all_ emails from servers again. 
// maybe sometimes the ghost emails are "ok" again after restart, I'm not sure if/how this happens.

Thank you for considering, mark