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.

all 74 comments

sorted by: hot top controversial new old
[–] 59 points 10 hours ago (15 children)

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.

  • source
  • hideshow 15 child comments
  • [–] 18 points 10 hours ago (4 children)

    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?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 19 points 10 hours ago (3 children)

    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.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 9 points 9 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.

  • source
  • parent
  • [–] 8 points 8 hours ago (6 children)

    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 ;-)

  • source
  • parent
  • hideshow 6 child comments
  • [–] 8 points 6 hours ago (4 children)

    Ah yes, the hippies at ARPANET

  • source
  • parent
  • hideshow 4 child comments
  • [–] 10 points 6 hours ago* (last edited 6 hours ago) (3 children)

    That was the network, but email itself is a very hippie thing.

    https://en.wikipedia.org/wiki/Jon_Postel

    I cite this article regarding his death: https://circleid.com/posts/in_memory_of_jon_postel

    Jon loved the outdoors. I know he used to enjoy backpacking in the high Sierras around Yosemite. Bearded and sandaled, Jon was our resident hippie-patriarch at UCLA. He was a private person but fully capable of engaging photon torpedoes and going to battle stations in a good engineering argument. And he could be stubborn beyond all expectation. He could have outwaited the Sphinx in a staring contest, I think.

    Edit: Here's a picture of email's hippie-in-chief:

    image

    Seems like he was a great guy, but security was not on his mind back then.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 6 points 7 hours 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.

  • source
  • parent
  • [–] 3 points 7 hours 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.

  • source
  • parent
  • [–] 15 points 9 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!

  • source
  • [–] 15 points 9 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.

  • source
  • [–] 13 points 10 hours ago

    Like others have said, it is not advisable due the administrative overhead, but since you've decided to go down that route, there are some good ones here (https://github.com/awesome-selfhosted/awesome-selfhosted#communication---email---complete-solutions), specifically Mail-in-a-box or Docker-mailserver.

  • source
  • [–] 12 points 10 hours ago (1 child)

    I hear yah, I did the same about a decade ago. I used a howtoforge tutorial from way back then, and its worked well through the years. I host the server at home, and rent a vps with a clean IP that allowed reverse dns to be set on it as my smtp server. Ha! found the link in my bookmarks lol. I am sure there is a better tutorial now a days. Mail in a box might be a good way to go as well.

    Postfix Virtual Hosting With LDAP Backend And With Dovecot As IMAP/POP3 Server On Ubuntu Bionic Beaver 18.04 LTS

  • source
  • hideshow 1 child comment
  • [–] 6 points 10 hours ago

    I use mailcow dockerised. I configured it asking things to ChatGPT. It works fine but tbh… I use it the minimal possible because I’m scared of being targeted by spammers or worst :)

  • source
  • parent
  • [–] 23 points 10 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.

  • source
  • [–] 8 points 8 hours ago* (3 children)

    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.

  • source
  • hideshow 3 child comments
  • [–] 6 points 8 hours ago (2 children)

    I think it's worth shouting out the fellow @hperrin@lemmy.ca and the lemmy community for it !port87@lemmy.ca. In any case, it's nice to be able to talk to the person behind these efforts on Fedi.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 8 points 8 hours 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?

  • source
  • [–] 14 points 7 hours ago (3 children)

    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)?

  • source
  • hideshow 3 child comments
  • [–] 2 points 6 hours ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 4 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.

  • source
  • parent
  • [–] 7 points 2 hours ago

    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

  • source
  • [–] 7 points 9 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.

  • source
  • [–] 7 points 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.

  • source
  • [–] 7 points 5 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.

  • source
  • [–] 7 points 9 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 🤯

  • source
  • [–] 7 points 6 hours ago (1 child)

    I’ve used MXRoute for email before and I’m surprised I haven’t seen this recommended on Lemmy elsewhere. I found out about MXRoute from Reddit many years ago, used it and liked it. No longer a customer for unrelated reasons. The owner is a legit email dude and the service is very reasonably priced with a strong focus on IP reputation. Typically have Black Friday sales, too. Use them (or anything else) instead of self-hosting an email stack!

  • source
  • hideshow 1 child comment
  • [–] 6 points 5 hours ago

    If you really want to do that, https://stalw.art/ seems to have every feature you could want and does not seem very hard to install. The community version is AGPLv3. Thunderbird uses it for their new email service.

  • source
  • [–] 5 points 2 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.

  • source
  • [–] 4 points 9 hours ago

    VPS + Maddy + Roundcube

  • source
  • [–] 9 points 9 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.

  • source
  • [–] 3 points 7 hours ago

    If (when) you decide self hosting isn’t the solution, I suggest mxroute. Lifetime options for reasonable prices, though I got in a number of years ago for $99. Storage isn’t huge for lifetime, but it’s nice to not have to think about it.

  • source
  • [–] 3 points 9 hours ago

    You don’t need a vps or static ip like others are stating. You can get a port reflector service.

    Worth considering is a Secure Email Gateway service which would be where your inbound email is delivered too and check for spam before getting forwarded to your email server. It would also be where your outbound email leaves from.

    Last time I looked it wasn’t exactly cheap to host email once you consider the need for a good SEG.

    Not sure why you’re upset with email services, but once you start paying for their service a lot of the BS goes away.

  • source
  • [–] 3 points 9 hours ago

    Can't help you on how to host the mail server by yourself. But I'd like to point out that critical and complex infrastructure like a mail server is best managed by a team sharing the administrative load.

    With that in mind, organizations like social.coop (which hosts Mastodon and manages it democratically) may be a good solution for you! You don't have to do it alone, but your voice matters and no decision is made without you. Digital infrastructure cooperatives are a very interesting solution!

    Good luck either way!

  • source
  • [–] 3 points 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.

  • source
  • [–] 4 points 9 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.

  • source
  • [–] 2 points 2 hours ago

    I am hosting my own email server on a rented server for multiple years now. Just recently I stumbled upon this post https://jan.wildeboer.net/2022/08/Email-1-Postfix-2022/ which has good explanation and even tutorial style command examples.

    I don’t know if it would work from a homeland, but as long as DKIM, DMARC and SPF works, I don’t see why not.

  • source
  • [–] 2 points 8 hours 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.

  • source
  • [–] [B] 2 points 8 hours ago* (last edited 9 minutes ago)

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

    Fewer Letters More Letters
    DNS Domain Name Service/System
    IMAP Internet Message Access Protocol for email
    ISP Internet Service Provider
    LTS Long Term Support software version
    POP3 Post Office Protocol v3, for email; contrast IMAP
    SMTP Simple Mail Transfer Protocol
    TLS Transport Layer Security, supersedes SSL
    VPN Virtual Private Network
    VPS Virtual Private Server (opposed to shared hosting)

    [Thread #176 for this comm, first seen 22nd Nov 2026, 00:10] [FAQ] [Full list] [Contact] [Source code]

  • source
  • [–] 2 points 5 hours ago

    I had a plan mapped out of how I was going to self host things, I foolishly had a 3 month map of how things where going to going to go. I thought with that I was going to be able to stop paying for services, I have done that, however that 3 months came and went and everytime I needed to use some other service I think hmm can I just self host this? Turns out yes for most things I can.

    When it came time for the email section I found many guides, I had my static IP I would use for email because the host I was foolishly using, HostHero, charged an arm and a leg for unlimited emails and offered no wildcard option. I had already at that time been getting away from Apple at that time for a while but liked their hide my email, and very briefly dipped my toes into Proton just prior to hearing about the CEO’s worship of Trump. So I was ready to go self hosting so I got a simple throwawaydomain to test out my system, I asked my ISP to open up port 25 and put the MX record or whatever on one of my static IPs and I was ready. I had nothing but trouble, I would trouble shoot think it was working and no cigar.

    I thought I would do a chicken challenge with HostHero to try and get them to turn on a wildcard function for me so I had everything set uo with easyDNS, they would be more affordable and offered a wildcard but I would need HostHero know I was moving hosts so they would release my domain. I was really hoping they would send me to some retention path and I could get some deal that was better than easyDNS. When I called the worker bee I got pretty much just said “ok,” I tried poking asking for the wildcard option and a better plan but got a straight out “no, we will transfer your domain though” so I got the code and went to easyDNS.

  • source
  • [–] 2 points 9 hours ago

    @Maroon I did it (and joked about having more reliability than Microsoft Exchange) with Mailcow and a VPS (web hosting alone is insufficient) for a static IP. I have a homeserver. That's optional.With hosts like Hetzner, you need to click a button to request having port 25 opened, and to be approved, you have to have an account with some history in good standing.I used mail-tester.com to make sure my emails appear clean to most spam checkers.

  • source
  • [–] 2 points 7 hours ago (1 child)

    If you're sick of corpos, try Disroot.

  • source
  • hideshow 1 child comment
  • [–] 1 point 5 hours ago*

    I've been trying to sign up for about 2 months now with Disroot. I know they had a big incident recently that took up their time, but the "new user" page constantly says they aren't accepting new users atm and to try back later...

  • source
  • parent
  • [–] 2 points 38 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.

  • source
  • [–] 2 points 1 hour ago (1 child)

    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.

  • source
  • hideshow 1 child comment
  • [–] 2 points 9 hours ago

    Can I ask why you hate switching email services so much? Is it learning something new every time or the hassle of switching over your email everywhere? A lot of people use a domain they own (like emilieeasie@emilieeasie.com) so if they switch hosts they don't need to update it everywhere, and that might solve your problem, unless something else is bothering you

    Personally I think it's a good idea to be ready to pack and move because of exactly what you said: corpos always gonna corpo.

  • source
  • [–] 3 points 9 hours ago*

    I self host email. It's really not that big a project. People way overblow it. I have never had a significant problem running on several years now.

    Check out this tutorial.

  • source
  • [–] 2 points 7 hours ago (1 child)

    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.

  • source
  • hideshow 1 child comment
  • [–] 2 points 2 hours ago (2 children)

    Don't. It's very hard to get yourself off spam lists as an individual

  • source
  • hideshow 2 child comments
  • [–] 7 points 1 hour ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 17 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.

  • source
  • parent
  • [–] 1 point 11 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.

  • source
  • [–] 1 point 7 hours ago

    I switched to forwardemail and have over 30 @domains there. They are very inexpensive and reliable and their new web base multi account email client is actually usable in emergencies.

  • source
  • [+] 1 point 5 hours ago
    [–] 1 point 5 minutes ago

    I feel you mate but from the comments here looks like you'd first need to fix the problem of trust in the internet.. Good luck with that!

  • source
  • [–] 1 point 6 hours ago (1 child)

    What is the motivation exactly?

  • source
  • hideshow 1 child comment
  • [–] 1 point 8 hours ago (2 children)

    A bit off topic, but for my own information, what is wrong with proton?

  • source
  • hideshow 2 child comments
  • [–] 4 points 8 hours ago

    CEO being a dick to employees and forcing the company to become an AI first company and has said that wanting thorough testing of AI code was loser thinking. Basically just wants employees to churn out slop features.

    The fallout of them being called out on this was just a dumpster fire of deleted posts and comments while making employees post from their personal accounts defending the company (pretty badly at that)

    Add all this to the support of Trump's GOP picks and people had had enough to leave.

  • source
  • parent
  • [–] -1 points 7 hours ago

    I have a better idea. Give up on email. It's really only used for spam, or data collecting. I rarely intentionally use email outside of work. So to me, anything that offers some security or privacy are done. Tuta and Proton are just fine for these purposes.

  • source