How to use MX records to make use of Gmail mail server
This article (https://linode.com/docs/email/using-google-apps-for-email/) states "The process for forwarding your email to Google’s servers is a matter of redirecting the MX DNS records which govern email routing to Google’s email servers." Then the article duly explain how to add the MX records. All very fine…
I am seeking examples of what the MX records for Gmail enable exactly?
1) For in-bound messages to the Linode server. (are they redirected to a Gmail account with the same username?)
2) For out bound messages.
I am particularly confused about the out-bound case because there is a second article (https://linode.com/docs/email/postfix/configure-postfix-to-send-mail-using-gmail-and-google-apps-on-debian-or-ubuntu/) which makes no mention of needing MX records. The instructions are to connect directly to Gmail. I tried a similar setup with PHPMailer and it worked fine … using Gmail to transport emails.
Worse (to add to the confusion) I say one comment that said you don't even need Postfix to send your mails via Gmail, just add the Gmail MX records to your DNS!
I really appreciate if someone can provide the simplest possible example of how to send/receive emails via Gmail/MX records. What minimal mail client is needed and how to configure it…
2 Replies
The answer depends on whether you want to use Gmail as a relay, or whether you're looking to use G Suite to handle all of your mail.
In the first case, Google has an official guide on relaying emails via SMTP.
For the second one, you'll only need to set up MX records to redirect incoming mail to Google's servers. All outgoing mail will be handled by Google's servers so there's no need to set up anything on your Linode. There's an official guide on which MX records to use here.
@mjones Thank you for prompt and informative reply. I read the guides.
The second option is what interests me and I think I am close … so to test my understanding with example below..
I have a domain name (say FQDN is "abc.mycompany.com") registered with DNS pointing to my Linode IP.
I set up Gmail accounts for users "john", "mary", "tom" etc and add DNS MX records to resolve "abc.mycompany.com" email addresses to Google mail servers and backups.
From then on I effectively have email addresses john@abc.mycompany.com etc.
This all boils down to having Gmail accounts under the same name as Linode DNA name. Correct?
Thank you for your patience.