This project's scope is rather impressive, and from what I've gleaned from skimming its docs, it might be the perfect solution for people who want to self-host email.
It tries to have most of the advanced/difficult things (like getting DKIM set up right) taken care of for the postmaster, as far as that is possible within a single application. I love that it will print the DNS records you'll need to set up in your zone during setup. If I were to start over my personal email setup (postfix with postscreen, dovecot with fts, opendkim, amavis/spamassassin), I sure would try it with this.
Yeah, that's my impression as well. I've been wondering about this sort of setup for a while – there's a lot of moving parts in traditional email servers, and projects like poste or univention/zimbra/… that just try to glue these massive stacks together have always been far too fragile and involved for any setup that's smaller than "we can afford a dedicated sysadmin for emailling".
The only feature I'd still want is Sieve, then it'd be good enough for not just home setups, but probably also SMBs.
It doesn't look like it supports mailbox sharing or public folders, which are very helpful for collaborating in a SMB, especially with shared email addresses (e.g., sales@business.com).
Do you know how this is typically used/configured? Do accounts get this shared account (mailbox(es)/folders with messages) as folders in their own account? So next to your own Inbox and Trash, you would have Sales/Inbox and Sales/Trash? If you delete a message from Sales/Inbox, does it automatically go to Sales/Trash? How is that done? Perhaps IMAP namespaces?
I have figured folks can just add another account (IMAP connection) to their mail client. Either a shared account (e.g. sales@), or account of a colleague. And then the account (mailbox) is shared. Perhaps it's because webmails are just for a single account and folks would have to have multiple mail browser windows open? Or business folks are just not used to this approach? Or perhaps they want an admin to inject some shared mailbox into an existing account without requiring any user action? Public folders sound a bit like a mailing list, from what I just skimmed from Exchange documentation. I presume the message flags (Seen/Read) are per-user? So it's more like delivery to each members copy of the public folder, instead of an actual shared folder?
The scope isn't revolutionary - I've used https://mailu.io/ for years for a few 10s of users, and I really like it. I've heard similar good stories from Mailcow users.
On a quick skim I couldn't tell what was new relative to these older compose-based solutions but (as co-author of similar solution 10-15 years ago) I'm interested to know!
What's revolutionary is that mox implements the entire stack itself as tightly coupled monolith.
With mailu and everything else you get a gargantuan stack of half a dozen massive, enterprise scale servers that are held together with duct tape and prayers. They can scale out to hundreds of thousands of users, but if anything breaks they expect there to be dedicated sysadmin staff to fix it, and gluing leaky abstractions on top doesn't really solve these fundamental architectural challenges.
I suppose it's mostly from a technical perspective: Single code-base, single binary, written in modern language (Go).
There are advantages to an integrated solution: The junk/nonjunk flags you set in your mail client are used to assess incoming email (based on full sender/domain/orgdomain/spf/dkim/ip/ipsubnets). I'm not sure how common/feasible that is with solutions that combine mail server components. I've used postfix & dovecot before mox, I admittedly didn't closely look into it but assumed that combo cannot do that.
With component-based solutions like Mailu, the junk/non-junk categorization you do in your mail client (via folders, not flags) indeed does inform the training of the spam filter used on incoming mail.
> If I were to start over my personal email setup (postfix with postscreen, dovecot with fts, opendkim, amavis/spamassassin), I sure would try it with this.
I am tempted to give that sort of thing a try, as successor to the franken-"postfix with postscreen, dovecot with fts, opendkim, amavis/spamassassin" contraption (actually Courier, not to mention LDAP, greylisting, a couple webmails, OCR, blacklists etc.) that we have been maintaining for two decades in service of friends & family. But, for all its flaws, once put in production that setup on Debian packages Just Works - with upgrades and distribution version jumps handled almost flawlessly. I doubt that any of the new generation of integrated "mail things in a box" products that pop up since a couple of years have anywhere near that staying power. Does someone here know some that put long-term maintainability at the top of their priorities ? It seems to me that they all optimize for quick onboarding.
Same. There is a large vocal contingent who confidently declare in any online space that hosting your own email is impossible these days. And yet, those of us who have been for years are managing it just fine.
Yes, it takes some understanding of how things work. Mine has been chugging along for longer than I can actually remember with very little maintenance needed, aside from regular package upgrades. The only time I ever had an issue with mail providers rejecting mail from my domain was when my wife started sending out school newsletters containing links to a shady URL shortener, but that was fixed pretty easily.
That is most often caused by reputation issues around the IP where your mail server lives. If you host it at home or in any “residential” block of addresses, then most definitely. Same if hosted on a VPS or with a provider whose address space may have been burned by spammers spinning up machines and then redeploying them when they start getting blocked. As someone said further down below, you can still host at home and use Amazon SES as your verified outbound relay. I do that with the Axigen free email server, and I have no issues with reputation.
1. I was very careful to make sure that the IP address I was assigned was not on any blacklists.
2. I don't know if it actually helped. But after setting it up, I got a whole bunch of family/friends to email me from their gmail/hotmail/o365 addresses first, and then I replied to them. The theory was that gmail/hotmail wouldn't mark me as spam if their own addresses were initiating the conversation. Seemed to have worked well. I have had only one case of my email getting completely blackholed (not put in spam, just rejected outright) is when I emailed a friend with a @amd.com address. Right now, I am still using gmail for essential professional emails, but slowly getting all my online-services converted to the new email address.
Sieve is becoming a commonly requested feature. (;
For now, mox supports delivering to mailboxes with configurable rules, search for "Rulesets:" on https://pkg.go.dev/github.com/mjl-/mox/config. You can edit the config file (if you're the admin), or use the account web interface to add/remove/edit rules. I use it to get mail from mailing lists to the right mailbox.
Just throwing my 2c in the ring: I've been using iRedMail for I want to say 10+ years now. Just simple linux no-frills webmail with nice admin and default webmail. Best part is it is dead simple to set up, the developer is very nice and responsive on his forum and it has been rock-solid. Granted, I don't send a lot of mail from it but it has been running as a journal for many years without issue. I do send some mail from it--mostly from devices--to my gmail and have never had a problem with blacklisting. I think this mostly depends on your IP reputation so your host and how you host it is important.
I set up docker-mailserver[0] Monday in ~6 hours, most of which were me trying to be fancy using podman instead of docker and dealing with SELinux. But then again I did choose it over mail-in-a-box for just that level of customization. Obviously I can't tell how reliable it will be in the long run yet, but since it's using the classic Postfix/Dovecot stack I expect it'll be pretty stable
Email servers are notoriously difficult to configure, hence all these solutions ranging from tutorials to "everything included" systems. Recent activity on HN about mail servers: Mox, Poste.io from yesterday [1], Mailinabox, mailcow, ispmail, maddy, stalwart jmap, etc.
Many of these systems keep redoing the same work over and over which seems wasteful. What I'd like is a "mail reverse proxy" that does all the work to manage DNS, SPF, DKIM, DMARC, etc and handles sending and receiving emails, but doesn't do any storage or user management. Instead it forwards mail from/to the "real" mailserver sitting somewhere in a private network. (Maybe using LMTP [2]?) This way you could roll the dice until you get a $5 VPS with a clean static IP and just park it there permanently, where it does nothing but sends and receives emails from your real mail server wherever you want to host it. Kinda like a PO box. You never have to worry about upgrading it to get more storage, or switching providers and losing your IP, if it gets hacked the worst it can do is spy on live email traffic and send spam until its patched. Why doesn't this exist already? [1]: https://news.ycombinator.com/item?id=34901703 [2]: https://datatracker.ietf.org/doc/html/rfc2033
> Many of these systems keep redoing the same work over and over which seems wasteful.
There certainly is duplication of effort, but all these systems try to bring something new to the table. > Why doesn't this exist already? Because you haven't written it yet? (; But seriously, I've had a somewhat similar thought. But instead of running a "reverse mail proxy" on a VPS, I was hoping to take a VPS, set up some tunnel magic (with wireguard probably) that forwards all traffic coming in from the internet, intact with original IPs, to my local side of the tunnel, and vice versa. So my local machine just has the same public internet IPs configured as the VPS and all internet traffic is going through the tunnel. So just use a VPS for its IPs. That way my data is not stored at my hosting party. If anyone has set this up already, or thinks this is a bad/good idea, I'd like to hear.
> all these systems try to bring something new to the table
That's great, I just wish that they all didn't have to hurdle the same (very high) bar before they can get to the "something new" part. > some tunnel magic that forwards all traffic coming in from the internet ... to my local side of the tunnel, and vice versa Yes! I considered that too. It'd kinda be like tailscale funnel, which mostly targets web hosting scenarios. Hilariously, they poked fun at the $5/mo vps idea in their article about funnel back in November [1]: > Yes, you could spin up a $5/month VM somewhere and forward a port from its public internet IP to your tailnet with one line in your rinetd.conf file. But is that fun? Do you really need a(nother) Linux VM in your life? (we're definitely being called out here lol) Sadly, funnel wouldn't work in our case because we need an unshared static IP. But that hint about rinetd could help, from the man page [2]: > it is able to redirect a large number of connections without a severe impact on the machine. This makes it practical to run services on machines inside an IP masquerading firewall. [1]: https://tailscale.com/blog/introducing-tailscale-funnel/ [2]: https://manpages.debian.org/unstable/rinetd/rinetd.8.en.html
Wireguard itself can help you out with the task of forwarding traffic or creating an overlay network. There's also ngrok and tailscale for forwarding traffic and doing NAT traversal. Except for wireguard, these are commercial platforms, the open source alternatives I know of, are (respectively):
it's also wasteful in a different way: a lot of effort put towards building on top of a remarkably bad pseudonymous protocol based on anachronistic trust assumptions
from that point of view the refactoring to do is separating identification from transport and storage/lookup - for these things there are very good solutions but there is no cohesive protocol that is solid and widely adopted, and it's unclear if that will happen anytime soon, or ever - rather than just doing away with the mail metaphor in favour of the pager+answerphone metaphor which can be seen as a total overlap as you add features but you're right that since email is here now and it "works" now, especially from a social perspective, then it makes sense to free up people from silos - what effectively webmail and proprietary messaging/social media are - and perhaps the best way is the toolkit approach you describe which would go about email a bit like git did with version control: establish protocols for the separate aspects of the system and then provide the user with a supervisor command tool, which can be automated to some particular use cases if need be but is flexible enough that it doesn't require one particular setup
The way I look at it is that we're gonna have email for a long time, realistically at least another 50 years, probably 100. So if we're stuck with it, we might as well make it as painless as possible.
I totally agree that we should look for better protocols, for example Matrix looks like it could eventually be a good replacement for email. But whatever email is replaced with will definitely need some kind of way to interface with email during the transition, and a pre-built mail reverse proxy / IP gateway will only help with that.
> What I'd like is a "mail reverse proxy" that does all the work to manage DNS, SPF, DKIM, DMARC, etc and handles sending and receiving emails, but doesn't do any storage or user management.
spf, dkim and dmarc are all dns related. Running nameserver and mail servers on the same system doesn't sound like a good idea, nor does having a mailserver with write access to dns-records. using a central administration for both however sounds beneficial. but then why stop there and not add all kinds of other useful features and voila, you have a full blown control panel far away from being a simple solution for mail. I think dns for mail needs to be complicated, otherwise people lightly just set their spf records incorrectly which gets their mailservers blacklisted. or they just will never know why their mails get blocked. if they even find out about that.
The project looks cool! However, I think the hard part of self-hosting email is not the tech stack, it's getting email delivered to your recipients using Google or Microsoft severe email servers. It's hard to rent a server that IP address is not in a block that big email providers consider suspicious already or will soon. And any mishaps can get you locked out and you need manual intervention to be allowed again.
I used to self-host years ago but I've abandoned the idea now.
I've not really had those issues. A temporary block a few times, but that gets resolved.
FWIW, with mox, I prefer not to rely on blocklists (centralized!). Incoming mail is first checked with reputation of the sender. This reputation is only per account. So one accounts junk-classification doesn't affect another accounts. Only for new senders, and without conclusive signals, would a DNSBL be used. The result is that you can keep communicating with folks you've been communicating with for years, even if their IP is on a blocklist. I wonder if the large providers are doing something like this as well. I suspect many mail servers use a DNSBL early in an SMTP session.
Big providers, especially Microsoft, have become extremely heavy handed the last year or so. Now, if a single IP address in a /24 is sending spam, Microsoft will just block the entire /24. And we've had so much difficulty getting Microsoft to walk back that block and not reinstate it later on that we've completely given up providing any type of email service (whether that be day-to-day email needs or transactional emails). I've spent hours on calls with Microsoft support trying to remedy this and it's just impossible once it happens (and I've had it happen multiple times to multiple IPs and had multiple MS techs confirm this is what is happening)
I've set up my email using Mail-in-a-box [0] and it's worked wonderfully. How does this compare with Mail-in-a-box?
Also, webmail, calendaring are future features in this product. I wonder how critical are those for people setting up their own email. [0]: https://mailinabox.email
Comments (130) 30 threads
It tries to have most of the advanced/difficult things (like getting DKIM set up right) taken care of for the postmaster, as far as that is possible within a single application. I love that it will print the DNS records you'll need to set up in your zone during setup.
If I were to start over my personal email setup (postfix with postscreen, dovecot with fts, opendkim, amavis/spamassassin), I sure would try it with this.
The only feature I'd still want is Sieve, then it'd be good enough for not just home setups, but probably also SMBs.
I have figured folks can just add another account (IMAP connection) to their mail client. Either a shared account (e.g. sales@), or account of a colleague. And then the account (mailbox) is shared.
Perhaps it's because webmails are just for a single account and folks would have to have multiple mail browser windows open? Or business folks are just not used to this approach? Or perhaps they want an admin to inject some shared mailbox into an existing account without requiring any user action?
Public folders sound a bit like a mailing list, from what I just skimmed from Exchange documentation. I presume the message flags (Seen/Read) are per-user? So it's more like delivery to each members copy of the public folder, instead of an actual shared folder?
Continue this thread — 1 reply
On a quick skim I couldn't tell what was new relative to these older compose-based solutions but (as co-author of similar solution 10-15 years ago) I'm interested to know!
With mailu and everything else you get a gargantuan stack of half a dozen massive, enterprise scale servers that are held together with duct tape and prayers. They can scale out to hundreds of thousands of users, but if anything breaks they expect there to be dedicated sysadmin staff to fix it, and gluing leaky abstractions on top doesn't really solve these fundamental architectural challenges.
Continue this thread — 1 reply
There are advantages to an integrated solution: The junk/nonjunk flags you set in your mail client are used to assess incoming email (based on full sender/domain/orgdomain/spf/dkim/ip/ipsubnets). I'm not sure how common/feasible that is with solutions that combine mail server components. I've used postfix & dovecot before mox, I admittedly didn't closely look into it but assumed that combo cannot do that.
I am tempted to give that sort of thing a try, as successor to the franken-"postfix with postscreen, dovecot with fts, opendkim, amavis/spamassassin" contraption (actually Courier, not to mention LDAP, greylisting, a couple webmails, OCR, blacklists etc.) that we have been maintaining for two decades in service of friends & family.
But, for all its flaws, once put in production that setup on Debian packages Just Works - with upgrades and distribution version jumps handled almost flawlessly. I doubt that any of the new generation of integrated "mail things in a box" products that pop up since a couple of years have anywhere near that staying power. Does someone here know some that put long-term maintainability at the top of their priorities ? It seems to me that they all optimize for quick onboarding.
Yes, it takes some understanding of how things work. Mine has been chugging along for longer than I can actually remember with very little maintenance needed, aside from regular package upgrades. The only time I ever had an issue with mail providers rejecting mail from my domain was when my wife started sending out school newsletters containing links to a shady URL shortener, but that was fixed pretty easily.
2. I don't know if it actually helped. But after setting it up, I got a whole bunch of family/friends to email me from their gmail/hotmail/o365 addresses first, and then I replied to them. The theory was that gmail/hotmail wouldn't mark me as spam if their own addresses were initiating the conversation. Seemed to have worked well.
I have had only one case of my email getting completely blackholed (not put in spam, just rejected outright) is when I emailed a friend with a @amd.com address. Right now, I am still using gmail for essential professional emails, but slowly getting all my online-services converted to the new email address.
For now, mox supports delivering to mailboxes with configurable rules, search for "Rulesets:" on https://pkg.go.dev/github.com/mjl-/mox/config. You can edit the config file (if you're the admin), or use the account web interface to add/remove/edit rules. I use it to get mail from mailing lists to the right mailbox.
[0] https://github.com/docker-mailserver/docker-mailserver
Many of these systems keep redoing the same work over and over which seems wasteful.
What I'd like is a "mail reverse proxy" that does all the work to manage DNS, SPF, DKIM, DMARC, etc and handles sending and receiving emails, but doesn't do any storage or user management. Instead it forwards mail from/to the "real" mailserver sitting somewhere in a private network. (Maybe using LMTP [2]?)
This way you could roll the dice until you get a $5 VPS with a clean static IP and just park it there permanently, where it does nothing but sends and receives emails from your real mail server wherever you want to host it. Kinda like a PO box. You never have to worry about upgrading it to get more storage, or switching providers and losing your IP, if it gets hacked the worst it can do is spy on live email traffic and send spam until its patched.
Why doesn't this exist already?
[1]: https://news.ycombinator.com/item?id=34901703
[2]: https://datatracker.ietf.org/doc/html/rfc2033
There certainly is duplication of effort, but all these systems try to bring something new to the table.
> Why doesn't this exist already?
Because you haven't written it yet? (;
But seriously, I've had a somewhat similar thought. But instead of running a "reverse mail proxy" on a VPS, I was hoping to take a VPS, set up some tunnel magic (with wireguard probably) that forwards all traffic coming in from the internet, intact with original IPs, to my local side of the tunnel, and vice versa. So my local machine just has the same public internet IPs configured as the VPS and all internet traffic is going through the tunnel. So just use a VPS for its IPs. That way my data is not stored at my hosting party. If anyone has set this up already, or thinks this is a bad/good idea, I'd like to hear.
That's great, I just wish that they all didn't have to hurdle the same (very high) bar before they can get to the "something new" part.
> some tunnel magic that forwards all traffic coming in from the internet ... to my local side of the tunnel, and vice versa
Yes! I considered that too. It'd kinda be like tailscale funnel, which mostly targets web hosting scenarios. Hilariously, they poked fun at the $5/mo vps idea in their article about funnel back in November [1]:
> Yes, you could spin up a $5/month VM somewhere and forward a port from its public internet IP to your tailnet with one line in your rinetd.conf file. But is that fun? Do you really need a(nother) Linux VM in your life?
(we're definitely being called out here lol)
Sadly, funnel wouldn't work in our case because we need an unshared static IP. But that hint about rinetd could help, from the man page [2]:
> it is able to redirect a large number of connections without a severe impact on the machine. This makes it practical to run services on machines inside an IP masquerading firewall.
[1]: https://tailscale.com/blog/introducing-tailscale-funnel/
[2]: https://manpages.debian.org/unstable/rinetd/rinetd.8.en.html
- https://bore.pub && https://sslip.io - https://github.com/juanfont/headscale
I don't think there's anyone using this kind of tools for emails, the technical limitations elude my understanding TBH. This comment might be border to off-topic, but I think the tools fill in the niche use-case you just mentioned. Have fun!
edit: might be of your interest to check this list! https://github.com/anderspitman/awesome-tunneling#recommenda...
from that point of view the refactoring to do is separating identification from transport and storage/lookup - for these things there are very good solutions but there is no cohesive protocol that is solid and widely adopted, and it's unclear if that will happen anytime soon, or ever - rather than just doing away with the mail metaphor in favour of the pager+answerphone metaphor which can be seen as a total overlap as you add features
but you're right that since email is here now and it "works" now, especially from a social perspective, then it makes sense to free up people from silos - what effectively webmail and proprietary messaging/social media are - and perhaps the best way is the toolkit approach you describe which would go about email a bit like git did with version control: establish protocols for the separate aspects of the system and then provide the user with a supervisor command tool, which can be automated to some particular use cases if need be but is flexible enough that it doesn't require one particular setup
I totally agree that we should look for better protocols, for example Matrix looks like it could eventually be a good replacement for email. But whatever email is replaced with will definitely need some kind of way to interface with email during the transition, and a pre-built mail reverse proxy / IP gateway will only help with that.
spf, dkim and dmarc are all dns related. Running nameserver and mail servers on the same system doesn't sound like a good idea, nor does having a mailserver with write access to dns-records. using a central administration for both however sounds beneficial. but then why stop there and not add all kinds of other useful features and voila, you have a full blown control panel far away from being a simple solution for mail.
I think dns for mail needs to be complicated, otherwise people lightly just set their spf records incorrectly which gets their mailservers blacklisted. or they just will never know why their mails get blocked. if they even find out about that.
I used to self-host years ago but I've abandoned the idea now.
FWIW, with mox, I prefer not to rely on blocklists (centralized!). Incoming mail is first checked with reputation of the sender. This reputation is only per account. So one accounts junk-classification doesn't affect another accounts. Only for new senders, and without conclusive signals, would a DNSBL be used. The result is that you can keep communicating with folks you've been communicating with for years, even if their IP is on a blocklist.
I wonder if the large providers are doing something like this as well. I suspect many mail servers use a DNSBL early in an SMTP session.
[0] https://sendgrid.com/pricing
https://www.sendinblue.com/pricing/
Continue this thread — 2 more replies
Continue this thread — 1 more reply
Continue this thread — 4 more replies
Also, webmail, calendaring are future features in this product. I wonder how critical are those for people setting up their own email.
[0]: https://mailinabox.email
Continue this thread — 3 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.