Mailserver setup

My apologies if this post is too offtopic - please let me know and I will delete it!

I have gotten a notification from my web hosting provider with yet another price increase. So I figure it is time to start looking for another solution. For my websites I will be looking into hosting them on a VPS - I have a Nanode (1 CPU/1 GB RAM/25 GB Storage) that is not being used and I can beef that up.

But what about mail? Running a mailserver is not trivial, and then there is the issue about outgoing mail being flagged as spam - has that been solved with SPF, DKIM and DMARC or does one still need a front?

And what wold be a good backend? While I am not a fan of Windows as a server OS, Exchange is a strong product especially the integrated mail + calendar + address book in the ā€œpackageā€. I can get a Windows Server 2022 license either Standard or Datacenter for under USD 50 and a 2022 RDS CAL license for around USD 35 but I am not sure this is enough? I would run this as a VM in Proxmox

There is a lot to this. Itā€™s not too hard to set up a mail server, but deliverability can be a real struggle.

If the topic is of interest, Michael Lucas just released a new book called Run Your Own Mail Server, which (like all his books) is a great read and pretty in-depth.

Iā€™ve been hosting my mail server for years using the mailcow docker project, having migrated to that from a more manual set up.

Not getting mistaken for spam is the real issue. At a minimum youā€™ll need an IP address with a clean reputation, but the big email players (Google, Microsoft, Apple) may decide to arbitrarily not deliver your mail and thereā€™s little to be done. When I was first getting set up, I consulted mxtoolbox.com often to make sure I wasnā€™t missing anything that might land me on a blocklist.

On the platform side, in my case I have mailcow running inside a Proxmox LXC on a VPS.

Now, having said all that, if youā€™re tired of your providerā€™s prices, there are other fish in the see that may be worth checking out. At my business I use Zoho, which has been pretty solid and Iā€™ve heard decent things about fastmail, too.

1 Like

I think consensus on the topic is that while it can be done and if you follow all the best practices you will very likely have a functional setup, you can also end up being put in peopleā€™s spam folder due to no fault of your own. You are in many ways at the mercy of a few big tech companies and the smaller you are the less of chance you have to get through to them.

Personally I recently moved to Migadu after some years with Proton mail. I like Protons mission, but I wanted something closer to running my own (no restrictions on amount of domains, mailboxes etc) setup. Super happy with them and theyā€™ll be the ones that have to tell Google or Microsoft to f themselves if they decide to block their IP-block.

If anyone is curious I wrote some more detailed thoughts on why I moved from Proton to Migadu.

2 Likes

I hadnā€™t heard of Migadu before. Sounds like a pretty cool option.

1 Like

I can give a +1 for Migadu, I have been using them for a few years and they have been rock solid.

1 Like

It is certainly possible to host your own mail if youā€™re a thoroughly technical person. You just need to be aware that youā€™re walking into a war zone when you do. Itā€™s not something you set up and then youā€™re done with, itā€™s at best a simmering dumpster fire, and youā€™d better be keeping an eye on it.

1 Like

As others have mentioned, running a real mail server is a full time job.

I can recommend mxroute for email - I just renewed for another 3 years & have been with them for 5.

Migrating mail to their servers can be done with imapsync - I would pick up one of their 3 year Black Friday deals which are usually very good - there is also a lifetime deal if your mail volume is low (under 300 messages an hour).

A good backend for a 1gb RAM VPS would be Alpine Linux - years ago I happily ran a mail / web / database server all on 1 core / 256mb RAM. Nowadays I run MicroOS from opensuse on all my servers (replacing Debian / Ubuntu which I ran for about 5 years) - the RAM usage is about the same & I never have to reinstall (MicroOS is a ā€œrolling releaseā€) - in almost a year I have had zero issues. The hosts all reboot in about 5 seconds every 1-2 days to apply security updates (see rebootmgr && transactional-update). The ability to create custom iso images for MicroOS is great - you boot from the iso & MicroOS installs itself.

On my servers I configure Postfix as a Smart Relay => mxroute. Iā€™ve also done it previously with Exim. Nowadays I run my relays ā€œrootlessā€ (unprivileged) under podman in 2 locations & configure MX records (in an internal domain) for High Availability. I also run netbird to connect everything together over wireguard so I donā€™t expose my infrastructure to the internet. Running your own authoritative DNS server (for your custom MX records) - is also quite easy with Knot DNS (which I also run under podman) - it has a shell for adding DNS entries which is nice. For high availability I keep the primary DNS on my workstation which updates 3 x remote secondaries configured to write zone files - again running securely over netbird.

As you use Proxmox - you may find distrobuilder-menu useful for building custom LXC images.

1 Like

Do not try to run a mailserver on a residential IP.

Most ISPs block port 25 outbound nowadays anyway and unless youā€™re in an extremely rare minority you donā€™t have IPv6 for the last mile ISP, which is required for email these days.

Iā€™ve been running my own mailserver on a Nanode for the past year and itā€™s been mostly fine. Youā€™ll have to request their support unblock the mail ports if you go with Linode.

I will warn you, you will have some headaches. Microsoft blocked all of Linode from emailing their free tier accounts for months on end. And just this morning I noticed that the Linode ipv6 block got listed on Spamhaus, which resulted in a bounce from a mailing list.

3 Likes

Is this for personal e-mail? Mailing list? A business?

I agree with the others that running your own mail host is a real drag. Being sysadmin over the host itself is the easy part; the brain damage lies within keeping the mail flowing and deliverability high ā€“ both inbound and out.

Among other things I have an MS background. As much as Iā€™d love to run my own Exchange server (either on-prem or on a VPS) I opted for a $5/mo Office 365 plan some 11-12 years ago and never left. I might spend 30-60 minutes per year wearing my Exchange Admin hat for whatever reason. It just runs itself and if an expected e-mail never arrives (very rare) I have layers of tracing, delivery reports, and anti-spam/anti-phishing knobs I can twist.

3 Likes

This is the one really big negative I see to both Google and Microsoft hosted mailā€“you have ā€œmultiple layersā€, but that doesnā€™t mean those layers go all the way to the bottom. Iā€™ve observed both providers just stonewalling certain emails without anything every showing up in any log I have access to.

Iā€™ve also seen both providers take minutes at a time to receive email to a degree where itā€™s visible to me, which is frustrating not only when Iā€™m trying to do email-based validation (yuck), but even more so when Iā€™m troubleshooting deliverability problems and need to know whether something got stonewalled, or simply hasnā€™t been sent.

At this point I think the number one reason Iā€™m still running my own dedicated mailserver is because any time a client is having discoverability issues, I can have them send me an email and I will know FOR AN ABSOLUTE FACT everything that happened. If their mailserver contacted mine in ANY way at all, I WILL know about it, and there will be no lag in figuring it out, either.

4 Likes

It is for both personal and business mail.

I see the potential in M365, but even USD 5/month is USD 60 per user per year - I could setup some of the email addresses as shared mailboxes, but I would still need 5-7 users, so that would bring the expense to USD 350+ - a lot more than my price increase, so I think that for now I will stick it out and do more research, look further into Migadu as other offers might be hosting their data outside the EU - as that would be a requirement to host within the EU.

I am using Fastmail. Been great. You can through your domain name into this, but only on the ā€˜standardā€™ and up plans. Custom domains can be added to both personal and business.

Itā€™s 4.50 GBP per user/month on the business side. Family plan (up to 6 users) is 9.90 GBP per month.

Thank You for all your suggestions! I will think about how to proceed - at the moment I will probably bite the bullet and accept the price increase as I have a shorter decision period than I thought, but then think a bit more about the future until next time ā€¦