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.

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

  • hemmes@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    32 minutes 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)?

  • lettruthout@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    35 minutes ago

    Will echo others that running your own mail server is a lot of work. If you’re interested in learning, then great, go for it. I’m using Mail-in-a-Box, starting on Digital Ocean. They kicked me off because mail servers were causing them too much trouble. Vultr has been a good experience for years now.

  • Badabinski@kbin.earth
    link
    fedilink
    arrow-up
    4
    ·
    1 hour ago

    Port87 is going to provide a self-hosted stack soon if you’re looking for something a bit more turnkey. The guy who runs it is pretty active on the threadiverse, and he’s got a killer AI policy (absolutely 0 LLM usage). I believe he’s going for the whole deferred open source thing, which may or may not be acceptable for you. Still, I figure I’d bring it up. I’ve really enjoyed using it in its hosted form.

  • adr1an@programming.dev
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 hours ago

    Shout-out to stalwart since none have mentioned it and afaik is the most modern solution. Not sure if it’s fully compatible with delta.chat which would be certainly a huge plus!! Mail and instant messenger all in one 🤯

  • MuttMutt@lemmy.world
    link
    fedilink
    English
    arrow-up
    40
    arrow-down
    1
    ·
    3 hours 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.

    • DarkSirrush@piefed.ca
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 minutes ago

      I am honestly very thankful I am in Canada, with a good ISP. My (non-static) IP hasn’t changed in 3 years, and there are no non-piracy restrictions on it at all. Self hosting email was as easy as following Maddy’s setup instructions in a lxc, and pointing Caddy at it. I did set up smtp2go for outgoing mail, just to reduce the chance of it hitting spam on the rare occasion I need to send a personal email, but have had 0 issues receiving.

    • Wildmimic@anarchist.nexus
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 hour ago

      If you want someone to blame look to the Spammers and Hackers of the world.

      But don’t forget the reason why all of this is necessary: email was created by hippies, and therefor any kind of security was really not on their minds when they built this stuff ;-)

      • Blue_Morpho@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        36 minutes ago

        Security isn’t the issue. The problem is inherent to any system that lets someone communicate with you without your prior approval.

        If physical mail cost nothing to deliver, junk mail would be a gigantic problem instead of a nuisance.

    • cpbsy@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      30 minutes 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.

    • neidu4@piefed.social
      link
      fedilink
      English
      arrow-up
      10
      ·
      3 hours ago

      Seconded. I used to selfhost email, and it’s a pita. Doable, sure, but in my case I concluded that it just wasn’t worth it.

    • Daniel Quinn@lemmy.ca
      link
      fedilink
      English
      arrow-up
      10
      ·
      3 hours ago

      Surely you get set up everything you need on a VPS though, right? You can even rent a Raspberry Pi in a rack in the UK if you want and that’d work for email, right?

      • MuttMutt@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        ·
        3 hours ago

        Correct, a VPS or a Raspberry pi in a data center can be used. You would still need to install the software and configure it.

        • NotSteve_@lemmy.ca
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 hours ago

          Wait, I know colocation in datacentres is a thing but can you actually collocate raspberry pi?

        • Carlos Francisco 📑@feddit.cl
          link
          fedilink
          English
          arrow-up
          4
          ·
          2 hours ago

          Actually you can just rent a small vps with a provider that allow outgoing port 25 and reverse DNS just to send email. The receive part can be configured in your home server. That’s what I’m trying to do, but I’ve only configured the sending server.

          • Lucy :3@feddit.org
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 minutes ago

            I have both, a VPS with wireguard to bridge it into my network as exit point, and a dedicated bridge from an IPv4 provider.

            The latter costs a few bucks and gave me a very reputable IP with rDNS etc.
            The former also supports rDNS, but the IPv4 I got was flagged by multiple spam blockers and needed some work to unblock with all those blocklists.
            Postfix + dovecot are on my main server behind a residential IP, where I can without problems communicate with clients (IMAP/POP + SMTP) and receive mail (set the IP as MX with lower prio number to force it as first choice for remotes to connect to SMTP with), but not outgoing SMTP (called ‘smtp’ (mail sending/forwarding) in contrast to ‘smtpd’ (mail receiving) in postfix). That’s specifically routed through the IPv4 provider and then the VPS (IPv4), or directly through the VPS (IPv6).

  • Onomatopoeia@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 hours ago

    As others have said, this isn’t something you want to do.

    It’s surprisingly a LOT harder than people think.

    I pay for mailbox.org because I need more aliases, but the free version is really good.

    I NEVER get spam there.

  • JRaccoon@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 hours ago

    As others have said, MS, Google, and other major providers are eager to reject or send emails from “unknown” IP addresses to the spam folder. But most people send very little email nowadays and mostly just receive it, so this might not be an issue for you.

    In my experience, having SPF, DKIM, and DMARC properly set from the beginning helps a little. Remember to set the PTR record too. At least Mailcow helps with the DNS setup enormously, giving out most of needed values for you just to copy-paste.

    Unless you’re lucky enough to have a static IP address and the required ports open by your ISP, you’ll need a VPS. Note that some VPS providers block common email ports as well (to prevent spammers from abusing their infrastructure), or require you to specifically request that the ports be opened by customer support. There’s a useful list of suitable providers here.

    I recommend Mailcow. It runs the whole Postfix-Dovecot stack in Docker containers and comes with an easy-to-use admin interface. It’s not the most lightweight solution, but it’s very easy to keep updated with the provided update script.

  • hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 hour ago

    If you wait a little bit, I’m getting Port87 ready to be self hostable. I’m going to open up a public beta program to find any issues. Would that be something you’re interested in?

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

    I did it for many years and had a lot of pains with corporate servers refusing to accept mail from me simply because I was not a known high volume sender, which to them was enough justification to blacklist me as "close enough to spammer or scammer ".

    So much bad mail is attempting to be sent per minute that they’ll discard you just to take the load off their systems. I remember tons of bad mail trying to come to me as well that was being rejected my my server.

  • IsoKiero@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    9
    ·
    3 hours ago

    Go for it. More people should. I’m running postfix+dovecot combo on a VPS running Debian.

    As others have already mentioned, you’ll need a server with static public IP address and a way to change DNS PTR record for it, so in practice for majority of people that means a VPS from (preferably) a reputable vendor. Then you’ll need to set up DNS records for your domain, MX and SPF are sufficient. DKIM and DMARC are nice to have, but not strictly speaking needed, at least for now.

    When configuring your SMTP service make sure that no one other than intended users can send mail trough it. That’s pretty much the most important thing if you want to stay out of blocklists. You’ll still end up in a few and it needs some manual work to resolve, but the longer you run your own server the fewer false positives there will be.

    Some will suggest mailcow or some other ‘all in a box’ service. They very likely work and may even work better than good’ol postfix, but I’d still recommend postfix (or exim, if you lean that way) because they really teach you the ropes and also they support maildir format for mailbox storage which makes it pretty trivial to move and backup stuff between installations as needed.

    When you get the setup running make absolutely sure your backups are in order. Email is so important for a lot of things that losing your inbox may be a costly mistake. Also set up some sort of server monitoring so that you’ll get alerts if something is not right. Email is pretty resilient, it can easily handle couple of hours downtime from a server, but the longer your downtime is the more you risk of lost emails (senders will get a notification that delivery failed, but it’s up to them to react for it).

    There’s a handful of different parts to figure out, but nothing is really that difficult. Sure, you’ll need to understand how email works under the hood and the whole stack is more complex than throwing a jellyfin docker image on your personal server but it’s very much doable. Have fun!

  • kensand@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    19
    arrow-down
    1
    ·
    3 hours ago

    It’s not as hard as people make it out to be. Sometimes you just end up in people’s spam folder; that’s life.

    Some tips:

    1. Maintain the same IP for as long as possible - helps with reputation.
    2. Unless you are in some utopia where your ISP opens port 25 and all the rest, you’ll probably need a VPS. Use a reputable provider. Do your homework.
    3. Make sure you can transfer your IP through host upgrades as time goes on.
    4. Make sure your provider will open port 25 and all the rest.
    5. Make sure your provider will set up reverse dns
    6. Check that your IP isn’t on any of the credible spam lists. Don’t worry 'bout UCEPROTECT3 - it’s a shakedown.

    fwiw, I have been happy with Hetzner + and https://mailu.io/ for my mail server as of late; no affiliation. Going on almost 10 years hosting now.

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

      I’ve been hosting my own email on Hetzner for the last ~10 years. This is good advice. I would add:

      • Spend some time reading about and really understanding DKIM, DMARC and SPF. These are NOT optional, you need them if you want your emails to have a chance.
      • You will have to play around with your config to get it set up right. That’s fine, just make absolutely sure you don’t ever forward e-mails from unauthenticated users.
      • Do not bounce emails.
  • tate@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 hours ago

    I felt the same way about 6 years ago. I host my own on a Linode server (to get a static IP), and I’ve never regretted it. I get blocked as spam here and there, but it’s not nearly the big deal everyone says. There is a lot of FUD around this for some reason.

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

    Btw hosts like digital ocean and vultr by default block port 25. You can request to get that unblocked but don’t expect fast service.

    I wonder if a Cloudflare tunnel kind of thing can make this easier to setup. I’m sure Cloudflare would be blocking said port as well.