How to deduplicate your IMAP emails

IMAPDdedup is a tool to deduplicate IMAP emails, i.e. delete identical emails from your IMAP account. By default, it will only delete mails within the same folder and use the Message-ID header to find duplicate emails. It is also pretty fast, since it only needs to load the message headers, not the complete messages.

First, clone it using

git clone

Then run it using

python3 IMAPDdedup/ -s [server] -w [password] -r -S -u [username] [Folder]

For example:

python3 IMAPdedup/ -s -w Hiethi3lah -r -S -u INBOX