Monday, August 26, 2013

Showing Duplicate Messages in Apple Mail

Since Mac OS X 10.6, Apple Mail has hidden duplicate e-mails. It uses a loose definition of “duplicate,” which can consider two messages to be duplicates even if both their headers and body differ.

This has caused problems for me when dealing with mailing lists. For example, if a message is sent both to me and to the list, it’s hard to tell from what Mail shows whether I was sent a private reply or whether everyone on the list saw the message.

It can also cause problems when archiving e-mails or moving them between mail programs. Most people would expect the number of messages in a mailbox to stay constant. However, if you archive e-mails from Mail to EagleFiler, you may end up with what looks like too many messages in EagleFiler. And if you use Mail to import from EagleFiler, it may look like some of your messages were lost. In both cases, the right number of messages are there, but you can’t see that because Mail isn’t showing all of them.

Fortunately, there is a hidden preference to tell Mail not to hide the “duplicate” messages. You can just enter this command in Terminal:

defaults write com.apple.mail AlwaysShowDuplicates -bool true

Apple also says that you can adjust Mail’s preferences so that when you click on a message it shows links to the duplicates. However, this does not seem to work reliably for me, and it’s only for individual messages. It won’t help you see how many messages are really in a mailbox.

Update (2020-01-25): On macOS 10.10 and later, the command is:

defaults write com.apple.mail _AlwaysShowDuplicates -bool true

8 Comments RSS · Twitter

[...] Showing Duplicate Messages in Apple Mail (Michael Tsai) [...]

[…] Showing Duplicate Messages in Apple Mail (Michael Tsai) […]

Did the command to show duplicates change with Catalina? I just bought a new Mac and I can't get Mail to show the duplicates anymore. I can see the size of the message which clearly indicates there are duplicates, but the badge with the number isn't there now.

I recently ran into this issue when doing a clean install of Big Sur.
Writing the _AlwaysShowDuplicates default simply did not have an effect. It turned out that a part of macOS security features blocks this from working:

https://discussions.apple.com/thread/250405110

While everything looks at it is OK, meaning you can successfully write the default, one actually accesses a different file than the one that actually needs to be altered.
As described in the thread, you can tell if you are on the right path when typing defaults read com.apple.mail.
This means that you need to give Terminal.app full disc access.

Thank you for this. It worked on Ventura 13.1. However, how does one apply this fix on iOS? The mail app on iOS also hides duplicate emails.

I added both Terminal and bash to the Full Disk Access of the Privacy & Security pane of System Settings but still cannot write the change.

I have tried writing both "true" and "false," and then reading immediately thereafter and the entry for Always Show Duplicates is 1 ... it never changes.

Any ideas? Where does the preference file that I am trying to write reside? Yes, after adding both Terminal and bash to Full Disk Access, reading the com.apple.mail file went from a couple of lines to a couple hundred lines.

Thanks!

@bill It should be at ~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.mail.plist.

Leave a Comment