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.

  • pez34@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 hours ago

    I’ve been running my own email server since around 1996. I go old school with sendmail and dovecot on linux, but sendmail isn’t for beginners…postfix or exim are easier to configure with lots of add-ons available, and others have suggested several other MTAs that are probably just as good. Nowadays its more work to get started with sending emails (w/o getting rejected immediately as spam) since you’ll need to configure DMARC, DKIM, and SPF along with reverse DNS, but not that hard if you’re somewhat technical and willing to learn. The big providers get to set the rules here, and they’re incentivized to make it hard for a self-hoster, because that also makes it harder for spammers. The first few weeks your emails will get directed to spam folders until the providers learn your domain and associated IP address aren’t from a brand new fly-by-night spammer but it’ll taper off, you just gotta keep at it.

    The biggest annoyance and work honestly is on the receiving side, with all the spam filtering work you’ll need to do once your email gets onto the spam lists. The big email providers have entire teams set up for this. You’ll also need to set up your own DNS resolver to use spamhaus and spamcop blacklists (which is what everyone uses because they’re so good), because all the public resolvers (and the shared resolvers at your VPS or cloud provider too) are already hitting them so much they get rate limited. Good news is once you get those blacklists configured correctly that’ll take care of probably 80% of the spam, then a standard open source package like spamassassin or spamprobe normallys gets most of the rest.

    Another reality is that your home residential connection won’t let you send email from their network; this really reduced spam as people’s compromised machines can’t be used to send spam anymore. However, there are providers out there intended for home self-hosters that will route you a static IP that you can configure reverse DNS on and enable outbound port 25 connections. https://getrealip.net/ is one of them, see their guide for self-hosting email here: https://getrealip.net/guides/self-host-email-server/

  • binarynoise@feddit.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    4 hours ago

    I’m using maddy. It bundles everything in one program so you only configure one service and not like 5. I’m using it mostly for receiving mail my infra sends me though.

  • The Stoned Hacker@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    6 hours ago

    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/

  • Theoriginalthon@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 hours ago

    Fuck yeah! Right first things first are you prepared to learn new stuff and know how to read documentation?

    If you have never hosted email before I want you to go away and look at these topics before even starting. It will help you understand what’s going on Postfix, dovecot, SMTP, DNS records, SPF,DKIM, dmarc, fail2ban, what an open relay is, let’s encrypt, how to use lets encrypt for mail servers, email blacklists.

    Once you get started setting up a server mxtoolbox.com is going to be your new friend.

    Although I’ve never used it there is a mail server in a box https://github.com/mail-in-a-box/mailinabox which just installs and configures everything.

  • Reven@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 hours ago

    I’ve been hosting my email for about 15 years now. And now it’s used by 7 people as their daily. And yes, there have been some issues. And yes, it’s complicated. But it’s also freeing and fun. If you really want to do it, go ahead and learn the ropes. I’ve never understood the people that say “OMG, you never want to selfhost that!”. I have a VPS, and you really don’t need a beefy VPS at all for a couple of accounts and some aliases.

    VPS is a must (or co-location, but that’s more expensive). Check out VPS providers to see which are tolerant with email and how “clean” their IP reputation is. I have the Postfix+Dovecot stack, but I’m already eyeing Stalwart, because the LTS distro on my server is reaching it’s end-of-life, and if I have to go through the setup again (the switch from dovecot 2.3 to 2.4 is bumpy), I’d rather try something new. Btw, I don’t have an IT background, just been tinkering for a long time.

    So buckle up and start planing.

  • chewypoops@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    13 hours ago

    This is one of those things that everyone wishes they could self host until they try to, and then they regret it and desperately need to switch back.

  • Kuadhual@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    17 hours ago

    As someone who used to manage a mail server, I would not do it ever again. Well, Installing and configuring them IS the fun part. Managing them, making sure the domain is not blacklisted, checking spamhaus, getting asked why I don’t reply their email while it was google who dump the email to the spam folder was not fun.

  • stom@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    13 hours ago

    AWS Lightsail VPS, install Virtualmin. It’ll configure dovecot and postfix for you. You can use roundcube webmail (they have an installer) or Thunderbird right out the box. Setup DKIM, SPF, and DMARC. Request your PTR/rDNS from AWS and you shouldn’t get issues. I’ve run this for years and never had an issue with mail being blocked which wasn’t my own server blocking others.

  • MuttMutt@lemmy.world
    link
    fedilink
    English
    arrow-up
    32
    arrow-down
    1
    ·
    1 day ago

    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.

    • cpbsy@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 day ago

      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.

  • Magiilaro@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    19 hours ago

    Hosting your own mailserver can be fun but can, and very likely will be, come with a huge can of worms. I host my own mailserver for a handful of domains for roundabout 20 Years now (on a rented virtual server with a “datacenter ip address”) and still run into issues from time to time. Most of those could have been prevent if I had not slept on things like DMARC, DKIM, DANE and such, it is very important to always be aware of new security mechanisms and to implement them.

    I would recommend against trying to run a public mailserver on your local server with a residential ip address, because you can’t set a ptr for those and ranges/networks from ISP are all on filter lists, so it is borderline impossible to get any mails delivered.

  • pHr34kY@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    22 hours ago

    A trick I discovered this month. Use the smtp_address_preference flag on postfix to send over IPv6.

    If you run your home IP address through the blocklist check on MX Toolbox, you’ll find that almost every home (CPE) IPv4 block is blacklisted. It’s simply not the case for IPv6, and all the big players accept mail over v6.

    Apart from that, just make sure to jump through the TLS, DKIM, SPF hoops so other servers don’t reject you. The MX toolbox free stuff has enough to test and verify that it’s right.

    I don’t bother with traditional spam filtering. The SPF/DKIM checks catches enough of it.