Emails not getting to email server

I have migrated my domain name to Cloudflare from Namecheap. DNS records for web and mail came over, but email is not getting to its destination on my VULTR VPS server.

Anything I can try to see why emails are not reaching their destination? I am sending test emails from a GMail account and I do not get any bounced back (errors).

Check that any mail related subdomains (such as mail, smtp, mx, imap, etc) are set to “DNS only”. Otherwise, what is the domain?

Domain is

All mail related are DNS only.

Okay, I think it works… I made the A record for the site to be DNS only.

It was burried in this thread for anyone trying to find it: No email since changing our name servers to Cloudflare

You don’t have an MX record so mail can’t be delivered to your domain…

I guess it should point to but you’ll need to check that.


Delivering to the domain’s A record is default mail behaviour if there’s no MX records, but you would want web requests proxied so you can use Cloudlfare features. It’s better to re-enable the proxy and set an MX record.

1 Like

Not sure why you can’t see the MX record. I’ve had it for some time. in any case, I changed the content. I also added a CNAME for mail and proxied the record. I proxied the A record as well. Initial testing is successful, but try again in a while to make sure I see the changes propagated. Will update.

Because one doesn’t exist. If they used to exist you should review your audit logs for the values and restore them. If it wasn’t detected when the zone was created, you should copy it from your old provider along with any other needed records.

All of your mail related records should be unproxied. Cloudflare doesn’t proxy SMTP, POP3 or IMAP traffic. The guide below has details, but the records should be set up based on whoever hosts your mail.

dig mx

; <<>> DiG 9.10.6 <<>> mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45570
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 1232
;			IN	MX
1 Like

This does not work for multiple reasons, the most important being that if your CNAME points to a proxied hostname, you will still be proxied even when you set your CNAME to DNS Only. You need to use an A or AAAA record.

That guide helped, thank you!

Now I see my mx record and emails are getting through to the mail server. I am unable to send emails, but I believe that is my smtp provider blocking emails. Checking with them…

1 Like

That’s great news.

Your current SPF record is valid, but contains redundant data for no good reason. The mx mechanism and the mechanism yield identical results. This adds an extra DNS lookup to your SPF for no reason. As long as your MX host is also your outbound relay, I’d lose the latter mechanism.

Good luck with your SMTP provider!

For others looking for help on similar issues, on the server side, I was watching /var/log/mail.err and saw the DKIM service was looking for a mail.private file that did not exist in a specific folder. I found the right file (using locate) and copied it in the location and the service started working. Once I started sending emails, I saw them going to Gmail SPAM. For each email, I report that it is not Spam and Gmail is getting better at placing the email in my Inbox.