Blog/ Apple Mail & iCloud

How to Rebuild a Mailbox in Apple Mail (And When to)

Nafiul HasanNafiul Hasan· 12 min read
Illustration showing the Apple Mail rebuild mailbox process — a local message cache being cleared and re-downloaded from a mail server

The short answer

Rebuilding a mailbox in Apple Mail discards the local copy of your messages and re-downloads everything from the mail server. For IMAP and Exchange accounts your messages are safe — they live on the server. For On My Mac local mailboxes, rebuilding carries a real risk of data loss, so back up before you start.

How to rebuild a mailbox in Apple Mail: discard the local cache and re-download from the server. Safe for IMAP; risky for local-only mailboxes.

On this page
  1. 01Before you rebuild: understand your account type
  2. 02How to rebuild a mailbox in Apple Mail, step by step
  3. 03Rebuild in Apple Mail across macOS, iOS, and iPadOS
  4. 04What to do when Rebuild is greyed out or messages do not return
  5. 05A different approach to recurring inbox sync problems

When Apple Mail starts showing the wrong unread count, hiding messages you know arrived, or displaying a mailbox that looks empty while the server clearly has mail, knowing how to rebuild a mailbox in Apple Mail is the fix to reach for first. Rebuilding tells Mail to discard its local message cache and re-download the contents from the server from scratch.

Apple Mail stores a local copy of your messages to speed up loading. Instead of fetching from the server on every open, it reads from a database on your Mac's drive. That local database can fall out of sync over time — counts drift, message bodies fail to load, whole folders appear empty despite being full on the server — and the Rebuild command resets it. The option lives in the Mailbox menu and applies to one mailbox at a time.

Whether a rebuild is safe depends almost entirely on your account type. For server-based accounts — IMAP, Exchange, and iCloud Mail — the messages live on the server and rebuilding only refreshes the local mirror. For On My Mac local folders, the local copy is the only copy, and a failed rebuild is a data-loss event with no built-in recovery path. This guide covers the mechanism, the steps for macOS Ventura through Sequoia, the differences across macOS and iOS, and what to try when the command does not do what you expect.

Before you rebuild: understand your account type#

The Rebuild command discards the local mail database for a selected mailbox and instructs Mail to re-download everything from the server. Apple Mail downloads messages in two stages: headers first — sender, subject, date — then full message bodies and attachments. Over time, the local database can develop inconsistencies: wrong counts, missing bodies, orphaned attachment references. Rebuild resolves these by deleting the local copy and starting the download again.

For IMAP, Microsoft Exchange, and iCloud Mail accounts, Rebuild is a safe operation. The server holds the canonical copy of every message. Deleting the local cache loses nothing permanent, and Mail re-downloads everything once the rebuild runs. You may briefly see the mailbox appear empty or show a reduced count while the download is in progress. That is expected behavior, not data loss.

For On My Mac mailboxes — the local folders listed under that label in the sidebar — there is no server. The local database is the only place those messages exist. Rebuilding an On My Mac mailbox tells Mail to delete what is there and rebuild from server data. There is no server data, which means the rebuild can end with an empty mailbox and no path back. Before running Rebuild on any On My Mac mailbox, select it, choose Mailbox > Export Mailbox, and save the resulting mbox file somewhere outside your Mail folder. Verify the export opens correctly before you continue.

POP3 accounts add a third scenario worth knowing. POP3 downloads messages from the server and then, depending on settings, may remove them from the server after downloading. If a POP3 account is configured to delete messages from the server after download, Rebuild can only re-download whatever remains on the server at that moment. Messages removed from the server before the rebuild ran are not recoverable through this path.

Check the sidebar before you rebuild

If the mailbox is listed under On My Mac rather than under your Gmail, iCloud, or Exchange account name, it is a local-only mailbox. Export it via Mailbox > Export Mailbox and verify the export opens correctly before running Rebuild. There is no undo once the rebuild deletes the local copy of a local-only mailbox.

How to rebuild a mailbox in Apple Mail, step by step#

The steps below apply to Apple Mail on macOS Ventura, Sonoma, and Sequoia. The menu path is the same across all three versions.

  1. 1

    Quit and reopen Mail

    A fresh launch clears any transient state that might interfere with the rebuild. If Mail has been open for several days, restarting it also frees memory that may have contributed to the sync problem in the first place.

  2. 2

    Select the mailbox you want to fix in the sidebar

    Rebuild acts on one mailbox at a time. Click the specific folder — Inbox, Sent, a label, a subfolder — where the problem is appearing. If you need to fix several mailboxes, you will repeat these steps for each one after the previous rebuild finishes.

  3. 3

    Choose Mailbox > Rebuild from the menu bar

    The command starts immediately with no confirmation dialog. The mailbox may show fewer messages or appear completely empty while the re-download runs. This is normal — the messages are on the server and will return as the download progresses.

  4. 4

    Leave Mail open and active until the rebuild finishes

    Do not quit Mail, close the lid, or put the Mac to sleep during a rebuild. Interrupting the process can leave the local database in a partial state that requires another rebuild to resolve.

  5. 5

    Watch the status bar at the bottom of the Mail window

    Mail shows download activity in the status bar. When activity stops and the message count stabilizes, the rebuild is done. Open a few messages to confirm they display correctly before treating the problem as solved.

How long a rebuild takes scales with mailbox size and connection speed. A small mailbox with a few hundred messages typically finishes in under two minutes on a broadband connection. A large Gmail archive with years of mail and heavy attachments can take an hour or more. Mail downloads progressively, so the mailbox becomes usable before the full download completes — searches may return incomplete results until everything finishes.

Rebuild one mailbox at a time

Starting a second rebuild while the first is still downloading can leave both mailboxes in a partially rebuilt state. Wait for the status bar to go quiet and the message count to stabilize before starting a rebuild on the next mailbox.

Rebuild in Apple Mail across macOS, iOS, and iPadOS#

The Rebuild option in the Mailbox menu is a macOS-only command. Apple Mail on iPhone and iPad does not expose the same control. The nearest equivalents on iOS and iPadOS take a different path and are heavier operations. The table below maps what each platform offers.

PlatformHow to trigger a cache resetWhat it resets
macOS Ventura, Sonoma, SequoiaMailbox > Rebuild from the menu bar — one mailbox at a timeDiscards and re-downloads the selected mailbox's local cache only; does not affect other mailboxes
iOS 17 / iPadOS 17 and laterSettings > Apps > Mail > Mail Accounts > [account] > Account; tap Advanced, change Drafts Mailbox to a different location, save, then switch it backForces a folder structure re-sync; not a full message re-download
iOS / iPadOS — full resetSettings > Mail > Accounts > [account] > Delete Account, then re-add itRe-downloads all messages from the server; local device-only drafts not yet synced may be lost
iCloud.com (web)No local cache to rebuild — iCloud Mail on the web reads directly from the serverIf messages are missing on iCloud.com, the problem is server-side; a rebuild cannot address it

The full-reset path on iOS — deleting and re-adding the account — is heavier than the macOS Rebuild. Your server-side mail is safe for IMAP and Exchange accounts, but any drafts saved only on the device and not yet synced may not survive the re-add. Try the lighter option first — toggling the Advanced settings as described in the table — and save the full account delete for cases where nothing lighter has worked.

What to do when Rebuild is greyed out or messages do not return#

A rebuild that completes without fixing the problem, or a Rebuild option that is greyed out, usually comes down to one of a small number of specific causes. Each has a different fix.

  • Rebuild is greyed out with no real mailbox selected: The command activates only when a standard mailbox is selected in the sidebar — Inbox, Sent, a folder you created, a label. Smart mailboxes and search folders have no local cache and do not offer Rebuild. Click a regular folder and the option will become active.
  • Rebuild is greyed out during an active sync: Mail locks the Rebuild option while a background sync is running. The status bar at the bottom of the Mail window shows activity during a live sync. Wait for it to go quiet, then try Rebuild again.
  • Messages still missing after the rebuild completes: Open the webmail interface for your account — Gmail.com, Outlook.com, or iCloud.com — and check whether the messages appear there. If they do not, the problem is on the server and Rebuild will not help. If they appear on the server but not in Mail after the rebuild, try signing out of the account in System Settings > Internet Accounts and signing back in to force a fresh connection.
  • Wrong message count persists after rebuild: A stale Spotlight index can report a count that does not match what is actually on disk. Quit Mail, wait a full minute, and reopen it. If the count is still wrong, a Spotlight reindex may be the right next step — it fixes the index without replacing the underlying message data.
  • Messages missing on a POP3 account after rebuild: If the account was configured to delete messages from the server after downloading them, a rebuild can only recover what remains on the server at the time it runs. Messages already removed from the server before the rebuild are not recoverable through this path.
Illustration of account settings toggles representing the configuration choices that control whether Apple Mail can rebuild a mailbox and what account type it can recover from
Account type and sync settings determine whether Rebuild is available and what it can recover.

The distinction between rebuilding and reindexing is worth keeping clear. Rebuild replaces the local message data — it is the fix when messages are missing, counts are wrong, or message bodies fail to load. Reindexing regenerates the Spotlight search index over the existing data without touching the messages themselves — it is the fix when messages display correctly but search returns wrong or stale results. If search is the only broken thing, a reindex is faster and considerably less disruptive than a rebuild.

Apple Silicon Macs and search after a rebuild

On Apple Silicon Macs running macOS Sequoia, Mail sometimes fails to index newly downloaded messages until after a full system restart. If search results remain incomplete after a rebuild has finished downloading, restart the Mac before running any further steps.

A different approach to recurring inbox sync problems#

Rebuilding fixes a specific technical problem: the local cache in Apple Mail has drifted from what the server holds. If you find yourself running Rebuild regularly — or if you manage mail across several accounts and frequently lose sync — the problem may be structural. A single-device client that maintains a local message database is inherently more fragile than an approach that does not depend on that local store staying consistent.

We build AI Emaily, an AI-native email client that connects Gmail, Outlook, iCloud, and any IMAP account through server-side sync. There is no local message cache to rebuild or reindex. It is designed around multi-account workflows: a unified inbox that stays current across providers, semantic search over your full archive, and autonomous triage that keeps the most important mail visible without manual maintenance. If sync problems are a recurring pattern rather than a one-off, the 7-day free trial gives you a real look at whether a different architecture makes sense for your setup — see aiemaily.com/pricing for details.

Frequently asked

Nafiul Hasan

Written by

Nafiul Hasan

Nafiul Hasan is an entrepreneur and AI automation system builder with 10+ years of experience turning messy, manual workflows into reliable automated systems. He designs and ships AI enterprise solutions end-to-end — the agent logic, the data plumbing, and the product people actually use — and founded AI Emaily to give busy professionals their attention back. He writes here from the builder's seat: what works, what breaks, and how to put AI to work without giving up control.

EntrepreneurAI Automation System BuilderAI EnthusiastBuilds AI Enterprise Solutions10+ years experience
More from Nafiul
Ready when you are

Done rebuilding — but sync keeps breaking?

AI Emaily connects Gmail, Outlook, iCloud, and IMAP through server-side sync — no local cache to drift or rebuild. Unified inbox, semantic search, autonomous triage. Start a 7-day free trial.

  • 7-day free trial
  • Cancel anytime
  • Every provider