Mail gone after clean install of El Capitan After a few days of using El Capitan I decided to do a clean install today.
As always I backed up ~/Library/Mail and put it back after the clean install.

When I opened Mail after that, there were no accounts, no local mailboxes, no mail!

Since the I tried to restore every file that could be associated with Mail I could find from a TimeMachine backup:

~/Library/Mail
~/Library/Containers/com.apple.mail
~/Library/Preferences/com.apple.mail-shared.plist


Nothing has changed from that.



My Mails and Mailboxes are located in:

~/Library/Mail/V3


My Accounts are stored in the only file left in V2:

~/Library/Mail/V2/MailData/Accounts.plist


But Mail seems to ignore the whole ~/Library/Mail folder. Any ideas what I could do?
I decided to restore my mails by hand. That took me a few hours, but now I am back to normal.

Here is what I did:


Import every local mailbox from the backup
Clean up the mail boxes (Cryptic folders were generated inside every mailbox)
Add the POP accounts.
Write mails from there to get a dedicated "send" folder for each account.
Put the imported mails in the appropriate location (inbox, drafts, sent)
Add the IMAP accounts.


What I realized after going through all those steps, is that the accounts inside of ~/Library/Mail/V3 are not named by there account names anymore. Instead the consist of a cryptic combination of numbers and characters. Maybe that was the cause why Mail did not import anything.

My guess is, that accounts are now referenced by a number/character-code out of security reasons. However, that leaves me wondering how to do a proper backup of mail for a clean install.