Removing duplicate emails

I’ve been toying with cleaning up my email/Inbox Zero and, as a start, would like recommendations for a way to delete duplicate emails. I have accounts from Outlook.com, iCloud and Gmail that I would eventually like to use it with but at the moment it is only the Outlook.com account that I am ironing out. I tried Jolly Roger’s Remove Duplicate Messages utility but that didn’t work. It did detect and delete duplicate emails in Mail.app on the Mac but for some reason these didn’t get deleted server side despite having set Mail.app to remove deleted messages from the server. I hear that Outlook 2016 has a Clean Up feature but, alas, it is only available on the Windows version of the app.

As an aside, I was a little taken aback by the cracks in Mail.app in dealing with Outlook.com emails. I had to rebuild the mailbox while dealing with anything more than a handful of emails or it would lose track with the server. I have been pleasantly surprised so far with Outlook 2016 for Mac.

When making these massive changes to your email box it best to do this at the server using the Web interface.

Also, note that “deleting” often moves messages to “archive” from where they will show in your search results. Make sure you cleanse the Archive and Trash bins of your redundant emails.

1 Like

I use this script to clean up duplicate emails on Outlook 2016.

You need to have Outlook open and the folder being cleaned active. The script won’t do sub folders. This script works for me because of the minimal sub folder structure I have. I have a growing database of over 100k emails.

Script included below along with credits, I found it on a forum some time ago


– Remove Duplicate Message v1.0

– An Applescript by Barry Wainwright, 18th March 2002

– Detects and deletes duplicate messages within a selected folder

– works on Message-ID header - uniquely identifying duplicates

tell application “Microsoft Outlook”

set theMessages to current messages

if theMessages = {} then

try

set theFolder to selected folder

set mb to theFolder

on error

display dialog “In the folder listing, please select the folder you want to be scanned for duplicates” with icon stop buttons {“Quit”} default button 1

return -99

end try

else

set mb to folder of item 1 of theMessages

end if

set theName to name of mb

say "Removing duplicates from mail folder: " & theName

set y to count messages of mb

say "Number of messages to check, " & y

set IDlist to {}

repeat with x from y to 1 by -1

try

set theHeaders to ( get headers of message x of mb)

set AppleScript’s text item delimiters to {return & “Message-”}

set temp to text item 2 of theHeaders

set AppleScript’s text item delimiters to {return}

set theId to text 5 through -1 of text item 1 of temp

on error

set theId to “”

end try

if theId is in my IDlist then

delete message x of mb

else if theId ≠ “” then

copy theId to end of IDlist

end if

end repeat

set removedCount to y - ( count messages of mb)

if removedCount is 0 then

say “Finished. No duplicates detected”

else

say “Finished. " & removedCount & " duplicates removed”

end if

display dialog “” & y & " messages checked" & return & removedCount & " messages removed" buttons {“OK”} default button 1

set AppleScript’s text item delimiters to {""}

end tell

1 Like

Thanks a ton, @adabbagh. I found a newer version (v2.1) of the script that you mentioned and it worked like a charm!

1 Like

Happy I helped out and thanks for posting the link to the updated script!

1 Like

Due to duplicate emails your data consume space as well as email application is also bulky. Every user can’t use script due to lack of technical knowledge. So, to get rid of this problem try the manual procedures which are very helpful and user friendly. There are many manual methods available online. I have found few ones try these:

  1. Configure rules correctly
  2. Run Inbox clean up
  3. Antivirus App
  4. Set Inbox update frequency

After so many searches I have found above methods. Apply these methods and get rid of this problem. If still problem exists then go to tool. There are many tools available on Microsoft Technet community. I have found tool for you like Stellar Deduplicator for Outlook. But this tools is for Windows users. After apply all these methods please share feedback. It will be helpful for others also.

Thunderbird is still a great email client, due to the vast amount of existing plugins.

I used https://addons.thunderbird.net/en-US/thunderbird/addon/remove-duplicate-messages-alte/ to solve a similar issue. Not sure on the state of Exchange support, I used it on IMAP accounts to get rid of hundreds (if not thousands) of duplicates that occured when migrating an account.