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.

  • ArborNode@lemmy.shutes.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 hours ago

    It can be done! If it helps, I have made some comments on my setup and the discussions around those comments are very helpful.

    I’d personally recommend using Stalwart. I managed to get this done at absolutely no extra cost, even behind double NAT.

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

  • ikidd@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    7
    ·
    4 hours ago

    I’ve used Mailcow for years, after a couple decades of bespoke systems I built from scratch. I’m a real fan of the ease of it’s docker containers and update process. It beats maintaining your own stack and I haven’t run into any drawbacks. It’s pretty much what I had before but I don’t have to fit the pieces together whenever there’s a patch on one part.

    Up until recently, I never had a problem sending messages but have had to set up a connector to SMTP2GO for Microsoft domains like live.com/hotmail.com since they’ve suddenly decided, after 25 years of no problems, that they don’t want my server to connect. The connector setup for just those domains was very straightforward.

    The key thing is to make sure you have a healthy DKIM/SPF/DMARC dns setup. Most mailservers won’t care about PTR or they’ll just send a warning in your DMARC reports.

    If you are on a resi IP, it’s highly likely you’ll have to relay all outbound traffic. If you don’t have high volume, SMTP2Go works fine under the free plan.

    90% of the responses you’ll see on this is that you don’t want to host it yourself, probably by a bunch of people that woulnd’t even think to try. Ignore them if you’re determined to do it, it’s entirely possible if you’re willing to learn.

    • alibloke@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 hour ago

      +1 for mailcow. I pay a small amount per month for an l2tp connection with a non residential IP which helps a lot.

  • Possibly linux@lemmy.zip
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    2
    ·
    2 hours ago

    I wouldn’t recommend it

    If anything you could setup a local email server on your local network only

  • chewypoops@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    3
    ·
    6 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.

    • sunbeam60@feddit.uk
      link
      fedilink
      English
      arrow-up
      5
      ·
      6 hours ago

      Been there twice. Standing up a stack these days not too difficult. Getting your email accepted by all servers is a full time job.

    • eleitl@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 hours ago

      Nah, if you dont care about 100% reliable delivery to Gmail/Outlook it’s ok.

  • JasonDJ@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    2
    ·
    3 hours ago

    No you don’t.

    Mail, even personal mail, is one of the most important services we have, and it’s probably the biggest pain in the ass to properly configure and make it trustworthy enough to go through everyone’s spam filters.

    Not to mention keeping even two-9s uptime.

    Check out mxroute, search the usual places for Black Friday coupons, you’ll find a great deal and can bring your own domain, and have imap and webmail ready to go.

    It’s run by a dude who knows what he’s doing and is very transparent (if not, sometimes, a little too direct…you may see that in some of his posts/responses on reddit. He has zero tolerance for bots/spammers using his IPs)…

    And if you are concerned about privacy, there’s no reason you can’t layer GPG on top.

  • stom@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 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.

    • ikidd@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 hours ago

      Have you seen any issues from Microsoft recently? I can send to hosted domains, but the default ones like live.com and hotmail suddenly stopped taking my mail a couple weeks ago, after years of no issues. I did do a request to clear it, and escalated to a supposed person, who said it all looks fine but they weren’t going to whitelist me because <no reason>.

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 hours ago

        It happens every now and then. Support personnel claims that they are not blocking your address/IP even after you send them the message Microsoft servers send where it clearly states that your IP is blocked. Then you wrestle with the support for few emails, the problem magically goes away (which M$ support claims was never there) and then it comes back after few months or even few years.

        They (as a company) are just being assholes, there’s no technical reason nor explanation. And that’s one of the reasons more and more people should self-host and complain loudly every time they’re blocked without any particular reason.

    • Buck@jlai.lu
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 hours ago

      This may be a very nice proposition, but I, personally, would never give admin rights to a rando from the internet on what is to become my mailbox soon after…

  • Kuadhual@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    10 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.

  • Shimitar@downonthestreet.eu
    link
    fedilink
    English
    arrow-up
    9
    ·
    12 hours ago

    Absolutely go ahead!

    My recommendation would be to do so on a VPS, don’t do it with your home IP address.

    Today there are some all in one solutions, but I prefer the old hands on at all levels approach.

    This is my personal experience: https://wiki.gardiol.org/4-e-mail-hosting (no ads, no monetization, no AI).

    I installed and setup postfix and dovecot and dkim dmark, the works.

    One more advice: DNS records are key, do not skip them, everything depend on proper DNS setup in the email world.

  • smiletolerantly@awful.systems
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    3
    ·
    13 hours 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
      8
      arrow-down
      1
      ·
      13 hours 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.

      • smiletolerantly@awful.systems
        link
        fedilink
        English
        arrow-up
        4
        ·
        12 hours ago

        Again, all records are correct and I have a perfect score on spam benchmarks. That’s at least partly a result of the configuration.

        Getting hacked is a risk, sure, but with a common sense approach you can mitigate the risk pretty well. It’s also not unique to email hosting.

        Sorry to hear you had a bad experience with it though.

          • rezifon@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            7 hours ago

            People say this but I haven’t found it to be true at all. Are you just repeating the folklore of the self hosting community or are you speaking from experience?

          • smiletolerantly@awful.systems
            link
            fedilink
            English
            arrow-up
            4
            ·
            10 hours ago

            I land in inboxes on google accounts without issue.

            t-online was a problem initially, because they refuse mail from unknown domains, but it only took an email to get whitelisted. Apart from that, zero issues.

            • Buckshot@programming.dev
              link
              fedilink
              English
              arrow-up
              2
              ·
              7 hours ago

              I did the exact same setup you described, hetzner, nixos mailer, all the dns setup was perfect, ipv4 and 6, perfect scores. Every single message landed in spam. I followed all google and Microsoft guidance and submitted to their whitelist forms, made no difference. I can only think i got a recycled ip that was blacklisted already. I use mailbox.org now

              • smiletolerantly@awful.systems
                link
                fedilink
                English
                arrow-up
                2
                ·
                6 hours ago

                Dang. Yeah, recycled IP with a bad rep is unfortunately a real risk :/ Had you tried requesting a different one to see if it made a difference?

  • Magiilaro@feddit.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    12 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.