Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macstatic

macrumors 68020
Original poster
Oct 21, 2005
2,029
168
Norway
I've unfortunately messed around with Keychain (because the spinning beachball appears a lot, for no apparent reason, and I read about how the keychain can be the cause of this), deleting stuff I thought was OK.

Now I'm having problems with Mail app asking me for account passwords which apparently won't work despite being the correct ones, such as in this error message:
 cantconnect.png


I suspect the error to be within the Keychain and since I don't have a lot of passwords etc. on this particular Mac I'm OK with starting from scratch again. I've been searching around for info on how to completely reset Keychain, but so far only found instructions on how to fix particular things within it (time consuming!). There are lots of untrusted and expired certificates as well, and a bunch of certificates with the same name.
Is there a quick and easy way to "factory reset" the Keychain?
Can I simply delete the entire keychain folder (~/Library/Keychains/), log out, the log in again?
I'm on MacOS 10.13.6 (High Sierra).
 
Last edited:
Can I simply delete the entire keychain folder (~/Library/Keychains/), log out, the log in again?
I'm on MacOS 10.13.6 (High Sierra).
Don’t do that. Most likely, you will not be able to login again.
Make a new user instead.
 
Oh no, that's quite a lot of work moving all the files, settings etc. over to the new user.
So there's no quick fix for this?
 
I was wrong. I’ve tried in a High Sierra virtual machine and the folder ~/Library/Keychains/ was recreated. I don’t know if that will fix anything for you. Make a copy of the folder, just in case.
 
I solved it!
I first started up in "safe mode" (hold SHIFT while booting), disconnected Internet-access (so it wouldn't fetch more mail in the meantime), disabled (renamed) the mentioned Keychain folder as well as the mail folder.
Then I attached a backup drive (not a very recent backup, but for this situation it didn't matter because these were files that don't change much and I'd fetch any missing mail from the servers anyway), and copied over both the Keychain folder and the Mail folder.
I also copied over the preference files for Keychain and Mail, overwriting the existing ones.
Here are the locations of the above:

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

Finally I rebooted into the normal, enabled Internet access again, checked my mail and.... it worked! :)
So that's good for now, but at some stage I really need to figure out why I'm getting so many beachballs despite having an SSD (which checked out fine when tested in Disk Utility) and a hardware test also checked out fine.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.