How to Rebuild the Envelope Index in Apple Mail Manually?

admin | Apple how to Mac Mac Mail | 5 minutes read | Modified on: 13-08-2026

Apple Mail is one of the most efficient desktop email programs available for Mac users since it provides perfect integration with iCloud, Microsoft Exchange, Gmail, and even with the IMAP server. But, unlike any other software that uses a dynamic database storage system, at times it may experience certain performance obstacles and synchronization issues.

If you encounter such problems as missing emails, not loading content, wrong count of unread emails, or inability to find search results, you may be sure that the cause of all these issues is the corrupted Envelope Index.

This step-by-step guide will tell you what the Envelope Index is, how to realize that it should be reset, and how to do it yourself.

What Is the Apple Mail Envelope Index?

The Envelope Index is an internal SQLite database created by Apple Mail to maintain indexes of all your incoming and saved emails from the email accounts.

Instead of going through the contents of individual email files (.eml or .emlx) on your computer whenever you open any folder or search for anything, Apple Mail checks this index database. The database contains important information such as:

  • Metadata like sender, recipient, date, subject of the message
  • Status (unread/read) and colors
  • Folders and mailboxes organization
  • References to attachments and keyword searches

When the Envelope Index gets corrupted, damaged, or out of sync, typically caused by power outages, email synchronization issues, unexpected update to macOS, and lack of disk space, Apple Mail will be unable to keep track of the files.

Quick Tip – Try MacMister Apple Mail Converter Tool to export Apple Mail mailboxes into 15+ saving types. It is a solution that securely batch export Apple Mail data files into PST, EML, HTML, MBOX, TXT, CSV, Yahoo, Gmail, Office 365, and more.

Signs Your Apple Mail Envelope Index Is Corrupted

In case you notice one of the following problems on your computer using Apple Mac, then manual rebuilding of the Envelope Index will be the most efficient way to fix this issue:

  1. Bad Search: While searching for the email from a certain sender or by the key word, you don’t get any results although the emails are there.
  2. Missing Email Content: While opening the emails, the email box becomes blank or shows “This message has no content”.
  3. Unread Messages Badges: Even though Apple Mail has unread messages badges, after clicking on them, you discover that there is nothing unread there.
  4. Slow Performance and Frequent Crashing: Apple Mail becomes frozen, takes a lot of time to load and keeps beachballing while moving between folders.
  5. Bad Performance of Smart Mailboxes.

Method 1: The Manual Terminal/Finder Rebuild (Recommended)

Although it is true that in certain instances, Apple Mail tries to correct index issues on its own, the best method to remove corrupt database files would be manually through Finder in macOS so as to create a new index.

Step 1: Quit Apple Mail Completely

Prior to accessing any system database files, ensure that the Apple Mail application has been completely shut down.

  1. Go to Apple Mail > Quit Mail (Cmd + Q)
  2. If the program be frozen and unable to quit properly, open Activity Monitor, select Mail from the list, and click Force Quit (Option + Cmd + Esc).

Step 2: Open the Hidden ~ / Library / Mail Directory

Envelop Index files are found in the hidden user Library directory of your Mac computer.

  1. Start a new Finder window.
  2. Navigate to the menu bar at the top of your screen. Select “Go” and press the Option key (⌥) on your keyboard.
  3. Library directory will pop up in the drop-down menu. Select it.
  4. Navigate to the Mail folder.

Step 3: Identify Your macOS Mail Version Folder

In the Mail folder, you will find version-numbered folders based on your macOS version (for example, V10, V9, V8, or V7).

  1. macOS Sonoma / Ventura / Monterey: Check V10, V9, or above.
  2. macOS Big Sur: Check V8.
  3. macOS Catalina: Check V7.

Open the folder with the highest number available on your system.

Step 4: Locate and Delete the Envelope Index Files

Within the folder of the active version (for instance, V10), click on the MailData folder.

Figure out all the files starting with the name “Envelope Index”. There are generally three files:

  • Envelope Index
  • Envelope Index-shm
  • Envelope Index-wal

Move all these three files of the “Envelope Index” type onto the Desktop (it is like making a safety backup of these files). No other file/folder must be deleted.

Step 5: Relaunch Apple Mail & Trigger the Automatic Rebuild

Step 1. Launch Apple Mail.

Step 2. Mail will find out that the index files are missing and shows a message “Importing Mailboxes – Optimizing Mail Database”.

Step 3. Click “Continue”.

Now Apple Mail will scan all mailboxes in all local and cached accounts, looking into all email files on your hard drive and creating a new, fresh Envelope Index database from scratch.

This procedure might take anywhere from 2 minutes to more than one hour, depending on how big your mail box history is (i.e., 5 GB or 50 GB). Let it run until it is done.

Step 6: Verify and Clean Up

When Apple Mail opens up, put your email client to test:

  • Do a keyword search to ensure that results load immediately.
  • Navigate through your inbox to check if messages load well.
  • See if ghost unread counts are gone.

When all is well, drag the old Envelope Index files into the trash can.

Method 2: Command Line Rebuild (For Power Users)

If you prefer using macOS Terminal for faster execution, you can remove the index files with a single command sequence.

  1. Close Apple Mail (Cmd + Q).
  2. Open Terminal (via Spotlight or Applications > Utilities).
  3. Copy and paste the following command into Terminal and press Return:

                   rm -f ~/Library/Mail/V*/MailData/Envelope\ Index*

  1. Relaunch Apple Mail to initiate the re-indexing process.

What to Do If Rebuilding Doesn’t Fix the Issue?

If rebuilding the Envelope Index doesn’t solve the problem of missing emails and/or syncing problems, then the problem can be deeper in the cache files of the mailboxes or synchronization problems with your accounts:

  • Reindex Your Mailboxes: Find the problematic mailbox in your Apple Mail, go to Mailbox from the top toolbar, and choose Rebuild.
  • Check Available Disk Space: The files of SQLite databases need enough working buffer space. You need to have at least 10-15% free space on your Mac.
  • Remove and Re-Add the Email Account: For constant errors with IMAP or Exchange protocols, remove the email account from System Settings > Internet Accounts, and then add it back to download fresh data from the server.

Epilogue

“Repairing the Envelope Index on Apple Mail” is a crucial method that everyone using a Mac computer must be familiar with. It involves the deletion of old and corrupt SQLite index files in order to make the Mac OS relabel all your emails and get rid of any slow performance problems.