How to remove 'phantom' iCloud account from Apple Mail
Solution 1:
The list of accounts is stored in the property list located at:
~/Library/Mail/V2/MailData/Accounts.plist
The account data itself is stored in ~/Library/Mail/V2/<account-type>-<email-address>
.
This entire folder can be deleted for the account you wish to remove.
Solution 2:
I came here while trying to solve the same problem (I think) and after like 45 minutes of messing around to no avail (including trying to delete all program data and return to factory settings), grgarside's answer put me on the right track.
To remove my unwanted iCloud duplicate account, I first did as grgarside suggested, and deleted the folders in Library/Mail/V2 that corresponded to the accounts I wanted to get rid of. This didn't remove the accounts from the Mail interface, so I tried deleting the Accounts.plist file - this removes all accounts I had configured, though, and I didn't want that - I wanted to ensure that the correct iCloud account was ONLY added by the iCloud pane in system preferences, to prevent any more duplicates.
In the end, I opened the Accounts.plist file in a text editor and removed all information pertaining to the unwanted accounts. The .plist format is very easy to read, so this is not very difficult at all – but I do recommend you use a text editor capable of highlighting matching tags in an XML file.
The part you're looking for begins with the following:
<key>MailAccounts</key>
<array>
the next thing you'll see is a <dict>
tag. This is the beginning of an individual account 'object'; all information for each account will be between <dict>
and </dict>
tags. Find the 'block' that seems to correspond to the account you don't want, and delete everything from the <dict>
to the </dict>
, including the tags themselves. Be careful though, because there's another set of tags nested inside to contain info about the vendor of your email account - you want to be sure you're selecting the matched outer pair.
Having done this, I was able to load up Mail again, and the unwanted accounts were gone. The remaining accounts were working fine.
P.S. If I have forgotten to delete some other trace that will come back to bite me, please let me know/edit this post. But so far, so good.