Delete duplicate emails in mutt

“Let say you want to delete all duplicate messages in the current mailbox. Just do a tag-pattern (bound to T here), put in ~= as the pattern, then all duplicates will be tagged. After that, you can delete tagged messages (bound to ;d, or just d if you have $auto_tag=yes).”

Robbed from here. However it doesn’t work unless you are sorted in thread mode as described here.