Today anyone can setup a mailserver easily on a tiny VPS with 256M memory.

But running a functional well mailserver is not that easy. For instance, you need to setup the correct antispam and antivirus policies for incoming messages. These functions require a lot of system resources for which at least 2G memory is required. And it is not easy to keep the policies updated every day and every hour.

If you are not a geek, I suggest you just use cloudflare's email route as the mail gateway, which should be responsible for antispam and antivirus jobs, and the DDoS protection for mailserver.

Cloudflare routes incoming messages to your own mailserver which can run on a 256M ram VPS easily.

In your own mailserver you can setup the real mailbox for your domain. You can login into the mailbox by domain email and password, via both clients (IMAP/POP3) and webmail, and send messages from this mailbox.

The email routing path looks like:

 other MTA -> cloudflare email route -> another domain alias on your mailserver -> your real mailbox

For instance, you have the domain abc.com, you can setup it on cloudflare, and enable the email route.

All messages sent to your domain email, for example it's [email protected], will reach cloudflare's MX servers.

You can configure cloudflare to forward these messages to your virtual alias domain on the mailserver. The virtual alias domain can be a subdomain, for example, the recepient address could be [email protected].

[email protected] doesn't keep email, it just forwards messages to the real mailbox on your mailserver, which is [email protected].

For now you get messages on your mailserver in the real mailbox. And the messages were protected by cloudflare.

Surely you can send messages from the real mailbox as well, just don't forget to add SPF for mailserver's IP.

I have run my mailserver on this architecture for long days, which works pretty well. I use cloudflare as MX servers, but access the domain email in the real mailbox on my mailserver, and send messages via this real mailbox too. This provides both flexible and secure features for domain email.

Return to home | Generated on 09/29/22