Recently we received reports of Mail corruption. Its a corruption of a very succinct nature because on the surface Apple Mail still appears to look normal but upon inspection of the individual emails themselves, the details of the Sender is mismatched from the contents or email Subject.
Its effectively as though someone took the Sender, email contents and email Subject fields and did a crazed mix and match exercise.
How do we fix this?
In our case example, the affected email was a Gmail account which was configured as an IMAP account.
A quick check by logging into Gmail via web browser, revealed that the actual emails resident on Gmail’s server themselves were not affected – the corruption was limited to emails within Apple Mail.
The fix is a two-phased attempt. Perform the following in descending order that they are presented below.
If the earlier process solves it. Stop there. If not, proceed to carry out the following proposed solution.
#1. Rebuild Mailboxes
This process is an attempt to force Apple Mail to ‘resync’ with your email server.
According to Apple’s own support document explanation:
“When you rebuild mailboxes for IMAP or Exchange accounts, locally stored messages and attachments are discarded, and the messages and attachments are downloaded again from the mail server to your Mac. Your mailbox appears empty until the download is complete”
a. Launch Apple Mail
b. Select the affected Mailbox from the Mail sidebar
c. Click Rebuild from the drop down Mailbox menu
d. Your Mailbox will appear empty during the rebuild process until its complete
Check whether this has fixed your Mail issues. If yes, then “have a good day”, otherwise, move on to the next process below.
#2. Reindex Mailboxes
Unlike Rebuilding where users can select individual Mailboxes to be Rebuilt, Reindex affects ALL Mailboxes.
Reindexing is a last resort measure in cases of serious Mailbox corruption.
By default Apple Mail is designed to Reindex your Mailboxes if it detects a problem but sometimes, a manual Reindex is required.
a. Quit Apple Mail if its open
b. In Finder hit CMD + Shift + G to access the Finder’s Go to the folder window and copy and paste the following into the field: ~/Library/Mail/V2/MailData
c. Hit Go
d. Copy the following files onto your Desktop as a backup:
- Envelope index
- Envelope index-shm
- Envelope index-wal
e. Delete the originals of the above mentioned index files from its ~/Library/Mail/V2/MailData
f. Launch Apple Mail – detecting the missing index files Apple Mail will prompt you to setup Mail all over again, click Continue
g. Apple Mail will begin reindexing all your emails. This process may take a substantial amount of time depending on how large your email collection is
Check if Mail issues have been fixed. If yes, then you are free to delete the copies of the index files from your Desktop.