The Stoned Hacker

Just passin’ through

  • 8 Posts
  • 58 Comments
Joined 3 years ago
cake
Cake day: June 24th, 2023

help-circle
  • As someone who has been self hosting my email for years I have some advice: be wary, this is a difficult service to build well and if you dont then maintenance will be difficult, you risk exposing your data publicly, and your mail won’t be delivered. But if you stick with it you will find it to be incredibly rewarding and not really as much of a hassle as everyone thinks.

    If you want something easy that will get you 90% of the way there and make the remaining 10% easy, I cannot recommend mailinabox or iredmail enough. I used MIAB for the first few years I hosted my own mail server, and it did well enough that I’d recommend it if you just wanna host your own mail. However I would recommend against these all in one solutions if you want to actually control, configure, and understand how your mail server works. I was given the same advice when I started and after a year and a half I was working on replacing MIAB with something I built myself.

    Where I would recommend starting is the ISPmail guide1. This is one of the most comprehensive and well written guides for building a mail server. It does not cover everything, but it will get you a secure and reliable mail server with high deliverability if you keep your domain’s reputation clean. This means making sure your emails arent being blocked and that everything else is adequately secured so that no one blocks your domain; afaik I have only been blocked once when I was first starting out, and I haven’t had any issues since getting off that blocklist. The guide covers DKIM (which require DNSSEC as well), SPF, and DMARC. The guide does not include setting up MTA-STS, Fail2Ban, email auto configuration (i recommend automx2), nor webmail or DAV (i recommend Nextcloud), but none of these things are necessary for having good deliverability or a working mail server.

    If you choose to continue, I wish you well and hope you have fun becoming one of the increasingly few self hsoted mail admins left!


    1. https://workaround.org/


  • You’re wrong, containerization is a massive security measure that shouldn’t be ignored. Proper containerization allows you to segment the namespacing of a single server by user and application; this helps massive with esrablishing boundaries that are still very difficult to cross under normal circumstances. Keycloak is an IdP which only provides one layer of security; good swcurity implements defense in depth where every layer of the system has securiry measures. Just because Linux recently had two vulnerabilities that bypass a lot of those doesn’t mean they’re worthless; you still need initial access to a nonprivileged user to exploit those and layered security can help prevent that from happening in the first place.






  • It’s not that difficult to get SELinux working with podman quadlets, especially if you run things rootless. I have a kerberized service account for each application I host and my quadlets are configured to run under those. I very rarely encounter applications that simoky can’t be run rootless but I usually can find an adequate alternative. I think right now the only thing that runs as root is one of the talk or collabora containers in my nextcloud stack. No selinux issues either.












  • I actually have a hybrid setup. My public DNS and my mail server are in the cloud as those are too important to risk going down. I also have a FreeIPA replica in the cloud to help manage them. Then I set basically everything else up in my homelab because I don’t care if roundcube goes down so long as IMAP and SMTP still work.