The imap resource (and kmail) ignore the two-step deletion process of imap (mark as deleted first, expunge later). While it is not a big issue for a single client, it can result in unexpected deletions with, if you e.g. rely on the two-step deletion in a mail application on your mobile (e.g. k-9) while Akonadi is running on a separate machine.
Akonadi could issue an EXPUNGE while you are marking mails as deleted on your mobile, permanently deleting the messages.
The imap resource should avoid using EXPUNGE automatically and offer an option to do it manually.
There is already an option in the config to auto-"compact" messages, but I'm not sure what it does. AFAIK EXPUNGE is used by default.
This bug has only been reported for versions older than KDEPIM 4.14 (at most akonadi-1.3). Can anyone tell if this bug still present?
If noone confirms this bug for a recent version of akonadi (part of KDE Applications 15.08 or later), it gets closed in about three months.
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.