How to delete duplicate messages from both Mail app and iCloud mail.

I have duplicated emails (thousands - don't ask me why) in my iCloud mailbox. I've identified in apple discussions different ways to identify and remove duplicate mails (via apple scripts for instance, or some 3rd party cleaning apps) from the Mail library on my Mac, unfortunately this are processes which do not trigger sync with iCloud. It's like manually identify similar files in your mail library and get rid of them offline, but these changes are not cascaded up to the cloud. So the next time you sync or rebuild your mailbox, the duplicate emails will be downloaded again. I feel I'm missing something here. Does anybody think about a way (free or available on the store) to really clean up mail on both the local library and iCloud?


iMac 27″ 5K, macOS 11.1

Posted on Dec 26, 2020 1:46 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 8, 2021 9:59 AM

OK, thanks for the help, here is my solution, inspired by your help and described with my own words:

  1. Don't try to run massive update or to clean mailbox while it is online and sync with (i)cloud repository anymore. That doesn't work well because of the issues I've described above.
  2. Take all messages offline. I've created a local mailbox on my Mac, and copied my 20,000 mails there (about 15 years of mailing)
  3. Then I've sort out and clean the local mailbox doing mass update/deletes using smart list, but also using a tool which identifies then remove duplicate messages and attachements.(I've purchased it on app store as I was ok to pay for it, but there are some free scripts available on community if you prefer).
  4. Once it was cleaned, I've rebuilt the local mailbox (using "rebuild" function available in mailbox menu of the Mail app).
  5. Then do some random comparison/QC with online version to make sure I didn't erase anything important in my local mailbox, didn't corrupt anything, still have my attachements etc...
  6. Delete all online messages on the cloud. From that moment I didn't have anymore back up of my messages so I've quickly moved to the next step
  7. Using Mail app, copied (not moved) the content of the local mailbox to the empty mailbox which is synced with the cloud.
  8. This took a few hours. I then did some random QC again, between local folder and online one.
  9. Remove the local mailbox on my Mac.

Similar questions

10 replies
Question marked as Top-ranking reply

Jan 8, 2021 9:59 AM in response to tygb

OK, thanks for the help, here is my solution, inspired by your help and described with my own words:

  1. Don't try to run massive update or to clean mailbox while it is online and sync with (i)cloud repository anymore. That doesn't work well because of the issues I've described above.
  2. Take all messages offline. I've created a local mailbox on my Mac, and copied my 20,000 mails there (about 15 years of mailing)
  3. Then I've sort out and clean the local mailbox doing mass update/deletes using smart list, but also using a tool which identifies then remove duplicate messages and attachements.(I've purchased it on app store as I was ok to pay for it, but there are some free scripts available on community if you prefer).
  4. Once it was cleaned, I've rebuilt the local mailbox (using "rebuild" function available in mailbox menu of the Mail app).
  5. Then do some random comparison/QC with online version to make sure I didn't erase anything important in my local mailbox, didn't corrupt anything, still have my attachements etc...
  6. Delete all online messages on the cloud. From that moment I didn't have anymore back up of my messages so I've quickly moved to the next step
  7. Using Mail app, copied (not moved) the content of the local mailbox to the empty mailbox which is synced with the cloud.
  8. This took a few hours. I then did some random QC again, between local folder and online one.
  9. Remove the local mailbox on my Mac.

Feb 23, 2021 4:23 AM in response to extra tonne

OK, I think I have to develop what I meant with the step 2 above (Take all messages off line):

Tidy Up indeed searches across all mailboxes and I didn't find a way to specifically exclude some accounts/folders

So here is what I did:

  • I assume you're using macOS Mail app: Create a local Mailbox. Copy all the messages from your online account to the local mailbox.
  • Remove your online account from your mac. This will remove the Mail mailbox as well. Your original "messy" mailbox with all your duplicated messages is still available on the cloud via web interface, should you need it to run some random QC.
  • Then run Tidy Up who will scan and identify duplicates within your local mailbox only. Clean your local mailbox and do some QC (random comparison) with the messages the cloud to make sure you didn't remove anything important.
  • Once you're happy with the content of your local mailbox, you can follow up with step 6, which is the stressful one, as you delete all your online messages (!) using the web interface. Then add again your online account to Mail (the mailbox should be empty), and copy the messages from local mailbox to online mailbox. Note: I did not copy my entire local mailbox at once, I've split it in smaller batches of about 1000 messages. Why? No good reason, It's just that I didn't feel it was a good idea to copy everything in one shot. Copying messages from local mailbox to the online one can be a long procedure, especially if you have big attachements. And I don't like when a process takes too much time, you never know what can happen during the process.
  • Do some random QC again between your local and online mailbox to make sure the copy procedure went ok, then delete the local mailbox. That's it.


I'm sure someone could come with a safer or more elegant way to achieve this, but after several tentatives, this is what I decided to do. Although cumbersome/not perfect, at least I was able to control the different steps and I knew what I was doing.

Feb 19, 2021 5:14 AM in response to extra tonne

Hi. It was this one: https://apps.apple.com/be/app/tidy-up/id1395962105?mt=12

As I said above, there apparently are cheaper/free alternative, but I've tried few of them including this one, found it was tidy up which worked best and safely, and decided to pay. No regret as it solved my issue without wasting hours of my time anymore. And may help me again in the future...

Jan 6, 2021 6:38 AM in response to dansma

Sort out those mail , create a folder in on my Mac section or if the folder is under iCloud section , and move those mails in the folder , and right click on the folder and delete it or erase deleted items in the previous link methods are described .

The mails will be deleted from iCloud.com also .


Feb 22, 2021 12:46 PM in response to dansma

I have used the Tidy Up app.

I had 18,000 real emails in my cloud account, but unfortunately 30,000 when duplicates were included.

I have followed your instructions and copied all mails to a separate mailbox. When I run the tie-up app, it seems to run on all of the mail folders and I cannot find how to get it to run on only the new mailbox with the copied mails.

It therefore recognises all of these mails as copies. Is there a step that I am missing?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to delete duplicate messages from both Mail app and iCloud mail.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.