How to make a domain receiving email behind cloudflare?

hkguile asked:

I have a web server hosting multiple domains (centos + postfix + dovcot), one of my domain its dns is hosted on cloudflare (ie. abcd.com), but when I use gmail to send email to a user@abcd.com, user@abcd.com will not be able to receive the email. Here is the MX record I set in cloudflare:

Type   Name   Value                                       TTL          Active
mx     mail   handled by mail.abcd.com with priority10    Automatic     
cname  mail   is an alias of abcd.com                     Automatic    grey cloud

Any knows how can I make the domain receive the emails?

My answer:


You have two distinct errors in your configuration:

  1. The MX record should be for your domain, not for a subdomain.

  2. An MX record should not point to a CNAME. Point it to a record with an IP address.

An example of a working domain:

CloudFlare DNS settings


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.