Why did KMail regenerate the index of a folder?
KMail regenerates the index of a folder whenever the index appears to be out of date, i.e. whenever the contents of a folder are newer than the index. KMail regenerates the index in this case in order to prevent the loss or corruption of messages. Unfortunately, currently-deleted messages might reappear and message flags (like important, etc.) might be lost when the index is regenerated.