In my various shufflings, copyings, archivings of email messages between my IMAP folders, I often end up with duplicates.
Sometimes, a copy or move goes badly wrong and I end up with hundreds of duplicates.
Many years ago I wrote a bit of Java code which would find and remove duplicates, but I’ve now converted it to a Python script and released it as Open Source, in case it’s useful to anyone else.
Feedback and improvements welcome!