Okay, I’ve fixed the problem but it was a bit of a pain in the ring.
There seems to be an issue with the ‘Envelope’ files inside V2 in the Mail folder.
After reading the contents of this file, there seems to be associative records kept by mail to make decisions on linking threads. However, simply removing these files, or replacing them with backups would not fix the problem for me. There must be system backups or linked files stored elsewhere. Actually, replacing these files made my situation much worse. Instead of a thread with 200 emails I had one with over 500!!
So, here is what i did to fix the issue. (using it for a few weeks now without any threading problems)
First, deleted all ‘Group emails’ from my sent box. I found that most of my issues with wrong threading related to addresses I had used in group emails. ie, sending an email with the same subject to several recipients in my contacts from multiple companies.
Then reset mail to factory settings as detailed below. Job Done!
Takes a few hours to download all of the emails from imap or exchange servers, but after that, everything is back to normal.
Before doing any of the following BACKUP your mail!!!!! Either using TimeMachine or manually, as this will reset your Mail to Factory Settings!!!!
Quit Mail, then in the Finder menu press ‘Go’ then type ‘~/Library’
This will take you to your Library folder inside your User folder.
Move the following items from the folder that opens to the Trash (some may not exist).
- Caches/com.apple.mail
- Saved Application State/com.apple.mail.savedState
- Application Support/AddressBook/MailRecents-v4.abcdmr
- Containers/com.apple.mail
- Mail (you are not moving the Mail application but the folder inside ~/Libarary)
- Preferences/com.apple.mail.plist
- Preferences/com.apple.mail.searchhistory.plist
Once you’ve done this, restart your Mac and open up your System Preferences. You will then need to enable your mail accounts again (inside Internet Accounts). You may need to re-enter some mail passwords and/or Apple ID depending on the mail accounts you are using.
Imap or Exchange accounts should re-populate inboxes automatically, but you may have to re-import other accounts/folders from backups.