Contents  SpamSieve Manual  Technical Support

7.13.10   How can I rebuild Apple Mail’s database?

Many common problems with Mail can be fixed by rebuilding all or part of its index database. For example:

First, try a quick rebuild. Select the problem mailbox, go to the Mailbox menu, and choose Rebuild.

If this doesn’t solve the problem, try a complete rebuild:

  1. Quit Mail.

  2. Locate the Envelope Index file. On macOS 10.15, the file is stored at:

    /Users/<username>/Library/Mail/V7/MailData/Envelope Index
    

    Open your user Library folder. (See the How can I open the Library folder? section if necessary.) Then open the Mail folder, then V7, then MailData to find the Envelope Index file.

    • On macOS 10.14, the MailData folder is inside of the V6 folder rather than V7.
    • On macOS 10.13, the MailData folder is inside of the V5 folder rather than V7.
    • On macOS 10.12, the MailData folder is inside of the V4 folder rather than V7.
    • On macOS 10.11, the MailData folder is inside of the V3 folder rather than V7.
    • On macOS 10.7 through 10.10, the MailData folder is inside of the V2 folder rather than V7.
  3. Once you’ve found the Envelope Index file, drag it to the trash. Also delete Envelope Index-shm and Envelope Index-wal (if they exist).

    Note: Rebuilding the index database is normally perfectly safe. Even though it seems that you are deleting a file, Mail stores its primary copy of your message data elsewhere. When you delete the damaged database, Mail uses this primary copy to create a new index database. However, please be careful if you are using macOS 10.15. We’ve heard some reports that rebuilding the Envelope Index can lose messages on macOS 10.15 due to a bug in Mail. If you are using macOS 10.15, be sure that you have a backup first, and proceed with caution.

  4. Relaunch Mail. It will welcome you as if you haven’t used it before. This step may take a few minutes, as Mail searches through all of your stored messages to build your new database file. IMAP and Exchange messages will need to be re-downloaded from the server.

     Contents  SpamSieve Manual  Technical Support