MacOS – Mail.app Assumes Google is the Desired Service for a Self-Hosted Domain

macosmail.app

I am migrating from Google Apps for Domains to a self-hosted service. After removing my Google account from Mail, and attempting to add my self-hosted account, Mail and System Preferences always default to Google as the provider for my email. DNS records have been switched (mail flow works fine from my self-hosted service).

Every time I attempt to add a new account, it assumes I want the Google account it discovers and not my personal email.

I have uninstalled Gmail from the Google Apps for Domains control panel, but this has not helped (yet). I have also removed my preferences folder for Mail.app, but this does not help either.

I cannot delete or rename this Google account; other services are attached to it.

Any suggestions?

I had previously thought that by changing the passwords to differ after uninstalling Gmail, it was working. However, while it lets you add a different IMAP account, the type is still "Google IMAP", which causes issues when trying to setup the accounts properly (most notably because I also have a self-hosted CalDAV account).

After further testing, I have found that any IMAP account I attempt to create is set as a "Google IMAP" account once I provide the self-hosted domain (meaning, even if I create it with fictitious information and later supply the domain only when I have to). How can I address this?

Best Answer

I was able to finally resolve this. Here's a simplified version of the breakdown (in a corrected order), in hopes that it is helpful to anyone trapped in this in the future:

  1. Setup the self-hosted service
  2. Switch DNS records to point to the self-hosted service
  3. Ensure your Mac or iOS device is aware of this DNS change (e.g. dig domain.com mx in Terminal returns what you expect to see)
  4. Uninstall Gmail and Calendar from the Google Apps for Domains Control Panel (your data will not be lost; you can reactivate them later)
  5. Remove the Google Apps account from your device
  6. Add a new email account with the correct information:
    1. After clicking "Continue" on the screen where you enter your name, email address and password, immediately press "Cancel", then "Continue" again. This ensures no automatic search for services is done. (Apparently in a different way than holding the option key does...)
    2. On each subsequent screen, hold down the option key when clicking continue and ensure the advanced settings are correct
    3. Confirm the account displays as "IMAP" or "POP" and not "Google IMAP" or "Google POP"
  7. Add any other accounts.

If you experience trouble with the above, verify that you are certain your local device sees the correct DNS information, remove all accounts from Mail and delete ~/Library/Mail.

Hopefully this helps someone else.