How to Sort New Folders Alphabetically in OS X Mail

emailmacosmail.app

I am running OS X Yosemite and Mail v8.2. Every time I add a new folder, Mail puts them to the bottom folder structure. This is very confusing and I have to go through all folders all the time to find my stuff. I would like the mailboxes to stay in alphabetical order. How can I do that? This was just working fine in previous version.

Any good solution? Disable and Enable the IMAP account is not option.

Best Answer

Steve Price's answer pointed me in the right direction. I'm running El Capitan, and found the .mboxCache.plist files under /Users/my login/Library/Mail/V3. The file is a text file, and can be edited with a text editor (after closing the mail program).

For folders appearing in the wrong place, the problematic entries are as follows:

                    <key>MailboxDisplayIndex</key>
                    <integer>0</integer>

The value "0" puts the folder at the beginning, higher values go later in the list.

If you simply remove the two above lines for any folder appearing in the wrong place, and restart Mail, those folders will go back to being sorted alphabetically.

Sometimes the following two lines also appear in combination with the above:

                    <key>MailboxIsManuallySorted</key>
                    <true/>

In those cases, I changed "true" to "false".

Now my folders are back where I want them, yay!