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.
Pick mox or Stalwart. Both are one program that does everything (sending, mailboxes, spam checks, admin page), so you skip the Postfix-and-Dovecot pile.
If you want the simplest, mox. Its quickstart asks for your address and prints the DNS records to copy. It’s MIT-licensed though, not GPL. If the licence matters most, Stalwart is AGPL-3.0, the closest to what you asked for (a few extras are paid, the mail server isn’t).
The catch is the same for either: a home connection usually has port 25 blocked and Gmail distrusts home addresses. So run it on a small rented server (a VPS), where it’s still your software and your mailboxes. Before paying, ask the provider two things: will it open outgoing port 25, and can you set the IP’s reverse DNS name to mail.yourdomain.
Done looks like: a test to mail-tester.com scores well, and a message to a Gmail address lands in the inbox. Keep your current mailbox until a week of mail has gone through cleanly.
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 had a plan mapped out of how I was going to self host things, I foolishly had a 3 month map of how things where going to going to go. I thought with that I was going to be able to stop paying for services, I have done that, however that 3 months came and went and everytime I needed to use some other service I think hmm can I just self host this? Turns out yes for most things I can.
When it came time for the email section I found many guides, I had my static IP I would use for email because the host I was foolishly using, HostHero, charged an arm and a leg for unlimited emails and offered no wildcard option. I had already at that time been getting away from Apple at that time for a while but liked their hide my email, and very briefly dipped my toes into Proton just prior to hearing about the CEO’s worship of Trump. So I was ready to go self hosting so I got a simple throwawaydomain to test out my system, I asked my ISP to open up port 25 and put the MX record or whatever on one of my static IPs and I was ready. I had nothing but trouble, I would trouble shoot think it was working and no cigar.
I thought I would do a chicken challenge with HostHero to try and get them to turn on a wildcard function for me so I had everything set uo with easyDNS, they would be more affordable and offered a wildcard but I would need HostHero know I was moving hosts so they would release my domain. I was really hoping they would send me to some retention path and I could get some deal that was better than easyDNS. When I called the worker bee I got pretty much just said “ok,” I tried poking asking for the wildcard option and a better plan but got a straight out “no, we will transfer your domain though” so I got the code and went to easyDNS.
An alternative approach incase you haven’t gone this far yet - get a custom domain and use that with your email provider to create a portable email like you@youewebsite.com. You get the benefits of someone else handling the infrastructure while having the ability of moving your email to any other provider if you find them troublesome. Moving involves effort of course but at least you are not bound to an @protonmail.com or other address; you remove tge vendor lock-in which is the biggest pain with many of these companies.
It doesnt avoid the faff of having to move but its much easier than maintaining your own email server.
Most of the struggles with your own email is that you get flagged as spam and it takes time to fix.
So as a first pass, maybe consider hosting receive-only email. What I mean is, use it to sign up for things, but if you need to send an email use another provider. That should let you get used to the whole process without breaking everything.
I’ve used MXRoute for email before and I’m surprised I haven’t seen this recommended on Lemmy elsewhere. I found out about MXRoute from Reddit many years ago, used it and liked it. No longer a customer for unrelated reasons. The owner is a legit email dude and the service is very reasonably priced with a strong focus on IP reputation. Typically have Black Friday sales, too. Use them (or anything else) instead of self-hosting an email stack!
MXRoute
Oh…my…god…
That is the cleanest mobile-formatted website I have ever seen… With the “we will ban your entire lineage if you fuck around” attitude to top it off!
itssobeautiful.jpg
No you don’t.
I’m pro self-hosting but email is just not critical enough to take on the admin overhead it requires to self-host. Maybe his situation is different and email is more critical in his work/life. If that is the case I would go with the middle ground suggestion provided below which is just to have a custom domain so that switching providers is easy. I would add a FOSS desktop email client so that even when switching providers migration of existing emails is a non-issue.
Almost everyone below downplaying the difficulty is suggesting the use of a vps as a way to “make it easier” or make it work at all. But that defeats the purpose as his main complaint is corpos doing corpo shit. Last I checked VPS providers aren’t mom and pop shops so that’s just kicking the can further down you tech stack. You are still at the behest of your VPS provider and doing significantly more admin task just for email.
I personally believe the opposite email is so critical that it is not worth trying to self host.
I do however agree that having your own domain is perfect for it though. Having your own domain name is the way to go, just make sure whoever you go with offers a wild card option so you can make up unique names for everything, you get no spam. And if you change hosts for whatever reason you do not need to setup each email again.
Domains are also not mom and pop shops either and neither is the IANA or Internet Service Providers assigning IPv4 addresses… Not totally disagreeing with what you said, but it’s large organizations all the way down.
deleted by creator
I’ve self-hosted email for over 25 years. Much has changed, but the basics are still the same - and it’s not difficult.
The first thing I would ask though is what are you looking to spend, before any required hardware? Meaning just the reoccurring provider fees, whether that’s your broadband ISP provider with static IP service added on (this almost always requires a business account, also very easy to do), or a cloud VPS provider (probably cheaper)?
Thank you! I don’t get why these threads are always so full of FUD.
Once I setup email it’s been little to no maintenance. Very “set it and forget it”. I check my logs after I see the software updated by my package manager to catch breaking changes. Which are super rare. I’ve had to increment a version number in a config a time or two.
There’s no FUD, just D.
Hundreds of us here on Lemmy have hosted our own email before, some (like me) for over a decade. We share our opinion that it’s on balance not worth it as (from experience) it’s a massive pain in the arse to keep yourself off blacklists. You do you though.
Here is the issue with self hosting email. Residential ip’s are pretty much verboten from being able to receive email by the big companies. That means everything you send it will be automatically deleted. That’s if you can even set it up to work as most ISP’s block the needed ports. No a VPN won’t fix this or solve the problem. You can receive with no problem but to send you will need to use something like SMTP2go or if your ISP is capable (and willing) they can send.
If you want someone to blame look to the Spammers and Hackers of the world.
I’m in the process of moving everything I do to self hosted as much as possible. Email is a bigger nightmare than web hosting at home. The only other option I can find (for self hosting) is collocation of your server in a data center.
If you want someone to blame look to the Spammers and Hackers of the world.
But don’t forget the reason why all of this is necessary: email was created by hippies, and therefor any kind of security was really not on their minds when they built this stuff ;-)
Ah yes, the hippies at ARPANET
That was the network, but email itself is a very hippie thing.
https://en.wikipedia.org/wiki/Jon_Postel
I cite this article regarding his death: https://circleid.com/posts/in_memory_of_jon_postel
Jon loved the outdoors. I know he used to enjoy backpacking in the high Sierras around Yosemite. Bearded and sandaled, Jon was our resident hippie-patriarch at UCLA. He was a private person but fully capable of engaging photon torpedoes and going to battle stations in a good engineering argument. And he could be stubborn beyond all expectation. He could have outwaited the Sphinx in a staring contest, I think.
Edit: Here’s a picture of email’s hippie-in-chief:

Seems like he was a great guy, but security was not on his mind back then.
A bro named “Postel” helped develop Email standards. What a trip. :-D
Security isn’t the issue. The problem is inherent to any system that lets someone communicate with you without your prior approval.
If physical mail cost nothing to deliver, junk mail would be a gigantic problem instead of a nuisance.
I am honestly very thankful I am in Canada, with a good ISP. My (non-static) IP hasn’t changed in 3 years, and there are no non-piracy restrictions on it at all. Self hosting email was as easy as following Maddy’s setup instructions in a lxc, and pointing Caddy at it. I did set up smtp2go for outgoing mail, just to reduce the chance of it hitting spam on the rare occasion I need to send a personal email, but have had 0 issues receiving.
Seconded. I used to selfhost email, and it’s a pita. Doable, sure, but in my case I concluded that it just wasn’t worth it.
Surely you get set up everything you need on a VPS though, right? You can even rent a Raspberry Pi in a rack in the UK if you want and that’d work for email, right?
Correct, a VPS or a Raspberry pi in a data center can be used. You would still need to install the software and configure it.
Actually you can just rent a small vps with a provider that allow outgoing port 25 and reverse DNS just to send email. The receive part can be configured in your home server. That’s what I’m trying to do, but I’ve only configured the sending server.
I have both, a VPS with wireguard to bridge it into my network as exit point, and a dedicated bridge from an IPv4 provider.
The latter costs a few bucks and gave me a very reputable IP with rDNS etc.
The former also supports rDNS, but the IPv4 I got was flagged by multiple spam blockers and needed some work to unblock with all those blocklists.
Postfix + dovecot are on my main server behind a residential IP, where I can without problems communicate with clients (IMAP/POP + SMTP) and receive mail (set the IP as MX with lower prio number to force it as first choice for remotes to connect to SMTP with), but not outgoing SMTP (called ‘smtp’ (mail sending/forwarding) in contrast to ‘smtpd’ (mail receiving) in postfix). That’s specifically routed through the IPv4 provider and then the VPS (IPv4), or directly through the VPS (IPv6).
Wait, I know colocation in datacentres is a thing but can you actually collocate raspberry pi?
You can put whatever you want in your rack allocation. You could put a Sega Dreamcast if you wanted.
For $3 a month, forwardemail will forward both inbound and outbound email for you. You’ll still have a lot of work setting up DNS entries and spam filtering, though.
If (when) you decide self hosting isn’t the solution, I suggest mxroute. Lifetime options for reasonable prices, though I got in a number of years ago for $99. Storage isn’t huge for lifetime, but it’s nice to not have to think about it.
What is the motivation exactly?
If you wait a little bit, I’m getting Port87 ready to be self hostable. I’m going to open up a public beta program to find any issues. Would that be something you’re interested in?
It’s not as hard as people make it out to be. Sometimes you just end up in people’s spam folder; that’s life.
Some tips:
- Maintain the same IP for as long as possible - helps with reputation.
- Unless you are in some utopia where your ISP opens port 25 and all the rest, you’ll probably need a VPS. Use a reputable provider. Do your homework.
- Make sure you can transfer your IP through host upgrades as time goes on.
- Make sure your provider will open port 25 and all the rest.
- Make sure your provider will set up reverse dns
- Check that your IP isn’t on any of the credible spam lists. Don’t worry 'bout UCEPROTECT3 - it’s a shakedown.
fwiw, I have been happy with Hetzner + and https://mailu.io/ for my mail server as of late; no affiliation. Going on almost 10 years hosting now.
I’ve been hosting my own email on Hetzner for the last ~10 years. This is good advice. I would add:
- Spend some time reading about and really understanding DKIM, DMARC and SPF. These are NOT optional, you need them if you want your emails to have a chance.
- You will have to play around with your config to get it set up right. That’s fine, just make absolutely sure you don’t ever forward e-mails from unauthenticated users.
- Do not bounce emails.
Port87 is going to provide a self-hosted stack soon if you’re looking for something a bit more turnkey. The guy who runs it is pretty active on the threadiverse, and he’s got a killer AI policy (absolutely 0 LLM usage). I believe he’s going for the whole deferred open source thing, which may or may not be acceptable for you. Still, I figure I’d bring it up. I’ve really enjoyed using it in its hosted form.
I think it’s worth shouting out the fellow @hperrin@lemmy.ca and the lemmy community for it !port87@lemmy.ca. In any case, it’s nice to be able to talk to the person behind these efforts on Fedi.
Thank you for tagging! I wanted to but I was in a rush when I made my comment and just didn’t have the time to look up his user name.
Thank you. :)










