2

I've recently updated from macOS 10.15 to Big Sur.

Generally everything works, apart from the search tool in macOS's native Mail.app: when I try to search for an email, phrase, contact etc, half the time i get 0 results, or the search query does not impact the results eg nothing changes / is search for.

Ive got multiple email accounts setup in mac mail. Some gmail, some google apps for business, some IMAP provided by 3rd party web host.

The accounts / mailboxes range in size from c. 1GB - 20GB and there is one large mailbox of c. 90GB

The problem is most pronounced on the gmail / google apps for business accounts.

This never used to happen on 10.15 (or other previous versions of Mac OS / OSX for that matter)

Any ideas?

What i have tried to date :

  • rebuilding the accounts as per user Jaume's suggestion
  • deleting the accounts and re-adding them

In both instances this helped seemed little a first, but after a while the issue was back to where it was before. If i was to speculate i would say its almost as if the issue is caused by one of the following :

  • mac mail not caching the emails so when you search its running a full search of the mail server

  • mac mail not indexing the emails correctly

5
  • 1
    I've run into similar issues a couple of times, rebuilding the mailboxes fixed it (select all folders and run Mailbox > Rebuild. You may want to test it first by selecting one mailbox, for example, your infox, rebuilding it and checking if search works).
    – jaume
    Nov 19, 2021 at 8:00
  • @jaume thanks ill give it a try.. ive noticed when i click rebuild i dont get any confirmation / progress indicator.. that the mailbox is being rebuilt ? How long should it take to rebuild a 10GB mailbox ?
    – sam
    Nov 19, 2021 at 15:54
  • You should see "Downloading Messages" at the bottom of the mailbox list (press Shift-Command-M to show it). A 10GB mailbox will take a while, because all messages will have to be downloaded, that's what rebuild means in this context. That's why I recommend that you rebuild one mailbox first and check if it fixes the issue.
    – jaume
    Nov 19, 2021 at 16:05
  • @jaume would it show up in the same place as the "checking for mail" message appears when you click get mail ? If so rebuild donst show anything there for me. Do you think deleting the mailbox and re adding it as a "new account" would effectively do the same thing ?
    – sam
    Nov 19, 2021 at 16:09
  • Yes, that's right, that's the place ... it's weird Mail doesn't show anything. Removing and re-adding the account should have the same effect, but I would recommend that you first create a temporary account on your Mac, log in with that new account and add your mail account to Mail. If everything works, you can proceed on your main Mac account.
    – jaume
    Nov 19, 2021 at 16:19

1 Answer 1

3
+125

I would suggest forcing a rebuild of the underlying Spotlight search index.

Stop and flush indexes : sudo mdutil -i off -E
Restart indexing : sudo mdutil -i on -E

Next, you need to clear the Mail.app indexes in ~/Library/Mail/V7/MailDatafor macOS Catalina. On macOS Big Sur, it will be ~/Library/Mail/V8/MailData. From Finder > Go to folder, enter ~Library/Mail/V7/MailData or ~/Library/Mail/V8/MailData. You’ll see some Envelope Index files; drag them to the Trash, then empty the Trash.

Reboot and then launch Mail.

2
  • Thanks, couple of questions. 1) your start / flush and restart index commands are the same, is that correct ? 2) Once start / flush and restart index is done in terminal can i move straight to the next step or should i wait for the index to complete ? 3) will deleting the mail app indexes delete my local copy of the emails themselves ?
    – sam
    Jun 25 at 18:35
  • Apologies, yes that was a typo. The first command should turn it off and the second should turn it back on. I've edited the post for that change. You can move to the next step after the terminal steps. No it shouldn't delete the emails, just the generated indexes of them.
    – mcmar
    Jun 27 at 13:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .