My configuration is Ubuntu 16.04 LTS + postfix for basic Internet mail server. We are using Cloudflare as our DDOS protector for websites. Here is the problem:
The website record A example.com working with CF and resolves as 22.214.171.124 not our real IP 164.251.x.x
We have another VPS instance with Mail server and IP of 121.14.x.x. As CF declare it will not work with other ports than 443/80 so the real IP exposes to the world.
Records for mail server: A > mail > 121.14.x.x
MX example.com > mail.example.com > Priority 1. And it works great. We get the emails to:
firstname.lastname@example.org but not email@example.com If we specify MX record to example.com it will resolves as CF IP and forward that mail to website. I hope you get the idea. Here is the tutorial from CF:
How to achieve the mail server to work with to: firstname.lastname@example.org ?
Any help appreciated.