Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Smart Mailbox not working El Capitan

After upgrading to El Capitan, the smart mailbox I use for Unread Mail is always empty. It also shows that one message is in the folder even when there are no unread messages. I tried deleting and recreating to no avail.

Posted on Oct 8, 2015 9:22 AM

Reply
13 replies

Oct 9, 2015 8:58 AM in response to davesmall

Quit Mail. Force quit if necessary.

Back up all data before proceeding.

If you're running OS X 10.11 ("El Capitan") or later, triple-click anywhere in the line below on this page to select it:

~/Library/Mail/V3/MailData

If you're running an older version OS X, use this line:

~/Library/Mail/V2/MailData

Copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select

Go Go to Folder

from the menu bar. Paste into the box that opens by pressing command-V, then press return.

A folder window will open. Inside it there should be files with names as follows:

Envelope Index

ExternalUpdates.storedata

Move those files to the Desktop, leaving the window open. Other files in the folder may have longer names that begin as above. Move those files, if any, to the Trash.

Relaunch Mail. It should prompt you to re-import your messages. You may get a warning that the index is damaged and that Mail has to quit. Click OK. Typically, the process takes a few minutes, but it may take hours if you have gigantic mailboxes. In that case, you may be able to speed things up by temporarily adding your home folder to the Privacy list in the Spotlight preference pane. Remove it when Mail has finished importing.

If the import operation stalls or fails with an error message, quit Mail, delete the two new index files (keeping the original ones that you moved to the Desktop), and try again. According to many reports, the second attempt may succeed after the first one has failed.

Test. If Mail now works as expected, you can delete the files you moved to the Desktop. Otherwise, post your results.

Oct 9, 2015 10:53 AM in response to Linc Davis

Hmmm? That didn't solve the problem.


Looking at that folder, it seems I've now got multiple index files as follows:


Envelope Index

Envelope Index-shm

Envelope Index-T0x7fe5db801ae0.tmp.rierPZ-shm

Envelope Index-T0x7fe5db801ae0.tmp.rierPZ-wal

Envelope Index-wal

ExternalUpdates.storedata

ExternalUpdates.storedata-shm

ExternalUpdates.storedata-wal

Oct 9, 2015 1:42 PM in response to Linc Davis

Searches seem to work fine. I don't think Spotlight is involved.


The problem seems to have spread to some other mailboxes. Now the iCloud inbox is showing a numeral 1 but there are no unread messages in that mailbox.


The Outbox is also showing the numeral 1 but nothing in it


The iCloud Junk mailbox is showing the numeral 1 but nothing there either


This is the same thing that's been happening with my Unread Mail smart mailbox.


Thanks for your help

Oct 9, 2015 3:36 PM in response to davesmall

Please read this whole message before doing anything.

This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.

The purpose of this test is to determine whether the problem is localized to your user account. Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”

While logged in as Guest, you won’t have access to any of your documents or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this behavior; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.

Test while logged in as Guest by setting up one of your mail accounts. Same problem?

After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.

*Note: If you’ve activated “Find My Mac” or FileVault in OS X 10.7 or later, then you can’t enable the Guest account. The "Guest User" login created by "Find My Mac" is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.

Oct 16, 2015 10:55 AM in response to Linc Davis

Linc - I was sidetracked by a bout with the flu and didn't try your guest login suggestion.


I did solve the problem, or at least worked around it, by making a change to the smart mailbox search criteria.


It had been set to search all messages for Unread Messages. The mailbox would then show the numeral "1" indicating that there was one unread message. However, there was never any message in the mailbox. When new mail was received, the numeral would show the correct number of new unread messages plus 1. None of these messages would be visible in the Unread Messages smart mailbox though.


The workaround was to add another item to the search criteria as follows:

-> Message is Unread, and

-> Date Received is in the last 30 days


Once I added that 30 days requirement, the mysterious numeral "1" disappeared and the new unread messages became visible in that smart mailbox.


You probably have a better idea than I do as to why this worked. My guess is that there is a damaged message somewhere in the database that is confusing the smart mailbox search routine. I deleted the indices and once again imported all the messages several times, which didn't solve the problem. Rebuilding was also tried multiple times and didn't work either.


Thanks for your help


Dave S

Smart Mailbox not working El Capitan

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.