Exchange account in Mail has wrong username, but is not editable I recently set up a new iMac running Yosemite (10.10.1). After I signed into my iCloud account, my mail/calendar/contacts accounts were set up for me; so far so good.

The problem is that in Mail.app one of my accounts, which is Exchange-based, has the wrong User Name value -- it's got "jens" instead of "jens@example.com". This of course means Mail can't log into the account; if I enable it I just get endless enter-your-password dialog boxes.

The real problem is that I can't fix the first problem -- the User Name field in the account settings in Mail prefs is disabled! (So are many of the other fields like Email Address and Internal Server.) Maybe this is because the account is managed by the Internet Accounts system pref? But my other account, which uses IMAP, does have an editable User Name field...

What's even stranger is that the Calendar and Contacts apps can log into the Exchange server just fine, and if I look in their prefs for the account settings, they've got the correct username. It's only Mail that's got it wrong.

What I've tried so far:


Delete the Exchange account -- this pops up a stern warning that the account will be removed from all my other devices that use iCloud Keychain. No way; I don't want to risk screwing up email access on the other Mac and iOS devices where it's working fine!
Configure a new Exchange account to connect to the same server -- this doesn't work. Apparently Mail's new-account assistant realizes that there's already an account with this server/username and reuses it instead of creating a new one.
Find where the username is stored in Mail's user defaults and edit it -- I haven't been able to find it. Looks like Mail's storage of user defaults or accounts has changed a lot since the olden days, both due to sandboxing and to iCloud.
Look online for other people with my problem -- haven't found anything on Apple's (useless) support community site or here.
I've been looking for an answer to this as well. Here's how i resolved it.

I found the file that stores the username in ~/Library/Accounts/Accounts3.sqlite. I used the sqlitebrowser app from http://sqlitebrowser.org/ to open it.


Drag and drop Accounts3.sqlite to the dock icon to open the file.
Click the Browse Data tab.
Change the Table to ZACCOUNT.
I used the ZACCOUNTDESCRIPTION field to determine the right row to make the change.
Update the value in the ZUSERNAME field.


For me, entering the full email address didn't work. I used domain\user instead.