Apple Mail on macOS is a robust desktop email client, but over years of handling heavy email volumes, local cache indices can become corrupted. Common symptoms of index degradation include messages failing to appear in an inbox even though notifications fire, search queries returning blank results, emails displaying missing sender details, or deleted messages reappearing unexpectedly.
Fortunately, macOS includes a native Rebuild utility designed specifically to repair corrupted local mailbox indexes. When you trigger a rebuild, Apple Mail flushes its local SQLite cache for that specific folder and forces a fresh synchronisation against your IMAP or Exchange mail server. You can also pair this maintenance with other workflow enhancements, such as learning how to create smart mailboxes in Apple Mail to filter incoming messages automatically.
When Should You Rebuild a Mailbox?
Rebuilding is safe, non-destructive, and highly recommended whenever you encounter any of the following email issues:
- Phantom Messages: The unread badge count shows unread messages, but nothing new appears in the message list.
- Search Failures: Searching for known senders, subjects, or keywords yields partial or zero results in the Mail search bar.
- Blank Email Body: Selecting an email displays a blank preview pane or states that the message body has not been downloaded from the server.
- Sync Conflicts: Folders and labels created on webmail (such as Gmail, iCloud, or Outlook 365) fail to reflect their true status locally on your Mac.
How to Rebuild a Mailbox in Apple Mail on Mac
Rebuilding an individual folder takes just a couple of clicks within the Apple Mail interface:
- Open the Mail app on your Mac.
- In the left-hand sidebar, click on the specific mailbox you want to repair (for example, your primary Inbox, Sent, or an archived project folder). If the sidebar is hidden, click View > Show Sidebar in the top menu bar.
- Click the Mailbox menu in the top menu bar.
- Scroll down to the bottom of the dropdown menu and select Rebuild.
You may not see an immediate pop-up dialogue box. Instead, the messages in that folder will temporarily disappear from view while Apple Mail re-downloads and re-indexes header data from your mail provider. Depending on mailbox size and internet connection speed, the process can take anywhere from a few seconds to several minutes.
How to Rebuild Multiple Mailboxes or Accounts
If you maintain multiple email accounts—such as personal iCloud, Google Workspace, and Microsoft Exchange—you should repeat the rebuild process for each affected folder:
- Expand the account tree in the Mail sidebar.
- Select the first inbox and click Mailbox > Rebuild.
- Proceed to subsequent mailboxes (such as Drafts, Sent, and custom IMAP labels) and select Rebuild for each.
- Keep the Mail app open and connected to the internet until the activity indicator stops spinning in the bottom-left corner of the sidebar.
What If Rebuilding Does Not Fix Search? (Reindexing Spotlight Envelope Index)
If a standard mailbox rebuild resolves missing messages but the search bar remains unresponsive, the core macOS Envelope Index database may be corrupted. You can force Apple Mail to completely rebuild its master database:
- Quit the Mail app completely by pressing Cmd + Q.
- Open Finder, click the Go menu in the top menu bar, and choose Go to Folder (or press Cmd + Shift + G).
- Enter the following path into the search field and press Enter:
(Note: Depending on your macOS version, the folder number may be V9, V10, or higher).~/Library/Mail/V10/MailData/ - Locate any files beginning with
Envelope Index(such asEnvelope Index,Envelope Index-shm, andEnvelope Index-wal). - Move these three files to your Desktop as a temporary backup.
- Reopen the Mail app. Apple Mail will display a prompt stating that it needs to import and re-index your messages. Click Continue to reconstruct the central index database.
Frequently Asked Questions
Does rebuilding a mailbox delete any emails permanently?
No. For IMAP and Exchange accounts (including iCloud, Gmail, Yahoo, and Microsoft 365), all original messages remain securely stored on your email provider’s cloud servers. The Rebuild command only clears and recreates local index cache files on your Mac.
What happens if I rebuild a local “On My Mac” folder?
Folders stored under “On My Mac” exist only on your local drive and are not synchronised with an external server. Rebuilding an “On My Mac” folder re-indexes the locally stored .emlx files on your disk; it does not erase them. However, it is always wise to keep an up-to-date Time Machine backup before performing system maintenance.
Why does rebuilding take so long on large mailboxes?
If a mailbox contains tens of thousands of messages with PDF or media attachments, Apple Mail must re-verify each message header against your mail server over the internet. On large accounts, allow the rebuild to finish uninterrupted in the background.