Ask HN: Self Hosting an Email Server?
It's quite obvious that people HN community loves self-hosting stuff so maybe you guys can help me out here.
I want to be able to send and receive emails from my custom domains but not pay 5-49$ a month in doing so.
What options do I got?
Saw these alternatives but I don't know what you guys recommend.
- https://www.cloudron.io/index.html
- https://cyberpanel.net/
- https://www.hmailserver.com/
- https://wildduck.email/
- Sendmail and dovecot on a (Rasberry PI) RPi
- https://www.makeuseof.com/make-your-own-raspberry-pi-email-server/
To clarify, I don' t mind the UI looking like it's a website from 1998. I just want to be able to read and send.
57 comments
[ 3.2 ms ] story [ 104 ms ] threadA huge hassle, in fact. Even with robust exchangers, like Postix, and careful all around hardening, you are going to get a fight of your life.
Meanwhile a bunch of other people are saying 'despite many people here reporting issues, once I got the software installed, it works fine for me'
Really makes you think
I mean, my working theory here is that it's easy to get whitelisted - in fact you'll probably be whitelisted by default if you have working DMARC and DKIM etc - but companies who operate large mail installations also operate AI 'agents' that aim to drive traffic and users towards their service. That includes spreading negative sentiment i.e. convincing users on forums that setting up their own mailserver is an impossible task and that they'll never be able to achieve delivery etc.
Of course I could be wrong.
Meanwhile, if you use it for marketing or something, I think more things can go wrong.
You don’t see a problem with this?
I think the real problem is that we are delegating to google the arbitrary decision of what is spam or not. Given that their core business in great part relies on syphoning info from users' mails, they have zero incentive to let users host their own servers and potentially bypass that data collection, and an actual incemtive to block as many domains as they can, for the sake of "safety"
The problem seems to be that Google does not even keep a reputation for my extremely low volume mail server, and the solution might be to set up automated emailing a couple of @gmail inboxes and marking-as-not-spam all of them there.
Even that wouldn't be full-time work.
Currently sendmail and dovecot on a (off-grid) RPi that I use for a bunch of other services too.
Interesting. Care to elaborate on what makes self-hosting email such a time-consuming task? Most of the replies you're getting seem to suggest it's not that hard to pull off.
Care to elaborate? We already had other comments stating it's not a problem. I would love to hear some first-hand accounts substantiating these claims.
Super easy to set up, quite difficult to harden if you run across any problems.
You can always transfer your custom domain to another host when you want to.
Source: ran “self hosted” email using open source tools for 12,000 person university campus for many years.
Even with DKIM, SPF, DMARC, and a PTR record, it was quite difficult to get Outlook/Microsoft to accept emails without them going to spam. I think they have some sort of form you can submit but it took lots of tries
If you don't have a static IP, you have to pay for a relay.
[1] https://mailcow.email
The problem with self-hosting is that even after setting up everything correctly, you will still likely run into delivery issues with your outgoing mail because your IP doesn't have the right reputation, i.e. it's not associated with a globocorp. What will follow is a cat and mouse game of contacting the various big email providers and asking/begging/demanding them to whitelist your IP so that they don't send your mail directly to spam. The responses to these whitelist requests vary between being ignored and being temporarily whitelisted.
Many consider this to be a losing game and give up self-hosting email.
If you can get through to legal departments, you may have better and more permanent success in getting whitelisted, see: https://news.ycombinator.com/item?id=30225619
But you might want to just sign up for a cheap email provider like Fastmail. If you self-host, you'll likely spend at least $5/mo for the VPS anyway, and if you have 100 or fewer custom domains, Fastmail is just under $5/mo, so I'd say that's a better deal than self-hosting.
I have a server in my home, on my private internet connection, it runs postfix and dovecot.
It works fine. But beware: Sending mails become a hassle as your ISP might block outgoing mail on port 25, you'll need to convince them to provide you with the details of their relay machine. On my connection, I needed the correct reverse-dns entry to be present for their server to actually relay for me, this proved hard because their support didn't understand that THEY were the ones in control of rdns, they only knew about forward-dns.. It took me some linkedin sniping and a nontrivial amount of social engineering to infiltrate their netops enough to find a guy that I could convince to add the rdns entry. It was very painful.
It was in sharp contrast to when I joined the Internet around the turn of the century, on my ADSL, the ISP had a polite letter apologizing for blocking outgoing port 25 and full indstructions on how to use their relay host, even a few lines on how to configure exim to use it.
A slightly convoluted way of getting out, that I had to resort to during aproblem at my ISP, was the following: http://dusted.dk/pages/aWayOut/ where I basically used a cheap VPS as a "gateway to the Internet" for my server.
This still gets updated and works quite well: https://github.com/LukeSmithxyz/emailwiz it installs dovecot/spamassassin etc for you, so i guess i'm more vouching for the RPi. I think a 5$ VPS would be worth it, you can probably run other stuff on it too like XMPP
Only note to it i'd add is that depending on your domain name provider, you may have some issues with DKIM/SPF, but otherwise it should be fine.
I pay zoho £10 a year to host my email. I could do it via my ISP, I have a good one which doesn't have port blocks, offers as many IPs as I can imagine I need, and is shibboleet compatible, but even setting aside my own time and maintenance, I'd want two MX entries that were geographically resilient, so I'd need to rope in a friend or family member. For £10 a year it's not worth it.
However if zoho stops working, or bumps their price up, I can shift my domains to someone else with a change of MX/spf/etc records.
Only concern is that all 3 zoho entries are on the same AS (zoho), so that's a single point of failure. Not a major concern for personal email.
Last year they charged me $1/month plus VAT. Not something I notice
I have two domains pointing there. Not sure how many I can have, but the domain renewal costs more than the mail.
I would rather spend $10 with a small(ish) internet company than $1 with a leviathan like apple or amazon. In reality I spend far more with the behemoths, but as far as I'm concerned every dollar I spend with a small company is a dollar invested in not making email the sole remit of microsoft and google.
If that's the goal, I usually just use https://forwardemail.net. Not self-host, but a forwarding service.
if interested, my stack is very simple:
openbsd: opensmtpd: opendkim
To read mail I ssh in and use mutt. imap via dovecot is an option I have used before. however because I using mutt anyway. ssh/mutt is a lot easier to set up.
I have not needed spam protection yet, when/if I do I will plug in rspamd and openbsd's native spamd.
I use https://openbsd.amsterdam/ as my vhost. I don't know if I could really recommend it to others. it is this effort to emply openbsd's native vmm as a service. The down sides: performance is not that great, it goes down twice a year for host updates. It is run by one person. The upsides: That person does a really great job at customer service. stable ip/ip6 address, reverse pointers. ssh based vm control.
I had good experiences with Infomaniak. Their email service can be used while the domain is registered somewhere else.
1.50 EUR per month for 5 addresses and unlimited storage, modern interface + imap, carddav, caldav, hosted in CH.
https://www.infomaniak.com/en/hosting/service-mail
I haven't used it, but have used some of the sub-crates for some email-parsing problems, and it worked great.