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.

  • smiletolerantly
    link
    fedilink
    English
    arrow-up
    6
    ·
    43 minutes ago

    Email self-hosting doesn’t have to be difficult. Ignore the detractors here.

    I want to throw another option into the mix: nixos-mailserver. It sets up and manages a classic stack of email services. Through the magic of nix, you get a VERY reliable setup, and all the difficult parts (and those you don’t care about) are abstracted away in a really nice manner.

    If you either already know nix, or are OK with investing a bit of time into learning the ecosystem, I urge you to go this route.

    I’m running it on a Hetzner server. Had to ask them to open port 25, which was no issue. Set the DNS records as in the linked docs, and immediately had a 10/10 on mail-tester.com and no issues found on mxtoolbox.com

    It’s also super easy to add additional domains. I’m hosting for multiple people now. Literally zero issues.

    Again, don’t listen to the fearmongers. You got this.

    • ssfckdt@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      14 minutes ago

      It’s not the software that’s the issue. The issue is other sites not recognizing your server as legitimate, or your server being hacked and used to spam and putting you on a spam blacklist.

      I had to give up independent hosting because of that.

  • TheMightyCat@ani.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 minutes ago

    I would recommend dovecot and postfix but i haven’t tried any others as these just worked for me.

    For hosting i chose a VPS instead of running it at home, i believe at home is a bit harder as you may need a PTR record from your isp, but im not sure.

    For a VPS pick a provider that allows for port 25, I use hetnzer which allow it (atleast for me) after one month and paying your first invoice.

    Then setup all the DNS records and send a few test mails to mail checker sites.

    You don’t need a perfect score, my IP is on one block list for some reason but that hasn’t given me any trouble.

  • Hamburger@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    2
    ·
    33 minutes ago

    Don’t do it. The technical part of email hosting is rather easy but the delivery problems will bite you in the ass. You’ll have to find an ISP which nets are not on any blacklist for Mail, you’ll have to activate every single layer of email security (SPF, DKIM, DMARC, DANE, and maybe ARC) and you’ll still have a lot of problems delivering mails to any of the big providers where most of the people have their accounts.

    You could take a look at mailbox, but as I said: the hosting itself is trivial.

  • boudica@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 hour ago

    Lots of good suggestions in the comments. To save time, you can use a one stop setup option like mailcow or server management software like webmin.

    If you go the VPS route, it will be hard to find one that doesn’t block port 25. A relay service gets you around that restriction. Many relays also hold your email if your mail server goes down.

    Finally, test your setup with tools like mxtoolbox and follow the suggestions to set up SPF, DKIM, etc. When everything is correctly configured, it will take a few weeks for spam filters to stop auto blacklisting your new domain. After the initial config period, maintenance is mostly hands off. Don’t forget to tweak your own spam filters.

    • TheMightyCat@ani.social
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      12 minutes ago

      I host my email on hetzner VPS and atleast for me after being a customer for a month and paying the first invoice my request to unblock port 25 was approved instantly.

    • doenietzomoeilijk@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 hour ago

      Plenty of folks (myself included) seem to manage just fine.

      Please stop dissuading people from doing a thing they want to do, if you insist on pointing out potential pain points, frame them as a “be aware of X and Y”, that’s a much more helpful attitude that leaves the agency of choice with the person asking the question.

      This is not personal, I’m just a bit fed up with the blind “no don’t” when people express an interest or desire in doing a thing.

      • ssfckdt@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        12 minutes ago

        My friend who hosted my email domain for years… nearly two decades… was starting to get blocked constantly, and they don’t exactly send you a postcard saying “hey buddy we blocked you.” I just started to notice I wasn’t receiving things I should have, and things I sent never got there.

        It grows and becomes too much work.

  • Alph4d0g@piefed.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 hours ago

    I agree with the VPS route if you have the appetite for it. I host my own email server on a VPS. And then you can also use it for whatever cool intentions you might have with that VPS. A tailscale exit node that isn’t coming from your home IP is nice way to gain back some level of privacy. Just one example of many other uses. I haven’t found self hosting to be high maintenance like others have suggested.

  • pHr34kY@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    3 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.

  • Pick mox or Stalwart. Both are one program that does everything (sending, mailboxes, spam checks, admin page), so you skip the Postfix-and-Dovecot pile.

    If you want the simplest, mox. Its quickstart asks for your address and prints the DNS records to copy. It’s MIT-licensed though, not GPL. If the licence matters most, Stalwart is AGPL-3.0, the closest to what you asked for (a few extras are paid, the mail server isn’t).

    The catch is the same for either: a home connection usually has port 25 blocked and Gmail distrusts home addresses. So run it on a small rented server (a VPS), where it’s still your software and your mailboxes. Before paying, ask the provider two things: will it open outgoing port 25, and can you set the IP’s reverse DNS name to mail.yourdomain.

    Done looks like: a test to mail-tester.com scores well, and a message to a Gmail address lands in the inbox. Keep your current mailbox until a week of mail has gone through cleanly.

    @Maroon @selfhosted

  • surewhynotlem@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    6 hours ago

    Most of the struggles with your own email is that you get flagged as spam and it takes time to fix.

    So as a first pass, maybe consider hosting receive-only email. What I mean is, use it to sign up for things, but if you need to send an email use another provider. That should let you get used to the whole process without breaking everything.

    • brackled@lemmy.world
      link
      fedilink
      English
      arrow-up
      17
      ·
      8 hours ago

      I’m pro self-hosting but email is just not critical enough to take on the admin overhead it requires to self-host. Maybe his situation is different and email is more critical in his work/life. If that is the case I would go with the middle ground suggestion provided below which is just to have a custom domain so that switching providers is easy. I would add a FOSS desktop email client so that even when switching providers migration of existing emails is a non-issue.

      Almost everyone below downplaying the difficulty is suggesting the use of a vps as a way to “make it easier” or make it work at all. But that defeats the purpose as his main complaint is corpos doing corpo shit. Last I checked VPS providers aren’t mom and pop shops so that’s just kicking the can further down you tech stack. You are still at the behest of your VPS provider and doing significantly more admin task just for email.

      • Reannlegge@lemmy.ca
        link
        fedilink
        English
        arrow-up
        9
        ·
        6 hours ago

        I personally believe the opposite email is so critical that it is not worth trying to self host.

        I do however agree that having your own domain is perfect for it though. Having your own domain name is the way to go, just make sure whoever you go with offers a wild card option so you can make up unique names for everything, you get no spam. And if you change hosts for whatever reason you do not need to setup each email again.

        • ssfckdt@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          1
          ·
          10 minutes ago

          make up unique names for everything, you get no spam

          Well, you know where the spam came from.

          I do this with mine, but frequently it confuses customer service people and others. “wait, your email is progressive@ssfckdt.org? do you work for us?”

      • Rentlar@lemmy.ca
        link
        fedilink
        English
        arrow-up
        5
        ·
        edit-2
        7 hours ago

        Domains are also not mom and pop shops either and neither is the IANA or Internet Service Providers assigning IPv4 addresses… Not totally disagreeing with what you said, but it’s large organizations all the way down.

  • BananaTrifleViolin@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    6 hours ago

    An alternative approach incase you haven’t gone this far yet - get a custom domain and use that with your email provider to create a portable email like you@youewebsite.com. You get the benefits of someone else handling the infrastructure while having the ability of moving your email to any other provider if you find them troublesome. Moving involves effort of course but at least you are not bound to an @protonmail.com or other address; you remove tge vendor lock-in which is the biggest pain with many of these companies.

    It doesnt avoid the faff of having to move but its much easier than maintaining your own email server.

  • hemmes@lemmy.world
    link
    fedilink
    English
    arrow-up
    14
    ·
    8 hours ago

    I’ve self-hosted email for over 25 years. Much has changed, but the basics are still the same - and it’s not difficult.

    The first thing I would ask though is what are you looking to spend, before any required hardware? Meaning just the reoccurring provider fees, whether that’s your broadband ISP provider with static IP service added on (this almost always requires a business account, also very easy to do), or a cloud VPS provider (probably cheaper)?

    • ssfckdt@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 minutes ago

      Seriously do you not get blocked at all? You never fail to get email you expected? How much of your time is spent petitioning off of blacklists?

    • Korthrun@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      4
      ·
      6 hours ago

      Thank you! I don’t get why these threads are always so full of FUD.

      Once I setup email it’s been little to no maintenance. Very “set it and forget it”. I check my logs after I see the software updated by my package manager to catch breaking changes. Which are super rare. I’ve had to increment a version number in a config a time or two.

      • pulsewidth@lemmy.world
        link
        fedilink
        English
        arrow-up
        5
        ·
        5 hours ago

        There’s no FUD, just D.

        Hundreds of us here on Lemmy have hosted our own email before, some (like me) for over a decade. We share our opinion that it’s on balance not worth it as (from experience) it’s a massive pain in the arse to keep yourself off blacklists. You do you though.