Mail Connection Doctor still attempting to access deleted Mail accounts

accountsemailmail.app

I was testing some email servers and added several email accounts to my Mac. I deleted these accounts afterwards.

Now I have only three base accounts in System Preferences > Internet Accounts: Facebook, Twitter and iCloud.

System Preference Internet Accounts

However, Mail Connection Doctor (Window > Connection Doctor) still attempts to access the deleted accounts; if one of them has invalid credentials or settings it reports "Mail can't connect to the account."

Connection Doctor

Where these accounts are stored and can I permanently remove them so the Mail Connection Doctor doesn't try to connect?

Best Answer

These accounts are stored in Keychain Access application and in servers list. To remove these accounts permanently, do following:

  1. Open (Mail > Preferences > Accounts)
  2. Select "Edit SMTP server list" from "Outgoing Mail Server" menu

enter image description here

  1. Edit server list

Then remove accounts from Keychain Access:

  1. Close Mail
  2. Open Keychain Access
  3. Select "login" in Keychains section
  4. Select "Passwords" in Category section
  5. Type deleted account name in Search field

There should appear several records, but you need only com.apple.account.SMTP.xxx and/or com.apple.account.IMAP.xxx entries with "application password" in Kind column.

enter image description here

Select and delete them. Open Mail and check Connection Doctor. There must remain only existing accounts.