Fix Mail’s smart mailboxes not working properly

MailIconYosemiteXIf you use Apple Mail as your e-mail client, then you might find its Smart Mailbox feature useful for organizing your messages. As with the Finder’s smart folders, the smart mailboxes in Mail give you a quick way to access canned searches so you can only see messages from specific dates, from specific people, or in specific accounts. However, while useful, there may be times when smart mailboxes do not work properly, and may not show the contents you expect.

These issues can be simply a matter of delays when loading the contents of a smart mailbox, but can also be a mailbox not showing any messages, showing only a few messages, or even showing messages that do not fit the search criteria you saved.

In attempting to fix such problems with Smart Mailboxes you might find yourself deleting and re-creating them; however, because the problem is not in the smart mailboxes themselves, this usually results in the same behaviors. Therefore, there are generally two faults that can lead to poor search behaviors:

Faulty search processes

In order to quickly search with Smart Mailboxes, OS X has to maintain an index of your drive to categorize its contents. This is done whenever you create or modify any contents of your drive, and should be a quick operation, but sometimes the system services that do this can get stuck. When this happens, searches and the display of contents that require this index may be affected. To fix this issue, you simply need to force these processes to quit, which will free up the index:

  1. Go to the Applications > Utilities folder.
  2. Open Activity Monitor.
  3. Select “All Processes” from the View menu.
  4. Search for “mds”.
  5. Select and quit each instance of “mds” and/or “mdserver” separately (force-quit if you have to).

After doing this, the index will be freed and your Mailbox searches should work faster now. Note that these processes may start back up again (and perhaps do so immediately), which is expected. Allow them to run and index the drive unless they continue to use high percentage of your CPU for lengths of time, and you cannot search for items on your system.

mdworker and mds processes in OS X

Even if they are not currently using any CPU, if your searches are not working then do attempt to quit the various mdworker and mds processes to see if this frees up your ability to search.

Faulty search index

While the mds programs are responsible for building the index, and as such can hijack it when they are not running correctly, if the index itself is having problems then this can be the root cause of both the inability to search, as well as the hangs and other problems that “mds” and “mdworker” are showing. Therefore if the problems persist after clearing these processes, then force OS X to re-index your drive:

  1. Go to the Privacy tab in the Spotlight system preferences.
  2. Go to the Finder and press Shift-Command-C to open the Computer window,
  3. Drag your boot drive from the Finder window to the Privacy list.
  4. Remove the drive from this list after a few seconds.

When done, rebuilding the index may take a few hours, during which the “mds” and “mdworker” processes may use ample CPU power on your system. This may last for a few hours, so allow the system to complete these tasks uninterrupted. When done, Smart Mailboxes and other features that use the system’s indexing services should be far faster and thorough.

Spotlight privacy list in OS X

Drag your hard drives to this list, and then remove them, to have the Spotlight index on each of them be rebuilt.

6 thoughts on “Fix Mail’s smart mailboxes not working properly

  1. xAirbusdriver

    This solution might be helpful in many more situations besides “Smart Mailboxes”, but the title could be better named to suggest that. 😉

  2. Strod

    Step #5 in the section “Faulty search processes” says (emphasis mine):

    5. Select and quit each instance of “mds” and/or “mdserver” separately .

    You meant mdworker, right?

  3. david clifton

    Hi, thank you!!! Tried a few other solutions – eg delete envelope files. No luck. Tried the “delete mds” suggestion – ALL GOOD NOW!!! Much appreciate your great advice – mail search works as it used to.

  4. laarree

    Wow, force-quitting the mds processes worked for me too, just a few minutes ago. Thank you. It’s hard to believe that something so simple did the trick.

Comments are closed.