If 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.
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:
- Go to the Applications > Utilities folder.
- Open Activity Monitor.
- Select “All Processes” from the View menu.
- Search for “mds”.
- 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.
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:
- Go to the Privacy tab in the Spotlight system preferences.
- Go to the Finder and press Shift-Command-C to open the Computer window,
- Drag your boot drive from the Finder window to the Privacy list.
- 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.