16

I have recently acquired a domain name via Google Domains. I have set some configuration to have it point at an OpenShift application via Cloudflare. Cloudflare requires me to set their DNS servers, which I did in Google Domain.

At Cloudflare, I have created two CNAME records (and nothing else). One is an alias from my mydomain.com to some.url.at.openfshit.com, and the other is from www to mydomain.com.

Yet, within Gmail Domain, I have also set an email using my domain name which is to be forwarded to a private email. But, I don't receive any emails when testing.

I am wondering whether I could have my emails forwarded properly. Is it a matter of creating a MX record at Cloudflare? If yes, with what configuration?

P.S.: I have set a MX record using instructions available here, but I get:

Delivery to the following recipient failed permanently:

 contact@mydomain.com

Technical details of permanent failure: Google tried to deliver your message, but it was rejected by the server for the recipient domain chartvibes.com by aspmx.l.google.com. [2607:f8b0:4001:c20::1b].

The error that the other server returned was:

550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1  https://support.google.com/mail/answer/6596 p123si522326ioe.111 - gsmtp
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
  • You can just use https://forwardemail.net. It's completely open source, private, encrypted, and free. –  May 08 '19 at 19:36

2 Answers2

13

The MX records you're using are for G Suite accounts. You can still forward emails with Cloudflare and Google Domains, but you'll need different MX records. As Overdrivr pointed out in a comment below, you can find your MX records in the DNS settings in Google Domains. Once you're in the DNS settings page, look for a collapsible panel called "Email forward" under the "Synthetic records" section. You should see something like this

Then, make a backup of your Cloudflare DNS setup, erase all MX records and add the ones listed in your account using the number right before the mail server (e.g., 5, 10, etc.) as its priority.

It might take a few minutes for the changes to take effect. If you try to send an email right after changing the records, it's likely that you'll get a message saying that the address could not be found, but it'll have the G Suite mail server in the Remote-MTA field (aspmx.l.google.com) instead of gmr-smtp-in.l.google.com. If this is the case, just wait for a few more minutes and try again

Eric Abreu
  • 171
  • 1
  • 10
  • No, those servers are not the same for everyone I'm guessing. In my own domains they're not the same. To find the actual list in Google Domains, go to your domain's DNS settings, scroll down to Synthetic Records and here you will find the MX records that need to be copied in Cloudflare. – Overdrivr Jan 11 '18 at 18:50
  • 1
    @Overdrivr Thanks! I had no idea that the MX records were listed there. I've edited the answer to add instructions for getting the correct ones directly from Google Domains – Eric Abreu Jan 21 '18 at 16:34
3

I'm not sure if you already have a solution to this, but if you do, I'm interested in how to do it too. Could you please post your solution here if you find one ?

The bad news is, it cannot be done because the way Google Domains work. Google Domains has email forwarding, but it works only when you're using Google's DNS servers. It's the same with all hosting services or whatever they're called.

I think Google just has an email forwarding service that can forward upto 100 alias email addresses per domain to an actual email address. But the actual email address has to exist somewhere. The ones you set up in the Domains console are just aliases or forwarding instructions.

For Cloudflare email forwarding to work, you need to use the SMTP servers where the actual email addresses exist, but since Domains has no actual email service servers, the emails sent out are failing with email account does not exist. The instructions you mentioned are for the Google Apps, which have actual email/gmail addresses set up, but they cost $5/user/month.

The only solution that I can think of to get around this issue is to have our own mail server, and have cloudflare point to those, and then forward/deliver the emails from that mail server.

Hope this helps.

EDIT : I probably didn't research this well enough before, but looks like people are getting around this issue by using a third party email forwarding service called mailgun

The actual article describing how to use it is on lowendtalk

Some discussion surrounding it is here

Community
  • 1
  • 1
radhashankark
  • 155
  • 2
  • 11