Mailgun & Cloudflare

mailgun Jan 16, 2018

You own a domain name and you use Cloudflare to proxy your websites, services or something else and now you want to have an email address with your new shiny domain name. Cloudflare doesnt support mail forwarding, some registrars have their own forwarding system but if you use Cloudflare then we need to look at Mailgun.

Sign up for a free account at Mailgun.

Add your domainname to Mailgun

Once added you need to verify you own the domain and setup the relevent records. The records are given to you by mailgun.

Head over to Cloudflare and create the records, they will look similar to the below image.

This is what you will end up with. (Make sure the email CNAME status is the grey cloud!)

Head back to Mailgun. You will need to give the Records we created above some time to propogated across the internet. You can check this by clicking 'Check DNS Records Now'

Creating Routes. In Mailgun we need to specify routes or email addresses. This will define the recipient email and the action to take.

You can create a number of routes or you can create a 'catch all' or both. Priority is like rules, It will match the lowest priority first (lowest number), so if you set a 'catch all' rule set a high number priority e.g. 100. That way it will attempt to match everything else first.

Finally in Mailgun we also need to validated our personal email address, hotmail, gmail or whatever. Head into Account Settings and then Authorised Recipients. Add your email address which will send a link to your email which you need to validate.

Once the DNS settings have been updated and you have validated your email you should now be able to receive any emails sent to * which will appear in your hotmail or gmail account.


Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.