keepcalculator

06 Numbers and Powers

Rebuild Mailbox Mac: Fix in 5 Steps

Card No. 06·73410 · Updated · Standard formula, shown below

If your Mac’s Mail app is showing errors, missing messages, or acting sluggish, rebuilding the mailbox is the fix you need. This process re-downloads and re-indexes your email, resolving most corruption issues. Here’s exactly how to do it, plus what to do when the standard rebuild doesn’t work.

Why Rebuild a Mailbox?

Mail on macOS stores each account’s messages in a local database (envelope index) and individual .emlx files. Over time, this index can become out of sync with the actual messages—due to a crash, a force quit, a full disk, or a failed sync. When that happens, you see symptoms like:

  • Messages missing from a folder, even though they exist on the server.
  • Duplicate messages appearing.
  • Mail crashing when you open a specific mailbox.
  • Search returning no results for emails you know are there.
  • Mail spinning forever on “Checking for Mail” or “Updating mailbox.”

Rebuilding forces Mail to read every message file again, rebuild the index, and re-sync with the server. It’s the first thing to try for any unexplained Mail problem.

How to Rebuild a Mailbox (The Standard Way)

This works in macOS Ventura, Sonoma, Sequoia, and most recent versions. The steps are nearly identical across them.

  1. Open the Mail app.
  2. Select the mailbox (or mailboxes) you want to rebuild in the sidebar. Hold Command to select multiple.
  3. Go to the Mailbox menu in the top menu bar.
  4. Choose Rebuild.
  5. A progress bar appears. For large mailboxes, this can take several minutes. Do not quit Mail during the rebuild.

When it’s done, Mail will re-download any missing messages from the server and re-index everything. Your messages will appear exactly as they are on the server—so if you deleted something on another device, it won’t come back.

What to Do If Rebuild Isn’t Available or Fails

Sometimes the Rebuild option is greyed out, or Mail crashes during the rebuild. Here’s what to try next:

1. Rebuild from the Mailbox Menu in a Different Way

If the mailbox is an IMAP account, try: Mailbox > Rebuild while the mailbox is selected. If it’s greyed out, click once on the account name (not the individual folder) and try again. For POP accounts, you may need to select the “Inbox” specifically.

2. Delete the Envelope Index (Advanced)

If Mail won’t rebuild, you can delete the index files manually. This forces Mail to recreate them from scratch.

  1. Quit Mail completely (Command+Q).
  2. Open Finder, press Command+Shift+G, and enter:
    ~/Library/Mail/V10 (or V9, V8, etc., depending on your macOS version—look for the highest number).
  3. Inside, you’ll see folders for each account. Find the one that’s misbehaving.
  4. Inside that account folder, look for files named Envelope Index and Envelope Index-shm and Envelope Index-wal.
  5. Move them to the Desktop (don’t delete them yet).
  6. Reopen Mail. It will rebuild the index automatically. If everything works, you can delete those files from the Desktop.

This is safe—it only deletes the local index, not your actual emails. Your messages are stored as .emlx files in the same folder.

3. Check for Disk Permissions or Full Disk

If Mail can’t write to its data folder, rebuilds fail. Check that your startup disk has free space (at least 10-15% is a good rule). Also, ensure Mail has Full Disk Access in System Settings > Privacy & Security > Full Disk Access—sometimes this gets revoked after a macOS update.

Rebuilding vs. Re-downloading: What’s the Difference?

A common misconception is that rebuilding is the same as deleting and re-adding your account. They’re different:

  • Rebuild re-indexes existing local files and syncs with the server. It’s fast and doesn’t affect your settings.
  • Delete and re-add account removes the local copies and re-downloads everything. This is more drastic—it can fix deeper issues but also resets your account settings (like signatures or behaviors).

Try rebuild first. Only if that fails, and the problem is severe, consider removing the account and adding it again. But be aware: if you have “offline” mailboxes (like “On My Mac”), deleting the account may delete those local-only messages permanently.

Common Mistakes and Pitfalls

  • Rebuilding while Mail is syncing: If you have a huge attachment downloading, the rebuild may conflict. Wait for sync to finish.
  • Rebuilding the wrong mailbox: If you have multiple accounts, make sure you select the correct one. Rebuilding a large archive can take a long time.
  • Quitting Mail mid-rebuild: This can corrupt the index further. Be patient.
  • Forgetting about the server: Rebuild only fixes local issues. If the problem is on the server (e.g., your email provider is having an outage), rebuilding won’t help. Check your webmail first.

When Rebuild Won’t Fix It: Other Solutions

If you’ve rebuilt and the problem persists, consider these next steps:

  • Check server settings: Go to Mail > Settings > Accounts and verify your incoming/outgoing server settings are correct. A wrong port or SSL setting can cause sync issues.
  • Create a new Mailbox: If a specific folder is corrupted, create a new folder, move messages manually, and delete the old one.
  • Use a different email client: If Mail is consistently problematic, try Apple’s webmail, Outlook, or Thunderbird to see if the issue is Mail-specific.
  • Reset Mail’s preferences: Quit Mail, move ~/Library/Preferences/com.apple.mail.plist to the Desktop, and reopen Mail. This resets your settings but can fix weird behavior.

Frequently Asked Questions

Will rebuilding a mailbox delete my emails?

No. Rebuilding only re-indexes the local database. Your actual messages are stored as separate files and are not touched. However, if messages are missing on the server, they won’t reappear locally after a rebuild—the rebuild syncs to the server’s state.

How long does a mailbox rebuild take?

It depends on the size. A small inbox (a few hundred messages) takes seconds. A 10 GB archive with thousands of messages can take 10-30 minutes. You’ll see a progress bar at the bottom of the Mail window.

Can I rebuild multiple mailboxes at once?

Yes. Hold Command and click each mailbox in the sidebar, then choose Rebuild. Mail will process them sequentially. But it’s usually safer to do one at a time so you can spot which one is causing issues.

Why is the Rebuild option greyed out?

This usually happens when you haven’t selected a mailbox—click on a specific folder (like Inbox) in the sidebar, not just the account name. It can also be greyed out if Mail is in the middle of a sync or if the mailbox is a Smart Mailbox (those can’t be rebuilt—they’re virtual).

Does rebuilding fix Mail crashing on launch?

Sometimes, if the crash is caused by a corrupted index. But if Mail crashes before you can even open a mailbox, try the envelope index deletion method described above. If that fails, you may need to remove and re-add your account.

What’s the difference between Rebuild and Compact?

Compact removes deleted messages and frees up space in the local database—it doesn’t re-index. Rebuild is a more thorough process that recreates the entire index. If you just want to reduce Mail’s disk usage, use Compact (Mailbox > Compact).

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →