All this new excitement with Lemmy and federation has got me thinking that maybe I should learn to run my own instance. What always comes up though is how email is the orginal federated technology.

I am looking at proxmox and see that is has a built in email server, so now I am wondering if it is time to role my own.

I stopped using gmail a long time ago, and right now I use ProtonMail, but I am super frustrated with the dumb limitation of only having a single account for the app. I get why they do it, and I am willing to pay, but it is pricey and I don’t know if that is my best option. I guess it is worth it since ProtonVPN is included. It looks like they are expanding their suite.

Is it worth it? Can I make it secure? Is it stupid to run it off a local computer on my home network?

  • Admiral Patrick@dubvee.org
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    1 year ago

    Yes, I still run my own email server. It is not for the faint of heart, but once it’s configured and your IP reputation is clean, it’s mostly smooth sailing. I have not had any deliverability problems to date, initial setup/learning period notwithstanding.

    If you’re not scared away yet, here are some specific challenges you’ll face:

    • SMTP ports are typically blocked by many providers as a spam prevention measure. Hosting on a residential connection is often a complete non-starter and is becoming more difficult on business class connections as well (at least in the US, anyway).
    • If you plan to host in a VPS, good luck getting a clean IPv4 address. Most are on one or more public blacklists and likely several company-specific ones (cough Microsoft cough). I spent about 2 weeks getting my new VPS’s IP reputation cleaned up before I migrated from the old VPS.
    • Uptime: You need to have a reliable hosting solution with minimal power/server/network downtime.
    • Learning Curve: Email is not just one technology; it’s several that work together. So in a very basic email server, you will have Postfix as your MTA, Dovecot as your MDA, some kind of spam detection and filtering (e.g. SpamAssassin), some kind of antivirus to scan messages/attachments (e.g. Clamd), message signing (DKIM), user administration/management, webmail, etc. You’ll need to get all of these configured and operating in harmony.
    • Spam prevention standards: You’ll need to know how to work with DNS and create/manage all of the appropriate records on your domain (MX, SPF, DMARC, DKIM records, etc). All of these are pretty much required in 2023 in order for messages from your server to reach your recipient.
    • Keeping your IP reputation clean: This is an ongoing challenge if you host for a lot of people. It can only take one or two compromised accounts to send a LOT of spam and land your IP/IP block on a blacklist.
    • Keeping up with new standards: When I set my mail server up, DMARC and DKIM weren’t required by most recipient servers. Around 2016, I had to bolt on OpenDKIM to my email stack otherwise my messages ended up in the recipient’s spam folder. -Contingency Plan: One day you may just wake up and decide it’s too much to keep managing your own email server. I’m not there yet, but I’ve already got a plan in place to let a bigger player take over when the time comes.
    • phase_change@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      Yep. I’ve hosted my own mail server since the early oughts. One additional hurdle I’d add to you list is rDNS. If you can’t get that set up, you’ll have a hard time reaching many mail servers. Besides port blocking, that’s one of the many reason it’s a non-starter on consumer ISP.

      I actually started on a static ISDN line when rDNS wasn’t an issue for running a mail server. Moved to business class dsl, and Ameritech actually delegated rDNS to me for my /29. When I moved to Comcast business, they wouldn’t delegate the rDNS for the IPv4. They did create rDNS entries for me, and they did delegate the rDNS for the IPv6 block. Though the way they deal with the /56 IPv6 block means only the first /64 is useable for rDNS.

      But, everything you list has been things I’ve needed to deal with over the years.

  • amd@lem.amd.im
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    It’s a great learning exercise but challenging to get right and ensure your deliverability and basically impossible from a residential-grade IP address (if you have a business class static IP at home you could pull it off).

    I ran an email server for decades but gave in and pay to host my email now.

    If google decides you’re a bad guy it’s such a pain to crawl back from that and I prefer my email to just work.

  • eursec@lemmy.anymore.nl
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    I host my own mailserver, and to be honest it’s pretty painless. Usually I just let it run without giving it any thought. It’s on rare occasions that I need to put a bit of work into improving the inbound spam scanning.

    Selfhosting does need quite some knowledge of the software stack and several additional protocols to set them up correctly to get your outgoing email delivered. Also, like already mentioned in another comment, you absolutely need an IP address from a non-blacklisted subnet (I think most VPS providers will be okay, residential definitely not).

    My software stack: Arch Linux (soon NixOS), Postfix, Dovecot, rspamd, opendkim, opendmarc.

    Additional techniques configured: SPF, DKIM, DMARC, DNSSEC.

    As you can see it’s quite a lot, and I’ve been doing for more than 20 years now, so my opinion can be a bit skewed. I’d say go for it if selfhosting is a hobby.

    • DidacticDumbass@lemmy.oneOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      I have been learning about it, and what really has motivated was seeing my current provider ProtonMail have an anniversary sale, and just having the least affordable pricing just to get a couple features I need. I have never been a fan of cloud storage, I have never needed an online service to handle my calendars or whatever else.

      I need to do do this out of principle.

      You are right, that is a lot of software in use. However, I have been given a lot of recommendations. I got my own domain name. I am almost ready. I just need to setup a few more things. I am taking a long time to do this, I got distracted with other self-hosted applications, but I do want to try running a mailserver.

    • DidacticDumbass@lemmy.oneOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Could you share you solution? You don’t have to! I am just curious how you do it since a lot of people seem to hate it, compared to self-hosting everything else.

  • Album@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Your own email server requires near 100% uptime or you risk not receiving critical emails. If a remote email server is trying to contact your email server and it can’t it’s only going to retry a few times and then give up. Hosting this yourself sounds great until you realize high uptime is not cheap and requires constant attention.

    Setting it up securely can be difficult depending on your understanding of server infrastructure as well as protocols like DNS. You need to set up SPF, DKIM, DMARC, etc in order to prevent someone from faking an email from your server.

    Of course, federated email does not use SPF/DKIM/DMARC because the whole point is that someone from another server could use your server to send an email (hence the federation). Open email servers were common 20 years ago but very rare today. That makes setup easier, but the main caveat is that most known non-federated email servers will reject email from servers that don’t have SPF/DKIM/DMARC because they generally end up being havens for bots and spam since there is no verification or authenticity of the sender.

    As someone who self hosts a lot of things, I would never self host my email. If i did I would be paying for two boxes in different parts of the world on different ISPs to provide that uptime. I would definitely set it up securely and not as a federated server otherwise it would be practically unusable for day to day emails.

    • Saik0@lemmy.saik0.com
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      Your own email server requires near 100% uptime or you risk not receiving critical emails.

      I disagree. You can take some amount of downtime without issue.

      https://wpmailsmtp.com/docs/how-to-automatically-resend-a-failed-email/ as an example for some services.

      Many services (including postfix by default) will attempt a number of resend operations before it gives up.

      Of course, federated email does not use SPF/DKIM/DMARC because the whole point is that someone from another server could use your server to send an email (hence the federation).

      What? All email is federated. What are you talking about here? SPF/DKIM/DMARC are on top of email… and have nothing to do with the federated property of email. Federation does not mean that you login or use another server. But that you have your instance, and the servers hash out the cross communication amongst themselves. That’s EXACTLY what email servers do using SMTP.

      I would definitely set it up securely and not as a federated server otherwise it would be practically unusable for day to day emails.

      If your email wasn’t federated then you would get emails from anyone outside of your own instance. That would make email useless for 99% of the world.

      • Album@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        I take “federated email” to refer to a juxtaposition with normal email implementation which harkens back to how it was in the 90s or early 00s where you didn’t need to be registered on many SMTP servers in order to use it and it’s stripped of server-side validation. There’s some discussion on this topic in the fediverse.

        You’re right that the default current implementation is already federated.

  • Matthew@lemmy.piperservers.net
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I ran email server with Mailcow Docker. Easiest way I have found. It is perfect to host your own mailbox but as other have said, the sending from your IP might just get blocked by other big mail servers. Luckily Mailcow allows you to use it as a SMTP relay and you can route outbound mail through the well known SMTP services.

  • Ronon Dex@mlem.a-smol-cat.fr
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Hosting a mail server is really easy. Making sure Hotmail, Gmail and others accept your emails is a nightmare.

    I don’t host my own email, I just delegate my email management to a small provider.

    • DidacticDumbass@lemmy.oneOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      I am learning this is the case. I think I may be better off running a Nextcloud instance, or similar suite using better applications for stuff like file sharing, which is more important.

    • DidacticDumbass@lemmy.oneOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      I am learning this is the case. I think I may be better off running a Nextcloud instance, or similar suite using better applications for stuff like file sharing, which is more important.

    • DidacticDumbass@lemmy.oneOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      I am learning this is the case. I think I may be better off running a Nextcloud instance, or similar suite using better applications for stuff like file sharing, which is more important.

  • Tempiz@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Nope. It can’t really be self hosted anymore, as having a residential IP is a straight track to the spam folder. It can be done if you also pay for a mail relay service, but then what’s the point of self hosting when you need to rely on a cloud service anyways.

  • njaard@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Yes, and I love it.

    I use mailjet as a proxy on outgoing emails so that I get fewer of my sent messages rejected, which works.

    It was a pain to setup but it’s treating me very well.

  • Trondk@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Jep. running a linux mailserver for now 20+ years

    its now running postfix :-), in a vm on proxmox…

  • DrinkMonkey@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Not likely worth it. Primary reason is that the large federated email services are skeptical of email from services such as your proposed self hosting solution and may simply not deliver the mail you send. This is to mitigate against spammers setting up bespoke servers.

    There are a bunch of other things that could go wrong if you don’t set everything up perfectly, but even if you do, this would be a big problem.

    Better off using a custom domain with a big provider. Fewer headaches. I like Fastmail, but many others are great too.

  • thekernel@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year ago

    Not worth the hassle - best compromise is to get your own domain but use a provider like fastmail to host it.

    If they turn sour you can move your domain to another mail host.

    • DidacticDumbass@lemmy.oneOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      I think this is the solution I was thinking about in the first place. I was just musing about it being part of a home lab. I have to consider whether this solution is is better than just paying for secure email.

      • thekernel@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        There are advantages to having your own domain - you can use something like [email protected] so each site you sign up to gets their own unique “to” address, that way you can easily send their mail to trash when you dont’ need to deal with them anymore, and will also let you know what company had a data breach if that unique email address starts to get spam.

        • DidacticDumbass@lemmy.oneOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 year ago

          This is what I want! I want that granular control of having an email address compartmentalized for specific kinds of communication. I mean, I know it is something provided by basically all email providers, but I don’t know, for sure there are limitations. A unique address for each website seems like such a smart thing to do, on top of being stingy with giving out my email address.

          • timbuck2themoon@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            Protonmail at certain levels gives you simple login with unlimited aliases. Something to look into. I love it and have been with them for years.

    • DidacticDumbass@lemmy.oneOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      That was a sobering read. We all feel victorious when we see big tech fail after they wronged their users, but fundamental technologies that actually run the world have already been lost, and may never be recoverable for egalitarian use.

  • Robbie@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    E-mail was the first “thing” that got me off of Google (to Proton & then currently Tutanota) but is really the last remaining service I not have self hosted.

    I have always read about how difficult and time consuimg it was to run your own mail server, but I felt like I needed to experience it myself. So I purchased another domain and followed the instructions on https://mailinabox.email/.

    I am using a small VPS on Hetzner and I have to say the experience has been almost flawless so far. I did need to have my new domain taken off the Domain Block List, but Hetzner gave me a clean IP and defaults to blocking port 25 outbound to prevent spam (simple ticket to open, once account is 30 days old and paid).

    I know I’m still early into this journey so far, but it has been really simple and I plan to test this secondary domain for a few months before moving onto it full time.

    As an avid self hosted of literally everything else, I can say it has been a lot of fun learning so far!

    • DidacticDumbass@lemmy.oneOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      Hell yes, I love the enthusiasm! I just got a domain, which is giving me 3 months of email, so that is great. I feel like Tutanota is the most honest email service when it comes to advertising privacy, and they do some stuff that Proton definitely does not, like make recovery impossible without a key, and use no other method.

      My next step is to get a VPS, and Hetzner is the name I have seen pop up the most. I will use that.

      Thank you!

      • Robbie@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        Yes I haven’t had any real issues with Tutanota, but it seems like the common trend is that they, and everyone else, is raising prices for things I dont really need. But at the same time, the things I do need, I.e. accounts with enough storage for my family, will start costing more than the price of renting a VPS alone. So for me, its partially privacy, but also ownership of my data and cost benefit analysis where I am now trying to make CERTAIN that my self hosted email is worth the cost savings.

        • DidacticDumbass@lemmy.oneOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          That is the thing, I am willing to pay for email, because then the incentives are real to the provider to follow best practices for privacy and quality of life, but the pricing blows up too quickly due to to features I will never use. I need something more granular.

          I am also looking at Disroot and Posteo, which I like because the have hardened ethical principles driving their services, and that is worth supporting.