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:

  1. I deleted the corresponding local folder in Mail.
  2. I go to my TimeMachine Backup, select a backup from December (to be sure it was a time when everything was still working)
  3. I copy the folder from the TimeMachine, namely: ~/Library/Mail/V7/***long alphanumeric code***/2018.mbox
  4. 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:

  1. I open Mail.app. The folder "2018" appears in "On my Mac", but it is empty.
  2. I try rebuild the folder (Menu "Mailbox" > "Rebuild") but nothing happens.
  3. I thus close Mail.app, and delete the Envelope files from ~/Library/Mail/V7/ as described here
  4. I reopen Mail.app. A window appears asking me for some patience while "messages are imported"
  5. 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

Posted on Jan 27, 2020 8:37 AM

Reply

Similar questions

9 replies

Feb 17, 2020 8:03 AM in response to dcd

Hi BDAqua,


an update on this. You asked me to check if the problem occurs in Safe Mode.


  • As I wrote above (Jan 27), just opening Mail in Safe Mode showed the same symptoms: the emails are there, but blank (without content).
  • I guess that was not your suggestion though. So today I tried to reimport that (corrupt) folder into Mail, but from Safe Mode. This is probably what you meant. And it worked.


I proceeded as follows.


  • I deleted the corrupted local folder ("2018") from within Mail (right-click "Delete Mailbox...")
  • I verified that the folder 2018.mbox had indeed disappeared from ./Library/Mail/V7/***long alphanumeric code***/
  • I rebooted my computer in Safe Mode
  • I copied a Time Machine version of the 2018.mbox folder (from December, when it was still working fine) and pasted it into ./Library/Mail/V7/***long alphanumeric code***/
  • Then I opened Mail, but the folder 2018.mbox did not appear among my "On my Mac" folders


So I deleted ./Library/Mail/V7/***long alphanumeric code***/2018.mbox and tried another approach (while still in Safe Mode):


  • I opened Mail and went into "File">"Import Mailboxes" and then selected "Apple Mail" mailboxes
  • I chose the mailbox 2018.mbox from the Time Machine, as of last December
  • Mail imported all 11,000 emails without problems.


It works fine – those 11,000 emails from 2018 all have their proper content, and they are search-able from within Mail.

In sum: Success! Thank you.


Two comparatively minor things still bother me.


  1. The old 2018.mbox folder, as I found it in the Time Machine, was 1.29 GB. After importing it through "Import Mailboxes", it now takes up 3.33 GB of space inside the Library. Why?
  2. The folder, as it now appears in Mail under "On My Mac", appears with all the subfolders 2018/***long alphanumeric code***/Data/0 and so on (subfolders 0, 1, 2, 3, ... 9). See screenshot. Why?

Feb 21, 2020 8:50 AM in response to BDAqua

I followed your advice, thanks.


I first tried to delete the folder "7D35A... " from within Mail (in Safe Mode), but nothing happened (the folder would not disappear).


Then I tried to apply "Delete Mailbox" to the whole "2018" folder, but again nothing happened.


Thus I went into ./Library/Mail/V7/ and manually deleted 2018.mbox. Then I reopened Mail.app, and then the 2018 folder was there, but it was completely empty and I could delete it successfully.


So then I went to Time Machine again and asked Mail to import the old 2018.mbox again. This time, when this appeared,

I manually unchecked all subfolders and only left "2018".


This worked great! Now all the content of 2018.mbox is in my Mail "on my Mac" folders, without funny subfolders, and without taking up twice as much space as before.


Thank you!


Jan 27, 2020 1:05 PM in response to BDAqua

Hi BDAqua, thanks.


What exactly should I perform in Safe Mode, the whole procedure that I described above — copying and importing the .mbox folder from the backup archive? Just as I described it above, or should I change any of the steps?


If I just restart in Safe Mode and open Mail now, I see again my local folder with 11,000 emails, but all blank and without content. Just as in normal mode. But I assume that's not what you wanted me to try?

Feb 19, 2020 7:20 AM in response to BDAqua

Thank you – not sure what exactly you mean by 2.


When I open these numbered folders, they all in turn have subfolders called "2" or "3", and they in turn have subfolders called "Messages" or "Attachments". Each "Messages" folder contains almost always exactly 1000 messages. When I double-click on them, they open up as a conversation.


My sense is that these are all messages that also appear in the top-most folder ("2018", which contains 10950 messages), but then are also each in one of these subfolders. Is that possible?


When you ask,

where they might've been folder wise originally

– well, originally they were just all in one folder called "2018". I had nod created subfolders within that local folder called "2018".

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.

Rebuilding and indexing corrupt local ("On my Mac") folders in Mail

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