392 points · by favourable · 3y ago · 244 comments
The bulk of work with managing a mail server (these days) isn't software setup and admin. On the receiving side, it's all the work dealing with abuse and attacks. On the sending side -- and this is the tough one -- it's getting sites to accept your email. When I finally gave up managing my own mail server (about two years ago), I found that about every six months I was involved in some panic where some large mail provider (Microsoft and Google most frequently) decided they didn't want to accept email from my server. Solving these issues is neither easy nor quick.
These days I'm very happy to pay somebody else to run email services using my provided domains.
Spam is a solved problem, thanks to SPF and DKIM. But despite doing all the right things, Microsoft and Google continuously block and rate-limit delivery.
Case in point: we deliver 20,000 booking confirmation emails every day, all requested by users and not spam. We have perfect Postmaster Tools metrics: absolutely zero reported spam, 100% IP reputation, high domain reputation, zero feedback loop spam, 100% encryption. But Gmail still rate-limits us daily, so their customers get their booking confirmations several hours late.
It's getting to the point where running an independent mail server is impossible. Yet another part of the open internet bites the dust.
Spam is only “solved” on big providers because they mostly accept mails only from other big providers.
---
I would argue that “running an independent mail server” and mass-mailing are two entirely separate concerns.
> Spam is only “solved” on big providers because they mostly accept mails only from other big providers.
I would say that only accepting emails form other big providers isn't a good solution then.
I've reasons to believe that Gmail users get more spam emails as they report these.
It would be nice if such outsourcing went into other parts of the net (e.g. captcha).
Sure, you can buy domains but that leaves some paper trail and generally you will see added spam scores for new domains.
So SPF and DKIM don't improve spam scores on their own, but the give a much more reliable path to building reputation.
After the great Gmail exodus two years ago (when they killed then unkilled legacy domain accounts), I moved to MXRoute — and the amount of unfiltered spam I get is insane. It's a daily nuisance. I have added about 200 filter words now, blocked hundreds of e-mail addresses, but it's next to impossible to filter out sometimes.
From conversations and threads online by the MX Route admin, it seems like this is a nearly unsolvable problem, still. Spam evolves so fast and uses throwaway one-time approaches only, so once you've filtered for a pattern, the next campaign looks completely different.
So, yeah, sorry about the long response, but I don't think Spam has been solved, at all, at least not if you're using an e-mail that's been around for longer than a few years (and appeared at least in one leak).
What's even crazier is that they are so confident in their spam filter that they simply reject mails classified as spam. But that hasn't been a problem since the few years I have been using them as well.
The only filter I have is a couple of regular expressions to block the most lazy of spam at submission time. Even without that I got less than 50 spam mails a day, usually quite a bit less - and almost all of those are automatically sorted into my spam folder. How long does it take you to glance over a low two digit number of emails each day? Not a lot for me.
I think the "spam" problem is overrated. Do you get more spam than me or do you just have different expectations?
Those days are long gone, and the reason why is that monopolistic companies hate open protocols like email and want to 'monetize' everything they can.
There are approaches that work well, on a small scale, but "solved" is a step too far.
I’ve heard “there’s a lot of work being done on…” literally thousands of times. Yet outside of the crypto-sphere I’ve only met a handful of people who’s life would be impacted in the slightest if the entire thing disappeared.
Ethereum is eight years old and debates about use cases, etc aside I think even someone towards the middle of the debate can readily acknowledge progress, utility, value, and adoption has been incredibly slow.
Consider ENS - the last time I registered with ENS the process was just as confusing and convoluted as ever, only in this instance with gas fees I paid around $300 for the name. Oh, and the various transactions kept failing - leaving me wondering (per usual with crypto) if my funds went up in smoke, off to some scammer, etc.
Like so many times in crypto before I just assumed the funds were gone but like I said I DO follow this space and DO find it interesting so I consider burning crypto left and right a relatively cheap education/hobby. Plus I get to tell cool stories like this one on HN ;).
I can’t imagine how creaky, bug ridden, impossible to scale, nearly impossible for mortals to use, and inevitably completely overrun by scammers and frauds an Ethereum (or any crypto) based mail and messaging system would be. No. Just no.
With every day, week, month, and year that passes hearing “We’re building! People are working on XYZ!” when meanwhile the only thing people actually see is the latest headline for some crypto criminal, fraud, scam, collapse of last years “use case” (NFTs anyone?), etc.
I’m not saying it’s dead but I think it’s pretty safe to say the window for anything approaching mass adoption, credibility, and real utility has closed.
“Stop trying to make fetch happen! It’s not going to happen!”
The _real_ problem is reliably getting your 100% legit mail into your consenting recipients' inboxes.
Ingress - out of the box rspamd is pretty decent and it is rather configurable.
Egress - DNS (A,AAAA, PTR), (E)HELO, SPF, DKIM, DMARC. "IP Reputation".
There are absolutely no shortcuts and yet most of the problems I diagnose regarding email delivery will find a missing PTR record or a miss-configured (or non configured) HELO. You cannot be lazy when it comes to email. SPF + A + AAAA + PTR and (E)HELO is a minimum.
There is one thing that you cannot generally, personally mitigate and that is being on a deny list due to your IP address. This one is a bit more tricky to deal with. You might have to use a relay. Another mitigation might involve IPv6.
Any insight into why this is a giant ball of complexity? I’ve had to setup spf, dkim, dmarc a couple times now and man… design by committee?
Am I missing something not knowing what HELO is ??
Extremely filtered emails is practically the same as a social network determining what I can see at this point.
Web standards have advanced to a level that walled gardens are replacing email. Email itself is still stuck on IE6 level standards. And SPF, DMARC and DKIM are a confusing mess to deal with.
It's amazing that having someone in your address book isn't enough in many cases. Like, why?
You would really think that Google would whitelist emails within the same custom domain which is paying for Gsuite service. Maybe that has changed, but it was definitely a problem 5 years ago.
And we're not talking about an email which had some copy/paste of spam, we're talking about a one or two line sentence giving an instruction or asking a question to a colleague.
If they pass their log through a scanner, come up with a few dozen small servers that look fishy (e.g your IP is contiguous to some other spammer’s IP), and yours is rope in as false positive, you’re banned.
And from there you’ll have to convince Google that you’ve done nothing wrong.
Just let ChatGPT send emails to itself, using mail server and client software that it wrote itself, and the rest of us don't have any need to handle email ever again.
On the other hand, I'm also sending email for a client through AWS SES, and those emails are regularly blocked due to their IPs being on a blocklist. And indeed I also get spam delivered through AWS SES. I understand that it is a cat & mouse game for mail service providers to prevent spam being sent through their services. My point: switching to cloud providers doesn't magically solve your mail problems.
Aonther issue with large mail account providers (gmail at least), is that they will accept & deliver your message, but just "deliver" it to the spam folder. It's so annoying if mail is accepted but you don't know if it is actually seen by the recipient. This erodes trust in email. I understand mail servers don't want to tell spammers whether their email is accepted/rejected, but I would prefer a few more spams in my inbox if I at least won't miss emails.
that's what those embedded 1x1px images are for
I'm self hosting email servers for multiple domains for now nearly 25 years. When moving to a new hoster with new IP addresses (especially Hetzner, as it is cheaper and seems to attract more malicious people), I have to contact Google, Microsoft, Yahoo and one or two other big providers to clear my IP address range. This has to be done only once and usually is resolved within hours (faster for automated sites). The bigger ones have a web page to do this, others can be reached via email and are always replying quite quickly. So after a day, everything works and once it works, this never changes and mail gets accepted.
These servers are being used by multiple users and businesses and none have reported any problems. For decades.
I am only using dedicated servers though and using everything in the book: DNSSEC, DMARC, SPF, DKIM, proper DNS records, TLS with valid certs and a correctly behaving SMTP server...
I self hosted because I wanted to prefer not to be part of the huge o365/Gmail/iCloud monocultures.
Last year I moved my mail to an old fashioned shared webhosting account at Hetzner. Very happy with it!
How exactly is that solving the problem? If anyone does something remotely spammy from that ip, your mails are spam again too. And you probably got lucky that the ip you're sitting on was warm and trusted to begin with. You didn't really find a solution, the problem simply hasn't occurred yet for you or you are not aware of it yet.
GP is right. Self hosting email sending (and by that I mean any solution where you control the mail server) doesn't work unless you accept that you will randomly end up in spam folders and sometimes not delivered at all.
So either get a package at some of those smaller providers with a dedicated IP, or go to one of the big providers (Google, Microsoft) and use their highly trusted IPs, that everybody whitelists by default.
Instead, the hosting provider will operate a mail service for you, much like Microsoft 365, G Suite and the like. They will also take care of the IP reputation, SPF, DKIM and all.
Many small busineses have their 'online' presence like that. If I have mail deliverability issues, it's not my problem any more, I can call Hetzner. And before I started using it I was sceptical because if Hetzner did not fix the reputibility of their IPs or the spam from their other customers, it would be a problem for me. But so far, it worked quite well!
I was in a similar boat, though I bailed much longer ago than you. I think "Big Email" is happy to let enough spam flourish in the world so that it presents enough of an excuse to tighten the screws to make it effectively impossible to run your own server... just so that more and more mail goes through their servers to be mined for personal data. That's why I don't use Gmail any more, but it wouldn't shock me to find out that Apple is doing something with my email data too.
They could also provide Cloudflare-like spam and DDoS protection for receiving mail
This is an honest question, in my opinion the only way to make Google more friendly with self-hosted mail servers is their users complaining about or leaving Gmail.
Tell me you don't know about password security without telling me you don't know about password security
> SMTP - port 25, 465 (TLS), 587
Tell me you don't follow RFCs without telling me you don't follow RFCs
> https://poste.io/doc/license
you are allowed to run unlimited count of instances for your own use only
you can't sell or distribute container images to third parties, every mailserver operator needs to have its own license
Rather take the 3 hours to just set up all that FOSS software myself and give it away to everyone for free but thanks anywayThe implicit TLS submission port got deprecated for a brief time, but it's no longer deprecated.
Explicit TLS is a terrible idea and for that reason it's recommended to provide implicit TLS (submissions).
In seriousness, installing Roundcube on my own server circa 2006 was the cause of the first and only time I’ve had a server hacked. It’s probably improved since then or it wouldn’t still be around, but it put me off ever hosting my own email. The risks only get worse the further away you get from personal/hobby use.
For my current server I had to switch IPs a few times, until I got one that was not blocked by any of the major providers. Unblocking a once blacklisted IP seems to be practically impossible.
And hotmail or outlook.com just mark a lot of email as spam. I see it now as a problem of the recipients. Office365 just accepts the same emails, it seems to be a strategy of the free mail providers, to give their non-paying customers a worse experience.
This is with a "real" mail server, and not mailu.io, but the idea is the same.
You mean global monopolies, for which there is no legislation for. Ergo the US Govt is holding the rest of the world hostage via its tech companies.
Haha, same. I've run my own mail servers, got the tshirt, and don't want to have to do it again. Point your domain to one of a bazillian email services instead.
Putting up any type of software on a unprotected server even in 2006 is begging for trouble.
Email servers in particular are going to be under attack all day long just from normal email activity, and that’s before you throw in any kind of web interface. It can be a big help to point your MX records at some other filtering service, but at that point why are you bothering hosting your own?
The services may have their own auth system on top of that, but htpasswd in front solves the vast majority of problems. Can’t exploit an SQL injection vulnerability if you can’t reach the endpoint in the first place.
I’m less concerned about apache2 and nginx http basic auth vulnerabilities. They’ll get fixed much quicker than random webapps.
Anything else goes behind a VPN.
You don't have to give the entire world access to your web server. You could even use something like AuthPF to allow yourself to access it. Or a VPN like Wireguard. I do the latter now, but I used to do the former. Although back then I just used Mutt over SSH usually. Way faster than the web software I ran back then (probably Apache with Horde). What remains is all the stuff required for sending and receiving email. SMTP, IMAP, and the stuff to deal with spam (some kind of tarpitting as well as SPF/DKIM). In fact even the IMAP server could run behind Wireguard. So its only SMTPd and SPF/DKIM. There are some very secure SMTPd written, with great track records. Back in the days I ran Qmail with Courier-IMAP but I don't think SPF and DKIM existed back then.
So far no break-ins that I noticed. But it is for sure possible that somebody broke in without me noticing (and did nothing worth noticing).
Kudos to those of you in this thread who live the dream, though (really).
SHA512 isn't a good choice for this, because it's optimized for fast low-memory computation. Why not use bcrypt or argon2, which are industry-accepted best practices for password hashing?
This has been flagged on Github and the dev's response was "well, don't run anything important on a free server" and that was basically the end of that. I was pretty disappointed with that, but on the other hand there's nothing that prevents you from building the images yourself on ARM.
Only complaint would be to allow for multiple webauthn/fido2 keys per account. You can add a TOTP key to 3 yubikeys, but it's an additional hassle.
Why not exim or something similarly solid and well-understood?
I was expecting to see Postfix instead of Haraka. I wouldn't have been very surprised at exim.
I never understood what use Webmail is, if you can’t access your contacts. Every email client I use, needs access to my contacts.
That's the goal, to avoid things as "solid" as exim.
I was running helm (a hardware device plus mail with many of those features) but they couldn't get anywhere in the marketplace.
iRedMail has exactly the same components, and from what I can see almost exactly the same flow logic, except its available on BSD platforms as well as linux.
It's quite reasonable that vendors don't support BSD due to the input-output ratio.
Maybe there're many BSD servers, but not many BSD EMAIL servers compared to Linux.
Take some real numbers of some iRedMail release, when it's been deployed on 22832 linux servers[1], only 300 BSD servers[2] deployed.
[1] Including Ubuntu 20.04 + 22.04, Debian 10 + 11, RHEL/CentOS/Rocky/Alma 8 + 9.
[2] Including FreeBSD + OpenBSD.
I think the fact that it includes SoGO with Cal/CardDAV and active sync was the main reason, poste.io doesn’t seem to provide a solution for contacts and calendars.
I’m still very happy with mailcow. And they include all features in the free version.
I have a vanity domain, and used to be able to use GMail to send email as that domain [1], and forward received mail from that domain back to GMail.
But with SPF, DKIM, and DMARC (or something), this has broken and such received email gets marked as spam and/or phishing.
I don't know how to fix the forwarding/receiving flow [2], because GMail will see the message coming from an arbitrary source, but being forwarded by an intermediate (my hosting provider's forwarding email server) which will fail its integrity checks.
I have not been able to understand how to solve this. Clearly, forwarding servers aren't a well-regarded use-case in this new era of verified email flow.
Also, I'm not just talking about GMail. I used to do forwarding for my family who used a variety of providers, so I can't just switch to GMail (via Google Domains) for my entire domain.
[1] GMail still offers that feature, under Settings->Accounts and Import->"Send mail as"
[2] the sending flow is easy: just add gmail's SPF to my own domain's
The simplest solution is to set up IMAP on your mail server and have remote mail accounts fetch from it. Most email providers can be configured to fetch via IMAP.
The problem is that there is no such thing as mail forwarding. It is mail re-sending. So, you get a piece of spam and re-send it to Google, and the From address isn't the spammer, it's you. They'll eventually block the email address, and then the whole domain it's on.
Don't forward. SMTP. SMTP is authenticated, which solves the issue.
https://en.m.wikipedia.org/wiki/Authenticated_Received_Chain
> Validating an ARC chain only makes sense if the receiver trusts the ARC signers. In fact, an ARC chain can be counterfeited,[3] so ARC processing applies when receivers trust the good faith of ARC signers, but not so much their filtering practices.
Is there any documentation on how GMail and Hotmail onboard a ARC-using domain? Their documentation is very... sparse.
But I'm not really satisfied with the sending side of things - my plan doesn't include the feature, and sending via Gmail is enough most of the time, but setting up each alias manually in Gmail is quite annoying.
I personally run: - Proton Mail (not self Hosted but for some addresses) - Haraka - Maddy
For people new to self hosting email I recommend maddy over the usual postfix + dovecot
[0]: https://vadosware.io/post/its-never-been-easier-or-harder-to...
Note: IMAP storage is "beta". If you are looking for stable and feature-packed implementation you may want to use Dovecot instead.
So at this point it replaces postfix.
That warning has been there for a while -- I don't think it's accurate at this point -- You can use SQLite or other DBs to hold your IMAP data:
https://maddy.email/reference/storage/imapsql/
https://maddy.email/reference/blob/fs/
https://maddy.email/reference/blob/s3/
I've used all three of these actually (over the years -- more recently I've moved a bunch of my imapsql workload to S3-compatible storage on Backblaze) and they work great.
If you're sending and receiving gobs and gobs of email maybe think twice, but for someone who is dipping their toes into self-hosting email maddy is one of the best choices out there.
As usual YMMV, and back things up, if they are important to you.
How much of the configuration can be data-driven from SQL sources? Just the users? What about multiple domains? Aliases? etc. Something like the MySQL interface with PostFix [1]
What advantages does this have over just running RoundCube myself? The things listed on the pricing page seem fairly superficial.
Gmail from my gmail to my personal email account the past couple of months can take anywhere from a minute to over an hour, that's been odd. Gmail from my gmail to one of my other gmail's or from Hotmail to my personal or from Yahoo to my personal are all fine.
Delivering from my personal to my gmail has been fast and consistent. It's odd that from my own gmail to my own personal can sometimes be slow the past couple of months.
Other than that though, I've found running my own server to be liberating to have the option. Probably doesn't mean anything any more but I feel good to be able to do it.
If the developers are reading this comment, I might be able to help tighten and smooth that out. I have 99.9999% English fluency and write at the highest calibre.
Currently the best I have found is Postal.io, but its not really light.
Have you tried Emailengine?
Seems open-source to me.
The most important (well hard because I needed ISP collaboration) step was to get a reverse DNS for the IP.
I am sending emails from a few domains, so not too much. And my volume is low (10 per day).
I run openbsd and I mostly followed that guide https://prefetch.eu/blog/2020/email-server/
While I can understand the paranoia, bottom line is that the number of domains that can successfully send mails is now seriously limited to a few big players who now have a virtual monopoly on emails. Which is not really good in my opinion...
No error, No blacklist
Perfect Solución !