posted in Selfhosted

I want to self host my email server.

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: 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.

enPage

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨carloshr@feddit.cl⁩

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

Replying to an earlier post

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.

Replying to @⁨Maroon@lemmy.world⁩

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

Replying to @⁨Maroon@lemmy.world⁩

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.
  3. Make sure your provider will open port 25 and all the rest.
  4. Make sure your provider will set up reverse dns
  5. 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 mailu.io for my mail server as of late; no affiliation. Going on almost 10 years hosting now.

Replying to @⁨kensand@sopuli.xyz⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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!

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to an earlier post

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.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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!

Replying to @⁨the_q@piefed.social⁩

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.

Replying to @⁨brackled@lemmy.world⁩

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.

Replying to @⁨ssfckdt@lemmy.blahaj.zone⁩

I’ve had only one business ask me this once but probably because I rarely have to interact with people for it.

I did consider this when I got the “throw-away” email domain, made it something that’s easy for people to understand.

It’s probably easier that, if you have to verbally dictate someone an email, you sneak a clue about them in there without it being super obvious. Maybe an abbreviation or a number. Like maybe you call it “gym2@” and not “nameofgym@”. Probably better overall all things considered, and as long as it’s unique it doesn’t really matter.

Replying to @⁨ssfckdt@lemmy.blahaj.zone⁩

I rarely talk to people about my email so I have a scheme (pagename_randomlocalslang_threenumbers@reannlegge.ca) when signing up for poop I started using that when I needed a little longer with a “free trial” of something sure I could probably have just gone pagename2@reannlegge.ca, but I wanna say HostHero or some page had rules about how long a email addresses had to be. The only times I have used the businessname@reannlegge.ca was when I deal with the business in person, the first time I had to create the address on the spot and I did not yet have a rondomizer built that I could just wip out and run on my phone, I had to be at home, and the second time it was because I was buying furnature and I knew I was only going to be getting spam on it after the receipt came through so I new it was going to be blocked right away so even if they sold my address no one was going to work out my email address scheme.

I get next to no spam.

Replying to @⁨Maroon@lemmy.world⁩

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.

LinuxBabeBuild Your Own Email Server on Ubuntu: Basic Postfix Setup - LinuxBabeWhy run your own email server? Perhaps you have a website, which needs to send emails to users, or maybe you want to store your emails on your own server to protect your privacy. However, building your own email server can be a pain in the butt because there are so many software components you…

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨tristan@tarte.nuage-libre.fr⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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 IoT Internet of Things for device controllers LTS Long Term Support software version NAT Network Address Translation 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)

11 acronyms in this thread; the most compressed thread commented on today has 5 acronyms.

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

Hachyderm.ioImran Nazar ~ عمران نزر (@Two9A@hachyderm.io)3.24K Posts, 316 Following, 296 Followers · Front-end #typescript developer and general keyboard tapper; author of Internet RFC 7168 (Hypertext Coffeepot Control Protocol for teapots); occasional plumber, more than occasional #c64 #retrocomputing enthusiast, terrible at classical #piano. Header photo is a verdant scene looking over the landscape near Buxton, England, taken from a single-track country road.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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

Replying to an earlier post

I’m also selfhosting mail and I had to do some initial work to remove the server’s IP from blocklists. That was pretty much it.

Receiving email isn’t an issue. Other servers will just send them, I think they only check the blocklists if it’s the other way ’round. Gmail is a bit nasty, they’ll occasionally do weird things if I send out newsletters and mailing lists. But with all the other providers it’s mostly just fine. Issues arise once I (inadvertently) forward spam. That leads to some extra work.

I do have to tune my own spamfilter regularly. So there’s some effort I put in.

Replying to @⁨ssfckdt@lemmy.blahaj.zone⁩

I very rarely have to deal with blacklists for my email servers. But that’s when using a paid-for static IP address. Which is why I asked about budget. When you implement a proper DMARC framework with both DKIM and SPF you’ll have no problems with your emails reaching your recipients’ inboxes. Now, if you let other users send mail from your server you have to make sure they enforce good login security. That’s where you can get yourself on a blacklist.

Running an email server with a residential broadband service makes things more complicated and requires more frequent intervention.

For my IoT email servers, I have to attend to those a bit more with the black lists because even if you purchase static IP assignment with your commercial wireless service, those IP blocks are submitted by the carriers (Verizon, T-Mobile, etc.) to databases like Spamhaus to deliberately flag them as wireless static. With Verizon’s blocks, you have to remove yourself from the soft black list once a year. T-Mobile submits their IP blocks with an additional flag that prevents you from removing your IP from Spamhaus at all, so T-Mobile static IPs are not good if you need to direct send without user authentication.

Replying to @⁨Maroon@lemmy.world⁩

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!

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨UltraBlack@lemmy.world⁩

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.

Replying to an earlier post

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.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨ssfckdt@lemmy.blahaj.zone⁩

Well, kind of true. Email servers depend on the actual server you use, how it is configured, the DNS records and the routing. Those are the main 4 components that can make or break self-hosting email.

I self-host absolutely everything, and email was the last frontier for me, and it scared the shit out of me in ways you probably can’t imagine.

I’m not a developer, certainly not particularly smart, and make so many fucking mistakes on a daily basis that half of them is already too much.

So I decided to study the evolution of email all the way to today, what each part does, how much control I would actually have over each part if they break, and got to work. This is what landed me on deploying stalwart in a cheap VPS, but even though my VPS allows port 25, precisely because that is the part I have no control over, all SMTP is routed over SMTP2Go.

Do I already understand every single gear involved in detail? No. Am I prepared enough to tackle something that can go wrong? Absolutely, and I’m still learning.

It so happens that my fear came from reading all the horror stories from the people that tried, failed and gave up. Turns out that, while it is the single most involved service I have deployed in my self-hosting track, its absolutely doable. And the level of satisfaction I have with my effort after figuring it all out and finally getting it up and running has no words to describe it.

I decided on this because all the bullshit going on with Proton has convinced me that there are no tech companies left out there worth my trust, so I’m taking this for a long spin hoping to be able to migrate my whole family away from the proton family subscription the moment the 2 years I prepaid for end.

Replying to @⁨jjlinux@lemmy.zip⁩

I don’t at all fear the technical aspects of self hosting. I fear the administrative aspects. If your server is misconfigured or exploited and it gets used for spam, you have to deal with internet bureaucracies to get yourself off of blocking lists so you can still send and receive email. This happened when my domain was hosted by a buddy of mine. He couldn’t keep up with all the blocks – they don’t necessarily tell you you’re blocked, you just notice that you’re not getting certain emails and other certain emails sent are not received. This is why I ultimately chose to move my domain to Google for better or worse, because at least I know they’re not going to be blocked, and email is something where reliability is a bit more important than independence

Replying to @⁨Maroon@lemmy.world⁩

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 mailcow, but as I said: the hosting itself is trivial.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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: 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.

Replying to @⁨Maroon@lemmy.world⁩

I’ve set up postfix and dovecot on my VPS a few weeks ago and it was pretty simple. From my testing, popular email providers (outlook, gmail and proton) accept my mail, but corporate mail might bounce because of av (trendmicro in particlular seems to mark VPS host ips as residential/dynamic, you might be able to request removal tho).

Guidelines recommend setting up rDNS and SPF with DMARC for all mail and additionally DKIM for bulk senders. Mail will still be sent to spam, but shouldn’t be blocked. If you are not using it to send mailing lists and writing only to people that are ok with receiving your mail, it’s probably not a problem.

Make sure you configure postfix properly and don’t make it an open relay, as it could be used to send spam.

For receiving, set up something like rspamd to check for inbound spam, verify other sender’s SPF and DKIM. Test your server to make sure they actually work as intended.

For instructions: check mail provider guidelines and read the documentation for your servers before deploying them. Also be careful to not lock yourself out of accounts if you move things to this new mail.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨ikidd@lemmy.dbzer0.com⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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.

Replying to @⁨Maroon@lemmy.world⁩

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 github.com/mail-in-a-box/mailinabox which just installs and configures everything.

Replying to @⁨Maroon@lemmy.world⁩

As someone who has been self hosting my email for years I have some advice: be wary, this is a difficult service to build well and if you dont then maintenance will be difficult, you risk exposing your data publicly, and your mail won’t be delivered. But if you stick with it you will find it to be incredibly rewarding and not really as much of a hassle as everyone thinks.

If you want something easy that will get you 90% of the way there and make the remaining 10% easy, I cannot recommend mailinabox or iredmail enough. I used MIAB for the first few years I hosted my own mail server, and it did well enough that I’d recommend it if you just wanna host your own mail. However I would recommend against these all in one solutions if you want to actually control, configure, and understand how your mail server works. I was given the same advice when I started and after a year and a half I was working on replacing MIAB with something I built myself.

Where I would recommend starting is the ISPmail guide^1^. This is one of the most comprehensive and well written guides for building a mail server. It does not cover everything, but it will get you a secure and reliable mail server with high deliverability if you keep your domain’s reputation clean. This means making sure your emails arent being blocked and that everything else is adequately secured so that no one blocks your domain; afaik I have only been blocked once when I was first starting out, and I haven’t had any issues since getting off that blocklist. The guide covers DKIM (which require DNSSEC as well), SPF, and DMARC. The guide does not include setting up MTA-STS, Fail2Ban, email auto configuration (i recommend automx2), nor webmail or DAV (i recommend Nextcloud), but none of these things are necessary for having good deliverability or a working mail server.

If you choose to continue, I wish you well and hope you have fun becoming one of the increasingly few self hsoted mail admins left!

^1.^ workaround.org

Replying to @⁨Maroon@lemmy.world⁩

I’ve been running my own email server since around 1996. I go old school with sendmail and dovecot on linux, but sendmail isn’t for beginners…postfix or exim are easier to configure with lots of add-ons available, and others have suggested several other MTAs that are probably just as good. Nowadays its more work to get started with sending emails (w/o getting rejected immediately as spam) since you’ll need to configure DMARC, DKIM, and SPF along with reverse DNS, but not that hard if you’re somewhat technical and willing to learn. The big providers get to set the rules here, and they’re incentivized to make it hard for a self-hoster, because that also makes it harder for spammers. The first few weeks your emails will get directed to spam folders until the providers learn your domain and associated IP address aren’t from a brand new fly-by-night spammer but it’ll taper off, you just gotta keep at it.

The biggest annoyance and work honestly is on the receiving side, with all the spam filtering work you’ll need to do once your email gets onto the spam lists. The big email providers have entire teams set up for this. You’ll also need to set up your own DNS resolver to use spamhaus and spamcop blacklists (which is what everyone uses because they’re so good), because all the public resolvers (and the shared resolvers at your VPS or cloud provider too) are already hitting them so much they get rate limited. Good news is once you get those blacklists configured correctly that’ll take care of probably 80% of the spam, then a standard open source package like spamassassin or spamprobe normallys gets most of the rest.

Another reality is that your home residential connection won’t let you send email from their network; this really reduced spam as people’s compromised machines can’t be used to send spam anymore. However, there are providers out there intended for home self-hosters that will route you a static IP that you can configure reverse DNS on and enable outbound port 25 connections. getrealip.net is one of them, see their guide for self-hosting email here: getrealip.net/guides/self-host-email-server/

Replying to @⁨Maroon@lemmy.world⁩

So what I did has worked great.

Life is way easier if you are running something like opnsense as your firewall. Then you have really good spam filtering available at the firewall through e.g. pfblocker.

I learned Exim. It’s super configurable and stable. I got a VPS and put another instance of pfsense on it with wireguard tunneling back home to my dynamic IP (which pfsense handles via dyndns). The static IP and VPS costs about $5 a month. Exim lives on the home machine and haproxy on the remote VPS handles email receipt and forwarding.

Only a few problems with the IP when new getting blocked by Google. I had my SPF/DKIM/Dmarc set up and requested unblocking and they did it in several days, and that was all.

The advantages here are that you can easily update without changing configs, the wg tunnel is stable, and your host remains on your own server, and pfsesne along with spamassassin and the native routing and session tools in Exim kill most spam.

Some investment up front can really pay off. Oh also you can use ACME on the pfsense instance to handle all your certificates through let’sencrypt automatically.

Replying to @⁨Maroon@lemmy.world⁩

I run my own email server. Of all the services, email is the most complicated and weird and fucked up. It’s hardcore doing it yourself. I’m glad I do, but make sure you have the time and energy to get it all going.

Do serious research first. Make sure you have time. Make sure you have a good VPS or commercial ISP. Don’t be half assed or it will fail.

Replying to @⁨BCsven@lemmy.ca⁩

Besides being bound to their web interface or client apps (no thunderbird) I haven’t found any.

Some folks have complained about service outages or account locks, which is something I haven’t seen in my year and a half using the company, but nearly universally they are revealed to be free users and not subscribed to any tiers of service.

My one and only complaint about my experience inside of using Tuta is a fairly restrictive rules system, after growing up with robust platforms like Ms Outlook. But it’s worth a few Euros a month for me to not use Google and to have excellent calendaring that functions on par with Gcal for me.

Replying to @⁨Maroon@lemmy.world⁩

good luck.

i tried that many years ago and it is lot of work and it sucks. your important emails will get blocked on recipient servers for all kinds of reasons and their emails will end up in your spam folders… and that was before the gmail, outlook and yahoo (that host most of the addresses with which you might want to interact) went full mafia and started inventing all kinds of non-stamdard rules to block smaller providers out and changing them at random.

i admire your intention and optimism but hosting is hard.

Replying to an earlier post

First get a VPS and an IP address and validate the IP address is either not on black lists, or more likely, start the process of removing it from blacklists. You can find blacklist checkers, just search “SMTP Blacklist Checker”.

Then while that’s in progress you can start setting things up. I really found Mailcow to be the easiest and most robust since I wanted OIDC integration. It’s not the best integration and takes a little setup, but it works reliably these days to generate mailboxes and set passwords. You have to include the hashed passwords in your OIDC configuration to get the mailbox passwords set automatically. The web UI does integrate with the OIDC provider though. Mailcow comes with fail2ban and helps set up DKIM and other security settings on your DNS records for proper validation by the receiving SMTP servers and all of that. And has built in spam filtering and virus scanning, though I think virus scanning is not worth the resources it requires since it’s pretty easy to just never open attachments unless you were expecting them. Hopefully most of us know that. So, while it’s tedious, it’s not too difficult if you follow the instructions.

The only issue that I still keep gmail around for is that some companies, especially financial or healthcare companies, will refuse to send email to domains they haven’t white listed and mostly they only white list the big ones webmail sites like gmail or proton or outlook, etc. Not much you can do about that usually since they have a misguided belief that those domains are somehow more secure, even though they are actually selling your mail metadata and sometimes actual content or at least feeding it into AI models which can leak personal information “unintentionally”.

Overall, though, it’s well worth it since I can store as much as I want or at least it’s cheaper storage space than webmail providers. And I prefer the maildir storage over database storage in newer systems since it’s really easy to split and archive data to cheaper storage space. So mailcow works for my needs.