Rebuilding and indexing corrupt local ("On my Mac") folders in Mail
I had some ongoing problems with a local folder in my Mail app in past weeks. Unfortunately, I could not describe my problems clearly enough to get help on this forum before. So in the end, I followed the advice given and simply tried to recover my old folder from my TimeMachine backup.
This however generated the same problems that I encountered before, and so now I am in the position to ask a more precise question now. Here is the problem description:
Initial situation: I used to have problems with a locally archived folder of email messages. This folder used to contain 11,000 messages from 2018. (The folder is aptly called "2018"). Messages were corrupted, missing, and most of them disappeared in recent weeks.
Recovery - steps followed:
- I deleted the corresponding local folder in Mail.
- I go to my TimeMachine Backup, select a backup from December (to be sure it was a time when everything was still working)
- I copy the folder from the TimeMachine, namely: ~/Library/Mail/V7/***long alphanumeric code***/2018.mbox
- I paste the 2018.mbox folder from the TimeMachine into the same folder on my computer (~/Library/Mail/V7/***long alphanumeric code***/)
Note that the 2018.mbox folder has a size of 1.66 GB (and used to contain almost 11,000 messages).
Now what happened next?
Problems appearing after import from Time Machine:
- I open Mail.app. The folder "2018" appears in "On my Mac", but it is empty.
- I try rebuild the folder (Menu "Mailbox" > "Rebuild") but nothing happens.
- I thus close Mail.app, and delete the Envelope files from ~/Library/Mail/V7/ as described here
- I reopen Mail.app. A window appears asking me for some patience while "messages are imported"
- At the end of this process, the local folder "2018" contains 10,950 messages (with correct headers and dates), but they are all blank.
Also note that if I now look into my computer's ~/Library/Mail/V7/***long alphanumeric code***/ folder, the "2018.mbox" folder has shrunk from 1.66 GB (before deleting the Envelope files) to 109.9 MB.
In other words, I was able to recover all ~11k messages, but only as blank messages, and shrinking their size massively!
What can I do to recover the entire 2018.mbox folder with all its 11,000 messages from an archived copy, and make sure it's not corrupted or empty?
MacBook Pro 13", macOS 10.13