Bug 388151 - Moving messages to other folder corrupts threading
Summary: Moving messages to other folder corrupts threading
Alias: None
Product: kmail2
Classification: Applications
Component: commands and actions (show other bugs)
Version: 5.12.2
Platform: Debian unstable Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
Depends on:
Reported: 2017-12-22 14:58 UTC by Alex Hermann
Modified: 2021-08-28 07:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Alex Hermann 2017-12-22 14:58:33 UTC
When using threading strategy "Perfect and by references", moved messages are threaded randomly in the tree under the thread starter. In the same folder, the direct parent (from In-Reply-To) is also present, but the message not threaded under it.

The resulting folder structure is a complete mess. Restarting kmail and/or akonadi doesn't help.

Changing to threading startegy "Perfect only" shows the correct tree, but obviously creates separate trees when a message is missing. Switching back to "Perfect and by references" seems to fix the threading.

I have not noticed any problems with threading of new incoming emails, only when moving messages between folders. The messages are moved within the same account, which uses online imap as its backend.

The message list aggregation is set to "Threaded" with the following config:

Grouping: none
Group expand policy: -
Threading: perfect and by references
Thread leader: Topmost message
Thread expand policy: Expand threads with unread or important messages

Fill view strategy: Favor interactivity
Comment 1 Alex Hermann 2020-10-27 07:55:31 UTC
It is not just threading that breaks. Kmail messes up the whole relation between headers and bodies of emails. In other words, message 1 gets the headers from message 2 and so on. This leads to wrong threading, but also to replying to the wrong message or even deleting them, making this a data-loss bug.


1. Select multiple messages in a folder (preferably with different subject, thus from different threads, as it will show the bug more easily).
2. Move those messages to another folder
3. Notice that in the target folder, headers and bodies of the moved emails don't match with each other.

This can be fixed (until the next move) by clearing the cache for the target folder in akonadiconsole.

Is there anything I can do/provide to get some movement on this bug?