I use KMail and it, like many other popular email clients, sorts messages into threads. It does this based on reference information embedded in the (usually hidden) headers of each message. Of course, sometimes those headers are off. Most commonly this happens because a sender uses a reply-to-all function to send a new message to an existing list of addresses—this new message has a completely different subject from the original (to which it's ostensibly replying), but the sorting at the receiver's email client still considers it part of the old thread because reply-to-all functions add headers referencing the original message, as well as others in the original thread.
Fortunately, KMail has the ability to remove those headers through manually applied filters. The bonus is that, once you do this, the corrected threading will propagate to other email clients—I use K-9 Mail (not related to KMail) on my phone, for example.
First, there are two email headers that are relevant, each serving a different purpose: In-Reply-To, which links to the previous email that the present one is a direct reply to, and References, which lists several emails that are considered part of the thread (according to reply-to-all). For a single arriving email that starts the new topic, removing both these headers is necessary to break the thread. However, a follow-up email on that new topic may well have the old thread's emails listed in its References (presumably because the sender didn't correct the headers of the first email). Thus, two filters are needed to do this right: one to remove References, which can be applied to the first and all subsequent emails on a new topic (ensuring they all live in a distinct thread, never associating with the prior thread), and one to remove In-Reply-To, which is applied only to the first email on a new topic. We don't want to apply that last one to the subsequent emails, or there will be no way to associate them to any thread at all!
Here's how to set these up in KMail:
- Open the Settings menu and select Configure Filters...
- Make a new filter: click the New button below the Available Filters list. Select it from the list, press the Rename button, and call the new filter “Remove References”.
- In the General tab, under Filter Criteria, ensure the filter is set to “Match all messages”.
- In the pull-down under Filter Actions, select Remove Header, and in the text box beside it, type “References”.
- We want to ensure that this filter is not triggered automatically, but must be explicitly invoked. Click the Advanced tab. Uncheck “Apply this filter to incoming messages”, “Apply this filter on manual filtering”, and “If this filter matches, stop processing here”. Check “Add this filter to the Apply Filter menu”.
- If you like, click the icon button to select an icon to use for this filter in the menu. I personally like “object-ungroup” from the Actions list (System icons).
- Create another filter and call it “Remove In-Reply-To”.
- In the General tab, make the filter to “Match all messages”, and set its action to Remove Header for “In-Reply-To”.
- In the Advanced tab, uncheck the checked setting as before, and check “Add this filter to the Apply Filter menu”.
- Select an icon (if you like). I use “node-break”.
- Click OK.
Now whenever you find yourself with an email that shouldn't be part of the thread it has appeared in, you can apply these filters to that message: right click the email and navigate to the Apply Filter submenu, or select the email and find it in the Message menu. If it's the first email on the new topic, apply both the Remove References and Remove In-Reply-To. If it's a subsequent email, apply just Remove References.
Comment to add? Send me a message: <email@example.com>