Steve Price wrote in with a question about alphabetic sorting of macOS Mail’s mailboxes, and then, shortly after, a solution! (Which is always welcome, dear readers, as I can then share them widely with others).
Steve followed Chris Breen’s advice at Macworld in 2014 about alphabetizing his mailboxes, but it didn’t work. The mailboxes were in A to Z order at iCloud.com, however. He dug around in forums, found a solution, tried it, and it worked. I’ve modified and expanded on his advice.
If you’re using IMAP and have all your messages stored on a remote server, you shouldn’t be able to delete those messages through this process. If you have locally stored mailboxes, make sure they’re archived via Time Machine or other backup software.
- In Mail, use Mail > Preferences > Accounts to select and disable (uncheck the Enable This Account box) for whichever account you want to fix mailbox alphabetization.
- Quit Mail.
- In Terminal, type
cd ~/Library/Mail/V4/
and press Return. - Figure out which directory corresponds to the email account you want to delete (see below).
- Type
cd
plus a space plus a few letters of that directory and then press Tab to fill in the rest. Press Return. - Now type
rm .mboxCache.plist
and press Return. - In each
.mbox
directory, you need to delete a file namedInfo.plist
. You can either do this by typingcd
plus the mailbox name (or first few characters and press Tab), then Return, thenrm Info.plist
. - Empty the Trash.
- Launch Mail and re-enable the account or accounts in question.
To figure out which directory or folder corresponds to the account you want to fix, you need to look at the mailboxes inside and see how they match the ones in Mail. In earlier versions of Mail, each folder was named distinctively with the account name, which I still have for one of my accounts.
For step 7, above, you can also use the Finder:
- Select Go > Folder.
- Enter
~/Library/Mail/V4/
and press Return. - Open the folder that corresponds to your account (as determined in step 4 above and instructions below).
- For each mailbox folder, click the expand triangle next to its name and then delete
Info.plist
.
You can streamline step 7 if you’re very comfortable with the Terminal and also can cope with recovering files if you make a mistake. If you make a mistake, you could delete many files. While within the account directory in Terminal you determined in step 4 above, copy and paste the following command, which looks into every directory below the level you’re at and deletes the Info.plist
file if found. It prints out a line for each file it deletes.
find . -name Info.plist -print -exec rm {} \;
You can test the command by omitting everything after -print
, and it will preview which files would be deleted.
Ask Mac 911
We’ve compiled a list of the most commonly asked questions we get, and the answers to them: read our super FAQ to see if you’re covered. If not, we’re always looking for new problems to solve! Email yours to mac911@macworld.com including screen captures as appropriate. Mac 911 cannot reply to email with troubleshooting advice nor can we publish answers to every question.