Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Unable to delete mail account

I had a few errors in my Mail account set ups, but I am unable to start from scratch because I keep getting this error on multiple accounts:


The account could not be removed


Account removal failed with error: “The operation couldn’t be completed. Unable to find an account for the UID given.”.


You can try deleting the account from the “Internet Accounts“ preference pane in System Preferences.


However, it is not listed under my Internet Accounts in System Preferences.

Any help would be greatly appreciated!

MacBook Pro, OS X Mavericks (10.9)

Posted on Oct 28, 2013 1:32 PM

Reply
29 replies

Oct 28, 2013 3:30 PM in response to meglizwake

I have the same error and a similar set of circumstances.


I have two iCloud accounts in Mail. When Mail tries to connect with one of them ([username]@icloud.com), it asks me to put in my password. When I put it in, I get a new error message: This Mac can't connect to iCloud because of a problem with '[username]@icloud.com'. Open iCloud preferences to fix this problem.


When I open iCloud preferences it is not evident what I am supposed to do to fix the problem.


Because I don't use either iCloud account, I selected the single iCloud account that both e-mail addresses (one @icloud.com, the other @mac.com) are connected to and deselected Mail. Then I restarted my computer. Then I deleted the two accounts from Mail. No problem.


But unfortunately, the next time I restarted my computer and then opened Mail, both of those accounts were back. According to iCloud preferences, I am not syncing Mail with my iCloud account. When I tried to delete the two accounts from Mail again I got the same error that meglizwake got.


One more thing: to suppress the error messages, I deselected "Enable this account" from the preferences for each iCloud account in Mail. Unfortunately, when I quit Mail and then launch it again, the two accounts are enabled again, and the error messages resume.


Lastly, this started when I upgraded to Mavericks.

Oct 29, 2013 4:03 AM in response to meglizwake

Hi guys


I had the same issue in Mavericks and I just bought a new Macbook Pro Retina 15" and migrated my old stuff during setup directly from my old mac..

Eventually I figured out that Mail.app was storing some bogus data in the app cache. This means the account doesn't actually exist, it's only in a temporary "cache" or "application container" that's used for restoring apps and their windows (new feature since Mountain Lion).


First, quit Mail.app.


Method 1:

The fix is simple. Go to:

1. /Users/YOURUSERNAME/Library/Containers/

2. delete the folder com.apple.mail


Method 2:

1. Open Terminal.app

2. rm -rf /Users/`whoami`/Library/Containers/com.apple.mail


That should do it. When I launched Mail.app all my accounts and emails appeared exactly like I left them.

Oct 29, 2013 8:14 AM in response to coryhart

Hi Cory


I don't really know what causes the error. My best guess is that Mail thinks you have an account that you really don't have (it's not in System Preferences -> Internet Accounts). This would be a "ghost" account, which would explain why Mail cannot delete it (it tries to actually delete it instead of just discarting the ghost item).


How many accounts do you have in Mail? Did you set them up again? Do you have an accounts in Internet Accounts? I created a bogus "test" account since Mail kept asking me to create one when I launched it, even though I knew I already had set up several. It just didn't see them and would not let me past without creating one.

I also deleted my Mail preferences via the terminal by doing:

defaults delete com.apple.mail


Remember: make sure Mail is closed before doing anything.


I had to set up my toolbars again, but that was a small price to pay for getting my mail accounts working.


BTW meglizwake: Once I got Mail and running, I had empty inboxes. I fixed it by going into Mail -> Preferences -> Accounts and then disabling the accounts, reenabling them and right clicking each inbox and selecting "Synchronize". Then all mail turned up, all accounts worked and I threw a little party 😎.


Best,

Seph

Oct 29, 2013 8:41 AM in response to scarlac

scarlac, you sent me a lot of questions here, but before I answer them individually I want to point something out.


After I deleted the com.apple.mail folder I launched Mail again. I changed the setting on another account. (It had a mistaken setting that was unrelated to the iCloud problem. It was an easy fix.) Then I quit Mail and launched it again. The change I made to that other account was not preserved.


So, the "Unable to find an account for the UID given" is a problem. But the bigger problem (maybe incorporating the error message problem, maybe not) is that no change that I make to anything in Preferences > Accounts is saved when I quit Mail. I experience this problem both with my old com.apple.mail folder and with a freshly created one.

Nov 2, 2013 4:05 PM in response to coryhart

I had the same issue with the settings. I tried deleting all the settings files I could come near like in Library/Preferences/com.apple.mail*.plist

That never fixed the problem... UNTIL i restarted. Apparently, you have to quit mail, delete some settings and containers and whatever and THEN restart. Perhaps some caches were saved somewhere.


The thing is, I truly don't know how to solve the problem entirely. I just shared what worked for me. I hope you have figured it out by now. And if you have, the internet (someone reading this in the future) would appreciate if you share what you did to fix it 😉

Nov 17, 2013 7:57 PM in response to scarlac

scarlac, no luck. Nothing works—not deleting ~/Library/Containers/com.apple.mail, not deleting .../com.apple.MailServiceAgent, not deleting any other Mail-related caches and preferenced stashed around, not deleting .../com.apple.internetaccounts.


I also experimented by going into the Internet Accounts system preferences and deleting every account. Then I rebooted. On reboot the deleted accounts came back on their own. The only thing that didn't come back were some of the mailboxes in Mail (well, sort of—see here for more detail).


The bottom line is that I still cannot change any of the accounts in Mail so that those changes survive the relaunch of the app.

Unable to delete mail account

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.