No, that’s it. I am f#*&@-ing done. I went from gmail to tuta to proton. Now I hear something like FastMail. Some say privacy, some say security, but what they never say is corpos gonna corpo.
No, I am done using third party services. This may be a Sisyphus task, but I want to self host a mail server even if 60% of it goes to another person’s spam.
I’ve heard about Dovecot and some other services. While searching YouTube, I came across a defunct channel that still has this old video that gives instructions to selfhost email: https://www.youtube.com/watch?v=9zP7qooM4pY
Cherry on top would be to have as many parts with the GPLv3 license as possible.
Any guidance or instructions would be greatly appreciated. I have a domain name and I am currently hosting a small webpage for fun. Nothing serious.
As someone who used to manage a mail server, I would not do it ever again. Well, Installing and configuring them IS the fun part. Managing them, making sure the domain is not blacklisted, checking spamhaus, getting asked why I don’t reply their email while it was google who dump the email to the spam folder was not fun.
Absolutely go ahead!
My recommendation would be to do so on a VPS, don’t do it with your home IP address.
Today there are some all in one solutions, but I prefer the old hands on at all levels approach.
This is my personal experience: https://wiki.gardiol.org/4-e-mail-hosting (no ads, no monetization, no AI).
I installed and setup postfix and dovecot and dkim dmark, the works.
One more advice: DNS records are key, do not skip them, everything depend on proper DNS setup in the email world.
I’ve set up postfix and dovecot on my VPS a few weeks ago and it was pretty simple. From my testing, popular email providers (outlook, gmail and proton) accept my mail, but corporate mail might bounce because of av (trendmicro in particlular seems to mark VPS host ips as residential/dynamic, you might be able to request removal tho).
Guidelines recommend setting up rDNS and SPF with DMARC for all mail and additionally DKIM for bulk senders. Mail will still be sent to spam, but shouldn’t be blocked. If you are not using it to send mailing lists and writing only to people that are ok with receiving your mail, it’s probably not a problem.
Make sure you configure postfix properly and don’t make it an open relay, as it could be used to send spam.
For receiving, set up something like rspamd to check for inbound spam, verify other sender’s SPF and DKIM. Test your server to make sure they actually work as intended.
For instructions: check mail provider guidelines and read the documentation for your servers before deploying them. Also be careful to not lock yourself out of accounts if you move things to this new mail.
Email self-hosting doesn’t have to be difficult. Ignore the detractors here.
I want to throw another option into the mix: nixos-mailserver. It sets up and manages a classic stack of email services. Through the magic of nix, you get a VERY reliable setup, and all the difficult parts (and those you don’t care about) are abstracted away in a really nice manner.
If you either already know nix, or are OK with investing a bit of time into learning the ecosystem, I urge you to go this route.
I’m running it on a Hetzner server. Had to ask them to open port 25, which was no issue. Set the DNS records as in the linked docs, and immediately had a 10/10 on mail-tester.com and no issues found on mxtoolbox.com
It’s also super easy to add additional domains. I’m hosting for multiple people now. Literally zero issues.
Again, don’t listen to the fearmongers. You got this.
It’s not the software that’s the issue. The issue is other sites not recognizing your server as legitimate, or your server being hacked and used to spam and putting you on a spam blacklist.
I had to give up independent hosting because of that.
Again, all records are correct and I have a perfect score on spam benchmarks. That’s at least partly a result of the configuration.
Getting hacked is a risk, sure, but with a common sense approach you can mitigate the risk pretty well. It’s also not unique to email hosting.
Sorry to hear you had a bad experience with it though.
The problem is that google treat all small domains as spam.
I land in inboxes on google accounts without issue.
t-online was a problem initially, because they refuse mail from unknown domains, but it only took an email to get whitelisted. Apart from that, zero issues.
Hosting your own mailserver can be fun but can, and very likely will be, come with a huge can of worms. I host my own mailserver for a handful of domains for roundabout 20 Years now (on a rented virtual server with a “datacenter ip address”) and still run into issues from time to time. Most of those could have been prevent if I had not slept on things like DMARC, DKIM, DANE and such, it is very important to always be aware of new security mechanisms and to implement them.
I would recommend against trying to run a public mailserver on your local server with a residential ip address, because you can’t set a ptr for those and ranges/networks from ISP are all on filter lists, so it is borderline impossible to get any mails delivered.
I feel you mate but from the comments here looks like you’d first need to fix the problem of trust in the internet… Good luck with that!
I would recommend dovecot and postfix but i haven’t tried any others as these just worked for me.
For hosting i chose a VPS instead of running it at home, i believe at home is a bit harder as you may need a PTR record from your isp, but im not sure.
For a VPS pick a provider that allows for port 25, I use hetnzer which allow it (atleast for me) after one month and paying your first invoice.
Then setup all the DNS records and send a few test mails to mail checker sites.
You don’t need a perfect score, my IP is on one block list for some reason but that hasn’t given me any trouble.
Don’t do it. The technical part of email hosting is rather easy but the delivery problems will bite you in the ass. You’ll have to find an ISP which nets are not on any blacklist for Mail, you’ll have to activate every single layer of email security (SPF, DKIM, DMARC, DANE, and maybe ARC) and you’ll still have a lot of problems delivering mails to any of the big providers where most of the people have their accounts.
You could take a look at mailcow, but as I said: the hosting itself is trivial.
Yeah the large providers have slowly turned open email into a closed system. Partly to prevent spam and fraud, but I think partly to build moats so others can’t compete. As it is now, there is a lot of friction trying to do it yourself. Enough that I don’t bother.
A trick I discovered this month. Use the smtp_address_preference flag on postfix to send over IPv6.
If you run your home IP address through the blocklist check on MX Toolbox, you’ll find that almost every home (CPE) IPv4 block is blacklisted. It’s simply not the case for IPv6, and all the big players accept mail over v6.
Apart from that, just make sure to jump through the TLS, DKIM, SPF hoops so other servers don’t reject you. The MX toolbox free stuff has enough to test and verify that it’s right.
I don’t bother with traditional spam filtering. The SPF/DKIM checks catches enough of it.
I agree with the VPS route if you have the appetite for it. I host my own email server on a VPS. And then you can also use it for whatever cool intentions you might have with that VPS. A tailscale exit node that isn’t coming from your home IP is nice way to gain back some level of privacy. Just one example of many other uses. I haven’t found self hosting to be high maintenance like others have suggested.
Lots of good suggestions in the comments. To save time, you can use a one stop setup option like mailcow or server management software like webmin.
If you go the VPS route, it will be hard to find one that doesn’t block port 25. A relay service gets you around that restriction. Many relays also hold your email if your mail server goes down.
Finally, test your setup with tools like mxtoolbox and follow the suggestions to set up SPF, DKIM, etc. When everything is correctly configured, it will take a few weeks for spam filters to stop auto blacklisting your new domain. After the initial config period, maintenance is mostly hands off. Don’t forget to tweak your own spam filters.
I host my email on hetzner VPS and atleast for me after being a customer for a month and paying the first invoice my request to unblock port 25 was approved instantly.
If you want to go into the nitty gritty, get How to run a mail server.
A hammer?
Don’t. It’s very hard to get yourself off spam lists as an individual
Plenty of folks (myself included) seem to manage just fine.
Please stop dissuading people from doing a thing they want to do, if you insist on pointing out potential pain points, frame them as a “be aware of X and Y”, that’s a much more helpful attitude that leaves the agency of choice with the person asking the question.
This is not personal, I’m just a bit fed up with the blind “no don’t” when people express an interest or desire in doing a thing.
My friend who hosted my email domain for years… nearly two decades… was starting to get blocked constantly, and they don’t exactly send you a postcard saying “hey buddy we blocked you.” I just started to notice I wasn’t receiving things I should have, and things I sent never got there.
It grows and becomes too much work.
If you really want to do that, https://stalw.art/ seems to have every feature you could want and does not seem very hard to install. The community version is AGPLv3. Thunderbird uses it for their new email service.
I am hosting my own email server on a rented server for multiple years now. Just recently I stumbled upon this post https://jan.wildeboer.net/2022/08/Email-1-Postfix-2022/ which has good explanation and even tutorial style command examples.
I don’t know if it would work from a homeland, but as long as DKIM, DMARC and SPF works, I don’t see why not.






