Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup Mailgun with Cloudflare subdomain

I'm trying to setup my domain to receive emails through Mailgun and Cloudflare, and i think i'm really closest but can't make it work.

In Mailgun, i've all DNS verified:

enter image description here

I think the problem is in Cloudflare, configuring the subdomain (that Mailgun suggest me to create mg.mydomain.com)

enter image description here

I have not got any record related with the subdomain (mg.mydomain.com). Is any change i'm something?

Also, I already setup a Route in mailgun to redirect incoming emails to my email address.

Thanks in advance!

like image 403
mauriblint Avatar asked Sep 18 '17 11:09

mauriblint


People also ask

Can I use Cloudflare with subdomain?

​​ Customize subdomain behaviorEnterprise customers can set up custom settings and access for a specific subdomain within Cloudflare with Subdomain support Open external link . All other customers can set up subdomain-specific Page Rules Open external link to alter Cloudflare settings.

How do I add DNS records to Mailgun?

Step 1: Add your domain to Mailgun Before you can verify a domain, it needs to be added to Mailgun. Login to your Mailgun account, click Domains on the left hand side, and then click the green Add New Domain button. Enter your domain name into the box. We recommend using a subdomain for better email deliverability.


1 Answers

I found the answer here: https://community.cloudflare.com/t/setting-mx-records-for-a-subdomain/4942/2

What you need to do is:

On Mailgun:

  1. Setup a domain for your incoming email (e.g.: foo.example.com)

On Cloudflare:

  1. Go to DNS
  2. Add an A record for your subdomain (foo.example.com)
  3. Add an MX record. For the first field (name), put: foo.
  4. When you click 'click to configure', it will open a dialog box where you can put the values for mxa.mailgun.org
  5. Repeat for mxb.mailgun.org
like image 149
toast38coza Avatar answered Oct 04 '22 19:10

toast38coza