By default, Apple Mail displays folders in alphabetical order for IMAP accounts. However it also supports manual ordering of folders by drag-and-drop (which could occur accidentally) and once one folder has been moved manually all subsequent new folders will be added to the end of the list.
Before resetting this ensure that Mail is closed. The file controlling this behaviour is hidden by default, so first you will have to unhide it.
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
[username]/Library/Mail/[name of your email account]/Where [username] and [name of your email account] are specific to your setup
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
Opening Mail again, you will find that new mail folders will be added alphabetically (until such a time as they are manually moved again).
Please suggest an improvement
(login needed, link opens in new window)
Your views are welcome and will help other readers of this page.
This is question number 2555, which appears in the following categories: