Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

(had to dug my comment from under a flagged parent)

I self-hosted for well over 20 years, I did not throw the towel and I do not plan to. Self-hosting is a sign of pride. Neither my government nor my Prime Minister nor even my Ministry of Interior or Foreign Ministry can host their own email.

Last time I checked, only State Security self-hosted.

I was probably lucky, but I rarely had delivery problems. The last one was a couple years ago with Microsoft swallowing my emails and it was due to the combination of a fairly old exim and a TLS certificate verification quirk at *.protection.outlook.com. I found a fix in the form of a configuration option somewhere on SO.

In all fairness, there is very little maintenance involved, and whenever I have to do maintenance work, I take the opportunity to learn something new. Like this year, I decided to finally replace my aging Debian jessie setup by Arch Linux, and I rewrote all cron jobs as systemd timers.

I must admit that when I send a really important email, I check the mail server log if it went off without errors, but this does not bother me as checking logs manually once in a while is a good thing anyway.

Lastly, a piece of advice: treat self-hosting like a hobby and learn to enjoy it.

Oh and the very last thing: the person who designed Exim configuration for Debian deserves a special place in hell for all the hours wasted. If you set up Exim on Debian, just figure out how to use the upstream exim config and adapt it to your needs.



> I decided to finally replace my aging Debian jessie setup by Arch Linux, and I rewrote all cron jobs as systemd timers.

Man, I wish I had 1% of the motivation I had 20 years ago to do something like this, before all the full time job, wife and child.


Don’t hurt me: Agentic coding tools like Claude Code or opencode helped me a lot to convert things to systemd units.


Stuff to keep you busy is always there, you can control what you spend the rest of the time on.


My first email usage was at University, pre-WWW. After that I briefly used some ISP email service, but that was on a time of very limited storage and POP only accounts, so I started hosting my own email even before having an always-on internet connection, using a relay and dynamic DNS to receive email when online. Now a days, I use a small VPS to route and receive email, but final destination and storage is on my home server. Over the years, I had, like others here, to ask Outlook and other providers to unblock my IP or domain, but it has been rare.

I really don’t want to live in a world where only two or three companies run email for the entire world, and this is my little act of resistance.


outlook.com keeps sending me dmarc reports with failed dkim... while every single other provider gives pass to all domains. at this point I don't even care anymore.

why Microsoft is so crappy?


They have a crappy internal DNS caching server in the email infra that times out early and returns NXDOMAIN for timeouted requests, causing permfail for DKIM instead of tempfail as RFC suggests in case of DNS timeouts. This crap has been going on for years.


They want you to use outlook.


It’s amazing how today we have social networks bending backwards to be able to call themselves “open” and “decentralised” when we already have all the tools we need to be truly independent.

I think when we’re building something with “good UX” the major point of “does this remove agency from users” is somehow missing from the picture. When everything runs on some kind of system, it’s not extraordinary to expect people to know how it works and maybe be able to do it themselves.

Otherwise, fast forward a decade of simplifications, and we can’t even install an app without someone on the other side of the world approving the “transaction”.


> treat self-hosting like a hobby and learn to enjoy it.

This is why I have stepped away from a lot of my self hosting. I have turned my attention/time elsewhere. Apparently though the time/money balance is shifting a bit again, so it may be worth it to go back.

My biggest hesitance to self hosting email specifically is dealing with spam. What does that look like these days and do you have any pointers to share?


> My biggest hesitance to self hosting email specifically is dealing with spam. What does that look like these days and do you have any pointers to share?

Postfix can easily be configured to reject incoming emails from senders without a reverse DNS mapping for their IP address, which makes it reject a lot of spam.

For spammers with reverse mapping greylisting still works fine, they almost never retry.

Certain commercial spammers (hello China :-0) use software which can be filtered with a just one rule matching their sending software, which is "nice" enough to display its name in their mail headers.

And last but not least spamassassin / rspamd work fine to filter whatever comes through.

In the end I get less than 10 spam emails per week. And these go into a separate mailbox filtered by good old procmail, based on spamassassin's ratings. I check the spam inbox maybe once a week for false positives and more often than not the box is empty.


> Postfix can easily be configured to reject incoming emails from senders without a reverse DNS mapping for their IP address, which makes it reject a lot of spam

Historically some corporate domains ignore that rule (yea, in 2025!), so I would advise not to reject any email and run everything through spam analysis daemon. This way you won't lose any email at expense of elevated load on your server


The biggest issue isn't necessarily spam, it's proving you aren't spam.


If only we treat ads like we treat emails! Our world could probably be a bit better place to live in.


I use a combination of DNSBL and SpamAssassin. Nowadays Rspamd is supposed to be better than SpamAssassin, but SpamAssassin has served me well enough so far, and I haven't gotten around to trying out Rspamd. When a spam email gets past SpamAssassin, I copy it to a special folder, which gets processed by a cron job to train SpamAssassin on it (sa-learn).

Overall the mail server is very low maintenance. I had to add SPF and DMARC a couple years ago (DKIM isn't necessary) and integrate TLS with letsencrypt (just a few lines in a config file), and sometimes a Debian upgrade requires reviewing the configuration (several years apart as well). There's really not that much to do.


I’m not sure that there is any pre made product for this, but I’ve been playing around with LLMs to identify spam, or just generally sorting emails for you. And even the self hosted models seem to be pretty good at classifying emails even without external information like spam blacklists or IP reputation.


Naive Bayes classifiers have been working fine for decades.


I think LLMs, even local ones, are probably way overkill for identifying spam or sorting/classifying emails.


rspamd is my go to solution. Out of the box you get a lot of protection. I use Exim as my MTA but I suggest you use Postfix if you are starting from scratch, only because you will find a lot more write ups on it.

The biggest issue is getting an IP address which is not in the banned lists. IP reputation is key along with SPF and do not send spam!

In the UK a "business" static IP address is sometimes/usually/probably/might be OK. If you are unfortunate then it is already in the lists and you can check that out at point of sign up.

You might look into IPv6 too. I managed to do the Hurricane Electric IPv6 email thing on my home connection for a laugh. That was a few years ago. It seems I need to do something more to get to Guru status.


I've been lucky never to get very much spam to my self-hosted domain, but it went to zero once I implemented geo-IP blocking for a few obvious countries and has stayed that way ever since.


I have been self-hosting for about 25 years. I remember the protection.outlook.com issue. Once there was an issue with a bank that tried to do encryption, but used an expired certificate. But once I told them what the problem was, and that it was a problem for paying customers, they actually fixed it.

Being able to check the server log can be very useful. E.g. to tell someone that their mail was delivered to a served using their domain name, with that IP-address at that time.


Email for me is a critical service, and the reasons I stopped self hosting after about 15 years is:

1. Because I couldn't ensure consistent backup and restore with regular monitoring,

2. no disaster recovery plan and in doing so it'd be more expensive than going through another email provider,

3. not always on top of security (my friend that I colo'd with also ran an email server and his system was struck with ransomware (with no backup [except a copy of email via thick client] or DR); I seemed to get away unscathed because I was using FreeBSD which generally less of a target).

I agree that it is little maintenance, but once you're off the happy path, it can be a huge pain in the arse and devastating.


DR: MX and retry

email has easily one of the best responses to failure modes ever and its ancient!

Most smtp daemons will put outbound emails in a queue and run the queue. If the other end is unavailable then it will generally retry on a schedule with some sort of increasing period and then give up after a week or so.

You can easily define multiple inbound relays via your MX records which predate SRV and generic TXT and are supported everywhere.

I've run a lot of other people's email, including my own vanity domains for decades. It really isn't rocket science.

Google and MS and Co really don't screw you around if you follow the rules and that largely involves only SPF being compulsory and the rest (DKIM n that) are nice to have. If you do send spam then you will be crucified and rightly so.

Email is not a critical (its important) service because of course you have several other means of communication starting off with the SIP n RTP server you also run ... 8)


I agree with that aspect of DR; I guess I was more thinking of availability, in that I can probably handle a few hours of not receiving emails, but if it goes longer than a day or so then I'd be pretty miffed. Like I said it's all doable, but it requires a lot of effort, and is probably best not left to someone running a one man show, and once you have more than one person you likely now have to deal with trust and expenses.

I've run a lot of other people's email, including my own vanity domains for decades. It really isn't rocket science.

Again, so have I, and as I said the happy path is always easy, it's when things go wrong, and I'm not even talking about IP reputation or any of the usual issues that people bring up running email.

Email is not a critical (its important) service

Really depends; I still have many services such as banking where I need to use auth codes, also a lot of security is tied to my email in terms of private comms and recovering services.

Suppose your email service went down and the people you run email for complain, do you tell them "oh don't worry it's not a critical service, you can still communicate over other mediums"? Would that work for say gmail?


I had a client domain banned by Gmail due to a missing DKIM, even though they had fewer than 1000 emails per month and SPF was correctly set up a decade ago. The bounce message explicitly said they are bouncing because DKIM is missing.


I suspect there is more to this than meets the eye.

I have had a Gmail email account since they were invite only back in the day and I run my company email system and by my company I mean my (ie MD) so I'm quite keen on it working.

I recently migrated the whole shebang to MS365 from Exchange on prem. I have kept our MX records pointing to our on prem SMTP daemon (Exim). That means that I can redirect mail to mailboxes as I wish - I am not beholden to MS. Several addresses end up being delivered to an on prem imapd (Dovecot).

Anyway, I did set up DKIM when it was invented and then DMARC and then I ditched them because it messed up with mail lists. That has all been sorted but I still don't have DKIM on my company domain.

I have never setup DKIM on my personal vanity domain collection. The only recent fix I had to carry out was to fix up reverse DNS (PTR record) for an SMTP/MX address. That is proper old school and only one recipient domain even noticed and dropped mail.

The bounce message you received may have said DKIM but it may have been lying or simply that was the last thing that went wrong or whatever.

The big email systems are run by reasonable people who do not discriminate against well run tiddly email systems. They will absolutely crap on spammers inbound (despite hosting them) and IP reputation is king. There are a lot more rules too and it is rare that any transgression is final - pretty much all systems are score based rather than absolute on one failure.


I had my email banned by Yahoo because I would get rate limited and I didn't have a way of surfacing those messages (huzzah opensearch)

What got me out entirely was when I attempted to send an email to a colleague at a random ass no name university and my email was flat out rejected with no way to reach out to the administrators. I wouldn't have cared if it wasn't such a unique project (oil and gas exploration using ML). I have not self hosted email (in earnest) since that day over 10 years ago.


> Email for me is a critical service

This is exactly why I only trust myself to do it. I almost lost my gmail account a couple of times in the past, and every time it was quite stressful. Since then, I use gmail as a backup email provider, than is, pretty much never.

Due to the way mail servers work, you have a couple of days to sort out your troubles before you will start missing emails. At worst, you can always buy Google for Work or some other SaaS and point your MX servers there.

Backup is always a hard problem, but I got to live with Hetzer Clould backing up my VMs, Hetzher Backup boxes as restic backup targets and a tiny Celeron server in the laundry closet for local backups.


This is exactly why I only trust myself to do it.

In theory that makes sense, one thing I specifically omit as to why I stopped running my own service is in the past in a bout of paranoia due to the onset of a mental condition, I literally rm -rf'd my laptop, including a lot of files that were unrecoverable. Thankfully I didn't do this to my server at the time. Even though I've been stable for a long time, all it takes is a relapse (or even just a lapse of judgement) and boom your servers (and backups) become vulnerable.

I also don't trust that I can secure my systems and backups better than a company that dedicates itself to running a service for multiple users and have dedicated security/infrastructure teams. Sure I've never actually had an issue, but as with the anecdote of my friend, it just takes one failure. Also economies of scale helps with security; it is easy for an attacker to exfil or do damage to a smaller corpus of data (few to no customers [users]), than a large corpus of data across 1000s of customers.

I wouldn't trust a free service or a service that doesn't provide adequate support such as Microsoft or Google, but there's obviously a good selection of email providers out there that do an excellent job, much better than those self-hosting because they work with economies of scale.


Configure the dmarc reports, they tell you a lot and automatically why someone swallowed your mail.


I'm thinking of self-hosting email sending for my applications. Does anyone know if, with DMARC/DKIM, email reputation moved from the IP to the domain? If I can make sure only my server can send mail from my domain, shouldn't the sending IP then be irrelevant?


Correct I often setup SPF/etc with the domain, no IP


The sending IP remains very relevant; it may be in a third-party blacklist (RBL) or site local blacklist due to prior spam from said IP or even nearby IP(s). Let's have a look through /var/log/maillog... okay that didn't take long.

    $ rubbled 86.54.42.238
    86.54.42.238 zen.spamhaus.org. XBL (exploit)
    86.54.42.238 zen.spamhaus.org. 127.0.0.9
    86.54.42.238 zen.spamhaus.org. SBL (spammers)
Spammers can setup DMARC, and have too many domains, so blocking by IP or ASN remains relevant (no legit email from that spammy country? Ban the country!). Reverse DNS is also important, as spammers have sent too much spam (shocking, I know) that some users complain about, a lot, so: no valid reverse DNS, no service. IP addresses or domains that are "too new" may also be a problem, or some sites will want you to fill out random webforms or talk to their support idiots (Hi, Microsoft! No, me logging into some cloud thing of yours was utterly irrelevant to the problem), and all this and more amounts to a lot of rakes you need to not step on to get email setup right.

Yes, I self-host email. Gmail was routing OpenBSD mailing list traffic to the spam "folder", and self-hosting that email was easier than fighting with some rink-a-dink web UI.

Oh, one time about half the customers were in Google and the other half in Microsoft and Google and Microsoft were having some mail snit so yeah good luck getting some of those mails through. That took a while to clear up, and what can you do?


Oof, thanks, I'll keep paying someone then :(


Same here. Dont wanna piss on your party but I don't see any particular pride. Prime minister or any minister to that matter are pretty pathetic positions in my books, but that's totally different conversation.

No delivery problems if you set up everything correctly. It's not luck, just the same reason why well maintained car runs smoother than something that's seen last maintenance 100,000 miles ago.


hear hear !




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: