Where Mail Stores Everything

Apple Mail is deceptively simple on the surface and intricate underneath. Every message, every attachment, every read/unread flag and every search index lives inside a single folder in your home Library: ~/Library/Mail. For heavy users this folder can balloon to fifty, a hundred, even two hundred gigabytes with no visible warning in the app itself.

Inside you will find a folder for each major macOS version (for example V10), and inside that a folder per mail account named after the UUID assigned when the account was created. Each account folder in turn contains Data, MailData (search indexes and sync state) and a hierarchy of .mbox directories that represent your inbox, sent items, archives and custom folders.

You do not need to touch any of this directly. Mail has excellent built-in maintenance tools if you know where to look. The rest of this guide stays inside the Mail app and never recommends editing files inside ~/Library/Mail by hand.

πŸ›‘
Treat the Mail folder as off-limits

Do not delete files inside ~/Library/Mail while Mail is running, and never modify .mbox contents in Finder. Mail caches this state in memory and will overwrite your changes β€” or corrupt the mailbox β€” the next time it saves.

Rebuilding Mailboxes to Fix Indexes

The single most effective maintenance action in Apple Mail is Rebuild. It discards the local copy of a mailbox and re-downloads headers and messages from the server. This fixes stuck unread counts, corrupt search indexes, missing messages and most Mail performance complaints.

  1. Make sure the account is IMAP, Exchange or iCloud (POP accounts cannot be rebuilt β€” see below).
  2. Select the mailbox in the sidebar β€” Inbox, Sent, Archive or a nested folder.
  3. Choose Mailbox β†’ Rebuild.
  4. Wait while Mail clears the local cache and re-syncs. Depending on mailbox size and server speed, this is anywhere from thirty seconds to several hours.

For users who complain that search returns nothing for recent emails, a rebuild of the inbox and sent mailboxes usually restores it immediately. If a rebuild appears to hang, quit Mail from the Dock and reopen β€” Mail saves rebuild state between sessions and will resume where it left off.

πŸ’‘
Rebuild before you contact support

Nine out of ten 'Mail is broken' calls to our workshop are solved by rebuilding the affected mailbox. Try it before you spend an evening in Preferences β†’ Accounts.

Erasing Deleted and Junk for Good

Deleting a message in Mail moves it to Trash. Emptying Trash moves it to the server's Deleted Items folder β€” which, depending on provider, may keep the message for 30 days, 90 days, or forever. Meanwhile Mail still holds a local cache of everything that ever passed through, including attachments.

  1. From the menu bar, choose Mailbox β†’ Erase Deleted Items β†’ In All Accounts.
  2. Then choose Mailbox β†’ Erase Junk Mail.
  3. If your provider offers a Spam and Trash folder in the sidebar, right-click each and choose Erase Deleted Messages.
  4. Finally, go to Mail β†’ Settings β†’ Accounts, pick each account, open the Mailbox Behaviours tab, and set Trash to erase messages after thirty days β€” or sooner.

This one maintenance pass regularly recovers one to ten gigabytes on busy mailboxes.

Smart Mailboxes as Your Inbox

Smart Mailboxes are to Mail what Smart Folders are to Finder: saved searches that look like folders. They are purely local and do not touch the server, but they are the fastest way to filter a messy inbox without permanently moving anything.

Useful starters:

Create them via Mailbox β†’ New Smart Mailbox. Any combination of From, To, Subject, Contains, Date, Attachments and Flags can be combined with AND/OR logic. They refresh in real time and cost nothing in disk space.

Attachment Management and Downloads

Attachments are where Mail consumes the most disk space. By default Mail downloads every attachment the moment a message arrives β€” even on 50 MB graphics files you never asked for. You have two levers to control this.

Control automatic downloads

Open Mail β†’ Settings β†’ Accounts, select each account and go to the Account Information tab. Change Download Attachments from All to Recent or None. Recent fetches attachments only for messages from the last week or two; None requires a double-click to download, saving bandwidth and storage.

Use Save Attachment, not just Preview

When you receive a file you need, right-click and choose Save Attachment… to copy it to Documents or Downloads. Then delete the original email or move it to an archive folder. This keeps the file but removes it from the live Mail cache.

Hunt for the big offenders

Create a Smart Mailbox with criterion Attachment size is greater than 10 MB. Sort by date, open the biggest ones, save anything you still need and then delete the message. A single afternoon of this reclaims double-digit gigabytes on most work mailboxes.

Exporting Old Mailboxes to Archive

Mail has an underused feature: you can export any mailbox to a stand-alone .mbox file that is independent of the Mail app. This is the correct way to archive a project, a former employer or an old year of inbox without losing anything.

  1. In Mail, right-click the mailbox you want to archive and choose Export Mailbox….
  2. Pick a destination on an external drive or your Documents folder.
  3. Mail writes a .mbox package containing every message, every attachment and every header.
  4. Verify by double-clicking the exported file β€” it will import into Mail as a stand-alone mailbox under Import. Open a few messages to confirm they are intact.
  5. Only then can you safely delete the original mailbox from the server.

The exported .mbox files are plain text under the hood, which means they will still be readable in twenty years' time regardless of which email client you switch to.

IMAP vs POP and Why It Matters

Not every Mail performance problem is Mail's fault β€” sometimes the mail protocol itself is to blame. If you still have a POP (Post Office Protocol) account, every message is downloaded to your Mac and typically deleted from the server after. This means your entire mail history lives inside one Mac, with no server backup.

ProtocolWhere messages liveSync across devicesRecommendation
IMAPServer, cached locallyYesDefault for Gmail, iCloud, Outlook. Keep.
Exchange / EWSServer + calendar + contactsYesStandard for corporate accounts. Keep.
POPLocal only (usually)NoMigrate to IMAP if your provider supports it.

If you have a POP account and your Mail is sluggish, it is almost certainly because the local .mbox is enormous. Export the mailbox for safe-keeping (see above), then either migrate to IMAP or split historical messages into year-based mailboxes to keep the active set small.

Rebuilding Mail's Local Cache

When Mail genuinely is broken β€” search returns nothing, mailboxes refuse to load, the app spins on launch β€” a full cache rebuild can rescue it without re-adding every account. The approach is simple but requires patience.

  1. Quit Mail completely from the Dock (right-click β†’ Quit).
  2. In Finder, press βŒ˜β‡§G and go to ~/Library/Mail/V10 (or the highest-numbered V* folder on your macOS version).
  3. Inside, you will see folders for each account and a MailData folder. Move the MailData folder to the Desktop (do not delete yet).
  4. Open Mail. It will rebuild indexes, re-check account settings and re-create MailData. This can take an hour on a large mailbox.
  5. Once Mail is working and search is restored, you can delete the MailData folder from the Desktop.
⚠️
Back up before any Library surgery

Even this well-known rebuild should be preceded by a Time Machine backup. If something goes wrong, dragging the old MailData folder back and relaunching Mail restores the previous state.

A Quiet Monthly Maintenance Routine

The Mail tidy-up that sticks is short and unremarkable. Once a month:

  1. Erase deleted items in all accounts.
  2. Empty Junk.
  3. Open the Attachments > 10 MB Smart Mailbox and clear out anything saved elsewhere.
  4. If an account feels slow, rebuild its inbox.

That is enough. If you are wrestling with other symptoms of a slow Mac β€” long logins, spinning beachballs, runaway background processes β€” our startup optimisation guide and general storage cleanup cover the other usual suspects. And if the Mail folder has grown into something scary and you would prefer not to debug it yourself, our London technicians can run the full rebuild and archive workflow on-site with a verified backup first.