Rebuild mailboxes to fix message handling problems in OS X Mail

MailIconXApple’s Mail program can connect to a number of different e-mail services, including popular ones like Gmail,, and Yahoo, but in addition be configured for custom IMAP and POP services, such as those at work or educational institutions.

While Mail can manage messages from many different accounts and account types, sometimes an error may occur that results in one or more of the following symptoms:

  • Incorrect unread Mail where the number of unread messages does not reflect the total count in the Mail Dock icon badge.
  • Incorrect number of messages Where the count of messages seen in Webmail clients do not reflect those seen in Mail.
  • Messages not displaying content when selected, and instead showing a blank viewer window.
  • Incorrect message content where another e-mail message appears to be showing instead of the selected one.
  • Messages you know should be available are simply missing and cannot be found.

These issues may happen because of the way the program handles messages in various inboxes you have created.

For each inbox in Mail, the program uses an index database file that represents the contents of the mailbox. This database contains references that point to the messages on-disk, but otherwise is used to determine what message file is loaded when you select a message, the number of unread messages, and how many messages are in a given mailbox.

Mailbox Rebuild option in OS X Mail

With at least one mailbox selected, choose this option to rebuilt their indexes (click image for larger view).

Mail relying on this database means that if the database gets damaged, then the symptoms mentioned above may occur, and frustrate your ability to handle messages in your various accounts.

Luckily, Mail includes an option to fix a damaged index file, so you can remedy this problem if it occurs:

  1. Select the mailbox that is giving you problems, or if you are uncertain which, then hold the Command or Shift keys and click additional inboxes to select more than one.
  2. Choose “Rebuild” at the bottom of the Mailbox menu

This routine will delete the current index files, and replace them by reading information from each message in your various inboxes. This process can take a little while to complete, depending on the account types you have and the number of messages in each. You can see the progress of this routine by choosing Activity from the Window menu, or by pressing Option-Command-0 (zero).

5 thoughts on “Rebuild mailboxes to fix message handling problems in OS X Mail

  1. MaX

    What are the specifications of Mail in relation to the maximum number of recommended mailboxes, folders and subfolders on the left pane and the number of messages per mailbox, folder or sulbfolder?

      1. MaX

        Thanks. Well, there were limits in such specifications, at least with previous Apple Mail versions. Such information was at
        but the site seems to have gone. Where are the Apple info documents now?

  2. Pingback: Rebuild mailboxes to fix message handling probl...

  3. Pingback: Rebuild mailboxes to fix message handling problems in OS X Mail | MacIssues | Filemaker Info

Leave a Reply to MaX Cancel reply