Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • I’ve self-hosted for 21 years.

    I also run mail servers for others, mostly non-profit adjacent groups who don’t have the capital to be extorted by cloud service providers.

    Sure, there are some things to learn, but like anything – if you do it properly, it’s not hard and can work properly. Never had any deliverability issues over that time (yes, even to the big providers). I also almost never touch the boxes (I do about one architectural overhaul a decade and am working on the next right now).

    If you’re willing to invest the time and resources to do it properly, I agree, it works fine.

  • I beg to differ on:

    > but if your home internet checks these boxes, you can 100% host your own mailserver at home:

        Static IPv4 address (make sure it's not blacklisted)
        Not behind a CGNAT
        Ability to change the PTR record of your IP (usually though the support of your ISP)
        Ability to open common mailserver Ports (25,143,465,587,993)
    
    
    Because above is only needed if you want to communicate with people using Gmail, Yahoo, Outlook, Fastmail, Proton etc (The monopoly).

    For normal folks, they are better off using an alternate less privileged email service like email.riamu.io.

  • Ive self-hosted my email server since 1999. It started in a closet at home in San Francisco. As things got more restrictive (residential ips being black holes) I moved to a Colo. but now I'm back to hosting it on my server in my cellar. I have a fixed ip from my provider init7 (Switzerland) that has never been blacklisted. Reverse dns is set up. All the acronyms like spf, dkim, dmarc are set up. I have no problems sending to Microsoft and Google email addresses.

    So I'm doing it now but I'm ready to switch back to one of my Colo servers at any time and I won't be surprised if I have to at some point.

  • I'd run my own email server since the early 2000's - in several forms over time. A VA Linux 2U rack server that I got from work (noisy, overkill), a personal Mac Mini (Frankenstein macport upgrade-resistant), and now a single-node k8s instance with everything neatly managed (an excuse to really dive into k8s from the ground up).

    I use dyndns to handle IP changes (incredibly rare with Frontier FIOS, actually). I use mailhop.org to handle secondary MX records in case my machine is down (as well as mail filtering) Everything else is postfix, spamassassin, dovecot imap

    It's not a trivial system, and it took a while to get everything working how I wanted. It's a terrific learning opportunity, but it's by no means simple to mentally model the process of all that happens inside.

  • Just document this for all, simplify the setup but keep the learning :)
  • The biggest problem with self-hosting a mail server is reliably being able to send email and have it be delivered to the recipient. Something I have been thinking about setting up is self-hosting a dovecot server so that all of my emails that I receive are on my system, but using another provider for sending email. I don't send that many emails, so there is not much privacy loss in regards to a third-party being able to see my sent emails, but I still get the benefit of noone but me having access to my received emails.
  • > but I still get the benefit of noone but me having access to my received emails.

    Other than every smtp relay hop and any network tap along the way that could keep a copy. Hope you're encrypting and not worried about the envelope. Email is fundamentally not private. Self-hosting doesn't help all that much (though it may keep it out of certain companies' hands, aside from the emails copied to or sent from that provider)

  • I've been self-hosting for 20 years now - a few years ago I switched to using Mail-in-a-Box (https://mailinabox.email/) which makes management a lot easier than configuring each service manually.

    It definitely requires some effort but once you've got it up and running it's pretty hands off. The only issues I've ever had are expiring certs but I've fixed that by configuring auto-renewals and it's all good now.

    Ensuring your source IP isn't blacklisted is probably the single most important factor. I had to request a new IP from Linode where my server runs as the one it was originally assigned had a bad reputation.

  • I ran my own mail server from 1999-2008, starting when I worked at Sendmail. I helped create SPF and DKIM.

    I would never run my own mail server today. Deliverability is a nightmare, despite what this article says. Gmail/Hotmail (and all the domains they host for people, which is quite a lot) will pretty much block or silently drop any email that isn't from a large, known provider who has actually talked directly to them.

    If you don't have time to be a full-time mail deliverability engineer/product manager, just pay someone to do it for you.

  • To be clear, you’re talking about an outgoing mail server. An incoming mail server is pretty trivial to self-host and provides most of the benefits of self-hosting mail. The distinction is often lost in these discussions, which scares off a lot of people who in reality would have no trouble running their own MX.
  • I know an old-school Linux admin who has been successfully running his own email servers for 30+ years - from small private ones to larger corporate setups. For spam detection he uses his own system, and it works surprisingly well even without any LLM (though an LLM could surely make it even better). So the "you can't self-host email" meme was never quite true - it is about willingness and ability to configure everything right.
  • Even in the face of all the advice on reddit and HN that says never to host your own mail server, I have been doing so successfully for at least 15 years. It helps that I have had the same spam-free IP address for most of that time. All I ever do is run `apt upgrade` approximately once a week. Costs all of $5 a month and there's just enough RAM leftover that I can also use it for wireguard tunnels or whatever if I need to.

    I have decided that if my VPS provider shuts down, I can just send my outgoing mail through a cloud provider's SMTP gateway. My volume is low enough that it will be free or cost a few cents a month.

    Deliverability is not a problem for me, but incoming spam does not have a great solution. Even with rspamd, a lot of crap gets through if you start spamming your email address everywhere. This is why I use a lot of throwaway and company-specific email address.

    If you only have one email address, yeah Fastmail or whatever is cheap. But as soon as you want multiple users (family) and throwaway email addresses, it gets expensive in a hurry. But those are free if you self-host.

  • I do. It's nowhere as hard as everyone on here makes it out to be. And I don't even use an easy solution like Mailcow. Spam is a solved problem with rspamd, and it's not even an llm
  • out of curiosity, are you talking about personal, small business, or corporate?

    "spam is solved" looks a lot different at each of those

  • I still handle email for multiple small businesses (for over 20 years) and recently switched from the mailscanner+spamassasin to rspamd and the scanning is so much better/easier now

    my backend is still dovecot+postfix, still works beautifully. I am able to run rspamd+dovecot proxy on a small vps and the storage is handled by a backend office server with dovecot. If VPS has an issue can spinup another easily/anywhere and backend is also virtualized (libvirt) so easily restored (with multiple backups in multiple places)

    biggest thing to worry about with deliverability is ensuring your SPF and DKIM (opendkim) are correct, which is not too difficult and rspamd is able to handle the dkim signing/verification which is nice

  • It’s not hard to receive or filter mail - knowing that somebody will receive your email after you send it is another thing entirely.
  • Before self-hosting your own, first get a domain and just point it at a mail provider that allows custom domains. It will cost, but so will a VPS. I suspect a lot of DIY homelab types would have most of their needs met with just that setup:

    - you get the vanity email address

    - you can switch email providers (including self-hosting later on)

    - you can have ~unlimited aliases (depends on the provider)

    Most of the setup consists of steps you will have to take anyway when self-hosting (getting a domain, changing DNS records), except for a major amount of headaches that will be taken care of for you.

  • Some providers use the reputation of the mail servers (smtp.domain.com) and not the actually domain (your-domain.com).
  • Agreed. Never use a provider-specific email domain, when for a tiny amount per year you can have an email at your own domain that stays the same no matter who your email provider is.
  • Agreed. Also being able to use as many aliases as you like (or a catch-all) is very nice.
  • I ran my own self-hosted email server from 2008-ish to 2018, and I would highly recommend against doing it! Especially when Fastmail and Proton are so cheap.

    I was running Postfix+Dovecot+Seive+SpamAssassin+Fail2ban+certbot+spf+dkim+reverse-ip+<other random crap>

    It worked! Receiving email was overall pretty easy. I know I also did things the "hard way" by ad-hoccing all that together, and today there are a lot more out-of-the-box solutions that do all that for you. But still. Being a full-time email administrator is a job I will never do again unless I'm getting paid for it.

    You know what really sucked? Deliverability. Frequently, emails I would send would just ... vanish ... no warnings, no errors, no failures. From my end, everything was perfect. Until days later, people would follow up with me and say, "Are you going to send that email?" ...

    I had a business IP (Comcast Business). The IP address was clean, not black listed anywhere, not on SORBS or other lists. Still, successfully delivering an email was like 50/50, with no way to confirm the other party actually got it.

  • This seems to depend so much on the IP address space one is in. I have never experienced deliverability issues after the first year–and that's since the 2010s iirc. The first year I had to ask several friends to send me emails first, or dig out my email from spam and reply to it. After that it worked flawlessly for Gmail, which was hit-or-miss before. A single ISP I had to write to manually–the person responding to my mail explained that they blocked emails from my hoster's IP range wholesale but made an exception for my IP explicitly.

    Never had any issues since then, though I did have to adjust to new standards such as DKIM, DMARC, SPF etc. over the years.

  • If you hate it, don't do it, sure.

    But I encourage everyone who likes tech and freedom to host their own email. So many reasons.

    Some are pragmatic, for example that way you won't ever get locked out suddenly of your entire digital existence when google/microsoft decide to lock you out for no reason and you will never reach support capable of helping.

    Some are more about taking a stand for freedom, but that's also worthwhile. The internet was not meant to be owned by just a few behemots who get to control all content. The internet is about distributed peer to peer protocols. Nothing embodies that better than everyone running their own mail server, if you can.

    As many say below, if you're worried about the deliverability you can still run your own email server and have nearly all the benefits even if you use a third party relay for delivery.

    That said I also deliver from my email server and it is totally fine, the fears are overhyped. Delivery to microsoft is the worst, but even that one just takes filling a form on occasions (been over a year since had to do it last time).

    by jjav
  • I think the timeline is critical here and should be highlighted. Self hosting email server was something that worked out just fine in the past (used to host until 2014), however things have changed a lot with the scale of abuse. its not worth it unless you are doing it as a business. Sending a email from your home IP to big email providers with reliability is next to impossible. Even if we discount the spam management,

    1. IP reputation is a big deal, its not just about not being on some blocklist, call it a cartel at this point, its about being on the allow list for other mail providers

    2. Keeping it reputable is a continuous effort

  • A lot has changed, in fairness. Stalwart + LLMs can help with the full-time email administrator part. It's a lot easier than it was.

    And on the deliverability side, using SES for sending avoids this entirely. Yes, ok, not fully self-hosted I suppose, but it's close enough (and for most people, the bill will be pennies).

  • Same story. Ran a set of about 20 postfix mail servers for my company. Prided myself on being proactive, setting everything up correctly. Using things like DANE even before they were mandatory but the trouble was always random blocking which was outlook.com 90% of the time and occasionally yahoo and Deutsch telekom. At least the latter provided contact details and were helpful getting things unblocked but Microsoft had horrific support. You are blocked, we won't or can't tell you why, nothing in the mail management system shows you any problems so we can't tell you what to fix, please see this 15 year old guide as to how to setup email properly and we will tweak the setting a bit to let your mail through until the next time we decide to block it.

    So frustrating because they have no legal obligation to accept our emails but our product relies on them being delivered.

    I gave up and moved everyone over to SES instead.

  • I take a middle path. Self-host receiving mail, and use smtp2go.com for outgoing
  • I'm running 4 email servers, the oldest is from 2011 or so, to this day.

    4 different countries, different AS.

    I'm always puzzled by all the issues described by others. I had about 4 issues during these 15 years, all 4 were solved by reading the bounce message and doing what was asked in the message (contacting support of the destination).

  • Had no problems at all self-hosting for two decades; then a provider went bust and I lost my static IP block, and with it its two decades of reputation.

    I still self-host, but now I cheat for deliverability: route the problematic destinations (I'm looking at you, Outlook) through Amazon SES. At a few cents for five-figure numbers of emails, it's as close to free for personal/vanity email quantities as it gets to have someone whose full time job it is to make sure outgoing mail stays deliverable on your side while still keeping everything else under your control.

    One thing to note is that Amazon are not very good at keeping amazonses.com up to date, so despite including it you can't set DMARC to hard-fail SPF or you will have mail bounce days.