So, as the topic says, I’m going to set up a self hosted email service for myself, family and friends. I know that this one is a controversial topic around here, but trust me when I say I know what I’m getting into. I’ve had a small hosting business for years and I’ve had my share of issues with microsoft and others, I know how to set things up and keep them running and so on.

However, on the business side we used both commercial solution and a dirt-cheap service with just IMAPS/SMTPS and webmail with roundcube. Commercial one (Kerio Connect, neat piece of software, check it out if you need one) is something I don’t want to pay for anymore (even if their pricing is pretty decent, it’s still money out from my pocket).

I know for sure I can rely to bog-standard postfix+dovecot+spamassassin -combo, and it will work just fine for plain email. However, I’d really like to have calendar and contacts in the mix as well and as I’ve only worked with commercial solution for the last few years I’m not up to speed on what the newest toys can offer.

I’m not that strict on anything, but the thing needs to run on linux and it must have the most basic standards supported, like messages stored on maildir-format (simplifies migration to other platform if things change), support for sieve (or other commonly supported protocol) and contacts/calendar need to work with pretty much anything (android, ios, linux, windows, mac…) without extra software on client end (*DAV excluded, those are fine in my books). And obviously the thing needs to work with imaps, smtps, dkim and other necessities, but that should be implied anyways.

I know that things like zimbra, sogo and iredmail exist, but as mentioned, it’s been a while since I’ve played with things like that, so what are your recommendations for setup like this today?

41 points

For self-hosting, be mindful IP addresses have reputation scores and your IP needs to build them up positively. You need to have reverse DNS set, DKIM, SPF records etc for a more trusted reputation, domain reputation etc to not be flagged and sent to spam folders. I just got the $1/month Proton E-Mail for 10 addresses for 1 custom domain as I didn’t feel like dealing with any of this with self hosting, but props for going the self-hosting route.

permalink
report
reply
11 points

ISPs often have SMTP relay servers. If you hook into that, your mail gets instant street cred.

permalink
report
parent
reply
7 points

Amazon SES is good for this too. I use it in combination with postfix for the outbound mail. Granted it feels a bit like cheating on the whole self hosting part, at least for outbound. And I only started doing it in the past year of self hosting for 20 years. MS (Hotmail, Outlook, Office 365) was by far the biggest asshole in randomly denying delivery from my (well maintained reputation wise and well configured) outbound IP before switching to an SES relay. Fuck em, seriously. It’s not just about preventing spam, it’s clearly a strategy towards email dominance. Other big players are guilty of this too though.

permalink
report
parent
reply
3 points

Yes, you’re right. But to be honest, it only took me four weeks of perseverance and a few mails to the administrators of spam lists and I had no more problems with receiving and sending mail.

If you set up your mail server correctly and also enter a postmaster address, you will be informed of any problem, no matter how small, and can address it promptly.

I was surprised at how quickly and, above all, helpfully the staff at the spam list providers respond when you write to them politely and, if necessary, ask for more background information and best practices.

It was definitely worth it for me and I would do the work and build up the knowledge again at any time. As a result, you have maximum freedom in configuration and extensive options for customizing your own workflow in dealing with emails.

permalink
report
parent
reply
27 points

You may have already read this but I always think back to this blog post about self hosted email:

TLDR;

  • Mail is not hard: people keep repeating that because they read it, not because they tried it
  • Big Mailer Corps are quite happy with that myth, it keeps their userbase growing
  • Big Mailer Corps control a large percentage of the e-mail address space which is good for none of us
  • It’s ok that people have their e-mails hosted at Big Mailer Corps as long as there’s enough people outside too

https://poolp.org/posts/2019-08-30/you-should-not-run-your-mail-server-because-mail-is-hard/

permalink
report
reply
8 points

My problem is what happens if my internet goes down when there’s an important email or something. I suppose I could run it on a VPS just in case, but that’s still not as reliable as an email service, nor is it necessarily cheaper.

So I pay for Tuta email. It’s €3/month, supports my custom domains, and generally works pretty well. My VPS costs €4.5/month, and I may get rid of it once my city finishes rolling out fiber because I only need it due to CGNAT. Neither is particularly expensive, but Tuta is really good value for what I get. If my family members want to join, costs will go up (€3/user), so I may consider switching if that happens.

permalink
report
parent
reply
8 points

SMTP retries. It’s resilient. If it fails a couple of connections it’ll even let the other side know it happened and when it’s going to retry. If it can’t get it to you in a couple of days it’ll let them know it was not able to deliver.

The rest stands true, hosted Mail is dirt cheap and is more reliable I’m trying to host it in a non-professional capacity.

permalink
report
parent
reply
2 points

Ah, interesting. I have two domains, one for personal (family and friends) and one for online crap, so maybe I’ll try moving one to be self-hosted. Or maybe use one of my other domains (I have several).

permalink
report
parent
reply
4 points

You won’t be able to host email on a residential IP - all of them are on a permanent blacklist. I understand the money argument - and it’s a real argument - but host your own email is just so cool!

permalink
report
parent
reply
3 points

Good point. Does the same hold for popular VPS services? I’m behind CGNAT so I need a VPS regardless, but others may prefer to have it at a VPS if they want to mitigate extended service disruption (i.e. equipment dies while they’re on vacation).

permalink
report
parent
reply
5 points

Well, from personal (professional) experience Email is hard.

permalink
report
parent
reply
24 points

I’ve been using mailcow for about a year and i am very satisfied, it checks all your boxes and is easy to configure and deploy over docker.

permalink
report
reply
5 points

Just beat me to it…

The one thing that they don’t have yet last I updated, though they’ve been working on it for a while, is a prod ready LDAP/SSO connection. I had the dev branch working with Keycloak, but never got plain LDAP to function.

permalink
report
parent
reply
1 point

@ShellMonkey I use the Generic OIDC option, havent tried LDAP.

permalink
report
parent
reply

I tend to keep things simple so if I can it’s easier to not set up the separate auth middleware when there’s already an AD comparable system in place.

Another option I’ve used before is called Neth Server, but that’s more one of those SOHO all-in-one systems rather than a dedicated mail box.

https://community.nethserver.org/

permalink
report
parent
reply
3 points

Mailcow-dockerized is bulletproof. Never had a problem with it and has been rock solid.

permalink
report
parent
reply
2 points

Another container-based alternative in that space is Mailu.

permalink
report
parent
reply
1 point

I also use Mailcow with three domains (one business). No problems with it from day one. Updates run regularly and smoothly like clockwork. I am happy to recommend it to others.

permalink
report
parent
reply
1 point

I am happy to recommend it to others.

If they ever support non-Docker systems again, I might be curious. Right now, I couldn’t even use that.

permalink
report
parent
reply
1 point

Second this. Mailcow very easy to setup, though the docs could use improvement. This might have changed already.

That said, I found it easier to pay for a domain and email service where they worry about reputation and random microsoft blacklists.

permalink
report
parent
reply
2 points

Yeah, Microsoft are the worst. Even after doing all the proof of work (reverse DNS, DKIM, SPF, …) and registering for their spam prevention postmaster tools equivalent, I still found myself randomly blocked for delivery sometimes.

permalink
report
parent
reply
1 point

3 years and counting here, I host my own company email and a couple of clients, 120 email accounts and only had one issue with a compromised account, limit each domain to 100 sended emails and I can catch spam emails with enough time before my vps provider notice anything

permalink
report
parent
reply
18 points

I’ve been playing with Stalwart-Email as a combined SMTP/IMAP server. Its open source and written in rust, still pretty early in development and I haven’t played with it enough to give any real opinion on the pluses or minuses compared to other software, but its worth taking a look at.

permalink
report
reply
3 points

Stalwart is 95% awesome. What holds me back is, that Mails are stored in a Database and not Maildir. Maildir is insanely trivial to backup incrementally and to restore individual mails if necessary. That currently holds me on dovecot.

permalink
report
parent
reply
2 points

Currently using Stalwart after about a decade of using iRedMail. Stalwart’s setup was such a breeze; I let out an audible laugh/noise when the install completed in the blink of an eye and had all the DKIM, DMARC, SPF, etc. settings available for config.

Making some nice improvements with each release too, proper user management, etc. Definitely a fan. Looking forward to when they support CalDAV and CardDAV.

permalink
report
parent
reply
2 points

I’m also using Stalwart! It just works!

permalink
report
parent
reply
12 points

My stack is postfix, dovecot, slapd for accounts, SoGO for web mail, calendar and task and contact management. Syncs to my phone via davx and just works out of the box. It’s multi domain and my small company even sells hosted email services.

Rspamd for anti spam and dkim. Use a free email testing service to confirm SPF etc are setup correctly.

Also make sure you have regular backups and up to date lets encrypt certificates.

permalink
report
reply

Selfhosted

!selfhosted@lemmy.world

Create post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

Community stats

  • 3.7K

    Monthly active users

  • 2K

    Posts

  • 23K

    Comments