News for hackers. Stuff that matters.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by avian on Sunday December 26, 2021 @09:23AM (#29692565)
It's not the initial setup. It's the maintenance over the years that really makes you question the universe, life and the decision to host your own mail. When you can't send that important mail because $big_provider is blocking you. When someone decides to run a persistent brute force attack from a botnet, eating up 100% of your CPU and you have no meaningful ways to block it. When you need to explain to people why they can't send you that 100 MB video attachment which they sent to other people just fine but only your address is bouncing and why don't you fix your email already. When you need to research, understand and implement standard X pushed by $big_provider because otherwise things will stop working and you have a ton of better things to do. When you get a random alert that email volume is too large and you panic because someone hacked your server and is probably sending spam but realize it was just triggered by a huge kernel patch series sent by someone on a mailing list. When a zero-day CVE for your mail software just hit the top of the HN and the fix is not in your distro yet and you scramble to find a workaround. When a bunch of weird log lines appear in your mail logs and you don't understand where they are coming from and they seem benign but can't lose the feeling that someone is trying something malicious. When you constantly fear that you'll lose that good IP and domain reputation and one day wake up with half of the internet blocking you.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by agrippanux on Sunday December 26, 2021 @09:30AM (#29692620)
As mentioned last week here in a previous “run your own email” story, your setup can also get rejected for not sending enough email, meaning your volume can’t establish good reputation.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by jlkuester7 on Sunday December 26, 2021 @11:00AM (#29693445)
Yeah, my solution for low-volume self-hosted email is to relay my outgoing SMTP traffic through Amazon SES. I get good delivery to all the big players, bit still control all the parts of the email stack that I care about. (Plus at low volume, SES is basically free...)
Re:Deploy a Gmail-like email server in 30 (ish) minutes by ireflect on Sunday December 26, 2021 @03:09PM (#29695842)
I have had very few troubles sending outbound email directly, however there was one email provider that always rejected me because they were blocking all of DigitalOcean's IP space. This provider was quite niche, but it still bothered me.

My solution was to set up SMTP relaying based on the recipient domain. So nearly all my email can still be sent direct, but I have a list of domains that get routed through mailgun.com (or you could use SES or whatever).

More info here: https://github.com/docker-mailserver/docker-mailserver/issue...

Re:Deploy a Gmail-like email server in 30 (ish) minutes by WarOnPrivacy on Sunday December 26, 2021 @08:36PM (#29698124)
> there was one email provider that always rejected me because they were blocking all of DigitalOcean's IP space.

This would be me. DO traffic is overwhelmingly hostile traffic. It's like Psychz or MCColo got massively scaled up.

OVH is a close 2nd. Amazon was a solid third, beginning in 2019. Not sure if they still are.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by stevenicr on Tuesday December 28, 2021 @02:41AM (#29711439)
I've also blocked tens of thousands of ips from DO, and AWS on several web sites. Mostly for attempts at logging into wordpress admin accounts, some were spammers I'm guessing were using vpns that sometimes go through them. Those and tens of thousands from brasil, and several other countries.

There was a time when I looked at sending in reports -

and a time when I asked someone in the wp plugin directory who had a detector-like plugin to have it spit out a chunk of fields that would be ready to fill in the amazon complaint form and to do a cidr lookup to port over to iptables.. but that never got made.

This was all made worse when maxmind went registration needed and ruined the most effective security plugin for wordpress I'd been depending on for years.

I've noticed an increase in the microsoft ips I'm blocking these days to.

for now I don't mind doing an ip lookup when I can block 64,000 ips or more at a time I find it's a solid win.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by ireflect on Sunday December 26, 2021 @10:28PM (#29698804)
You work at Mega? Nice to meet you!

Is there anything I can do to get whitelisted? How can I contact you?

Not a huge deal if not, I've implemented the workaround already. But to be whitelisted after a chance meeting on HN would be a nice way to finish this story.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by hda111 on Thursday December 30, 2021 @03:44PM (#29741218)
I always wondered why there isn’t a config option in MTAs that tries to route an email over different other MTA‘s submission port and tries until delivered. I mean a automated setup not static rules you mention. This would make self hosted setups so much easier. The chance that someone blocked your cloud server‘s IP address 4 years ago and never bothered removing it is high.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by wink on Monday December 27, 2021 @07:36AM (#29701992)
My "favorite" story is a certain not to be named French university which was polite enough to inform me that they block all email from .org domains.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by speedgoose on Sunday December 26, 2021 @11:09AM (#29693545)
Your solution makes a lot of sense if sending emails through AWS is acceptable, but I'm not sure we can say it's self-hosted.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by xanaxagoras on Sunday December 26, 2021 @01:03PM (#29694704)
When you send an e-mail, as soon as it leaves your mail server it's out of your control and you have no say in where it goes before it ends up at the recipient. There's no such thing as self hosted sent e-mail.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by speedgoose on Sunday December 26, 2021 @01:33PM (#29695032)
Sending an email through AWS has strong implications regarding privacy though.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by teitoklien on Sunday December 26, 2021 @02:17PM (#29695374)
Chances are you’re already compromised eitherways , most mailservers interact with you over STARTTLS, which means any middleman/isp can strip your tls encryption on your emails, midway while you’re reading them over imap. (ISPs worldwide have been caught doing this before)

Most providers do not mandate a strong SSL only imap system.

Along with other similar caveats, do not depend on your mail system to keep your emails private.

If you want privacy, encrypt your emails yourself.

Also most people who selfhost their email usually do not encrypt data at rest. As its not the default norm. As such anyone having access to your disk can compromise you at anytime too (especially likely if you’re using a vps).

So, unless youre encrypting your emails yourself E2E. Assume you have no privacy. If you’re doing E2E, aws cannot decrypt your mails anyways.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by AshamedCaptain on Sunday December 26, 2021 @06:05PM (#29697233)
There is a large difference between "them" having to m2m smtp sessions to intercept emails versus directly sending the emails through them.

Besides, metadata is probably already more significant than the message contents and encrypyion solves nilch there.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by teitoklien on Sunday December 26, 2021 @08:05PM (#29697950)
they m2m the imap sessions using the method i described not smtp.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by BusyLurker3K on Sunday December 26, 2021 @01:48PM (#29695145)
The odds of the emails going through AWS, GCE, or Azure infrastructure in one form or another is probably pretty damn high even if you host your own SMTP service.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by speedgoose on Sunday December 26, 2021 @02:16PM (#29695358)
Yes but that's the recipient choice. I'm not responsible if they use American cloud providers for their emails, but I am for the ones I send.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by BusyLurker3K on Sunday December 26, 2021 @03:06PM (#29695817)
Sure, then you can use whatever SMTP option that is best for you. Some people are fine with using American cloud providers and some are not. If they are technical enough to host their own email server, they are more than likely to understand what choices they are making.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by speedgoose on Sunday December 26, 2021 @04:23PM (#29696515)
My main point was that sending email using AWS SES is not self hosting. Like hosting a website on S3 + CloudFront is not.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by xanaxagoras on Monday December 27, 2021 @12:37PM (#29704605)
If you run your own incoming mail, nobody but you has a copy of your entire mail archive and you are self-hosting that data. It can't be handed over to the government, it can't be sold, it can't be analyzed by gmail, etc. That's where the big win is. If you send e-mail using SES, that's one untrusted hop out in front of an unknown number of untrusted hops that you can't opt into or out of - there's little practical difference. The privacy win come from hosting your own data, not your own smtp server with a carefully curated reputation that you spend hundreds of hours a year working on.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by BusyLurker3K on Monday December 27, 2021 @12:03PM (#29704224)
That is _your_ definition of self-hosting. Do you rely on an entity for your internet connection? At some point, you _will_ need to rely on someone else's infrastructure.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by blitzar on Sunday December 26, 2021 @06:53PM (#29697534)
I believe the correct way to write it is self-hosting.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by varenc on Sunday December 26, 2021 @07:57PM (#29697901)
Do you run into any issues with your outgoing mail being marked as spam by the recipient? Particularly with GMail’s aggressive filtering?

I imagine 99% of outgoing Amazon SES traffic is transactional or marketing email for various online services. I worry this could make my personal emails look more like spam to the big providers. Or maybe it works out fine.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by kevincox on Monday December 27, 2021 @04:36PM (#29707047)
FWIW running a service who's job is to send email, I have found that GMail is one of the best providers to send to. They strongly value domain reputation and are popular enough that it was quick to build up a basic reputation. Now my messages are rarely flagged as spam even coming from a Digital Ocean IP address. I just rely on DKIM.

This is in contrast to Microsoft which seems to rely mostly on IP reputation and trying to send from a new server is incredibly difficult as they (reasonably) treat unknown Digital Ocean IPs as likely spam but (unreasonably) don't allow a good domain reputation to override that.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by bla15e on Sunday December 26, 2021 @12:13PM (#29694193)
Do you have any more details on implementing this? Sounds like something a lot of people would be interested in
Re:Deploy a Gmail-like email server in 30 (ish) minutes by teitoklien on Sunday December 26, 2021 @02:11PM (#29695322)
I have set up the same thing for myself and have been using it for several years now, so i’ll join in.

Aws ses has this offer where for a few thousand emails per month, email sending is free.

The steps are this:

1- Signup for aws ses, once you do that they’ll put you in a sandbox environment

2- After that they’ll ask you a few questions on why you need it, just tell them its because you’re a growing startup who expects to send thousands of emails per month, (make sure to say this, they don’t crosscheck later, if you dont say something along the lines of this, they usually reject your application to avoid having to serve small customers who might not scale their business later. )

3- After you’re approved, they provide you with a mail relay api key, just take that api key and attach it to your postfix or other smtpd installation

I use docker-mailserver[0] which packages everything I need for my mailserver into a small container and was good to go, it consumes minimal resources too.

For me, i just had to add the ses relay api key to the config file of my docker-mailserver install and it was all setup.

However you can do the same with any provider that gives you an option to act as your email relay, I remember both aws ses and sendgrid provide this service, but I’m sure there are more niche businesses providing this too.

[0](https://github.com/docker-mailserver/docker-mailserver)

Re:Deploy a Gmail-like email server in 30 (ish) minutes by brotherofsteel on Sunday December 26, 2021 @02:57PM (#29695751)
>2- After that they’ll ask you a few questions on why you need it, just tell them its because you’re a growing startup who expects to send thousands of emails per month, (make sure to say this, they don’t crosscheck later, if you dont say something along the lines of this, they usually reject your application to avoid having to serve small customers who might not scale their business later. )

I have the same setup as you, relaying outbound mails through SES. I told exactly how I was going to use it and was accepted promptly. Maybe I just got lucky.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by jlkuester7 on Sunday December 26, 2021 @03:56PM (#29696264)
As others have mentioned, setting up SES is straightforward (as much as anything AWS) and for the rest of my setup I just use mailu.io containers. The config for setting up the relay is here: https://mailu.io/1.8/configuration.html?highlight=relay#mail...
Re:Deploy a Gmail-like email server in 30 (ish) minutes by berkes on Sunday December 26, 2021 @10:48AM (#29693321)
...or for choosing the wrong VPS provider. Op talks about Digital Ocean. But, just like Linode or EC2, their IP blocks are inevitably on some undisclosed blocklist that livemail, yahoo, gmail randomly use.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by mattl on Sunday December 26, 2021 @11:06AM (#29693510)
Digital Ocean sends so much bad traffic in the form of bots trying to run cars numbers we’ve had their entire AS blocked for several years.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by InvaderFizz on Sunday December 26, 2021 @02:07PM (#29695292)
> bots trying to run cars numbers

I'm having trouble parsing this. Are you talking about VINs?

Re:Deploy a Gmail-like email server in 30 (ish) minutes by tylersmith on Sunday December 26, 2021 @02:18PM (#29695385)
My best guess is it was a typo for (credit/debit) card numbers.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by mattl on Sunday December 26, 2021 @02:24PM (#29695436)
Yep sorry. Autocorrect.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by filmgirlcw on Sunday December 26, 2021 @02:34PM (#29695527)
I was going to say, IP blocks for DO make it one of the last places I would use for serving mail I actually wanted to be deliverable.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by anandsuresh on Sunday December 26, 2021 @02:20PM (#29695401)
This is a bandaid that avoids solving the harder problem of trust/spam. It is such design patterns that make a fundamentally open/federated protocol more centralized, exacerbating the problem.

Personally, I think the use of proof-of-work like methods can mitigate the problem by a large extent, making it computationally expensive to spam users. This was one of the original goals of what has now become the "blockchain" revolution. Is anyone aware of any projects that are still implementing similar (open) systems?

Re:Deploy a Gmail-like email server in 30 (ish) minutes by jlkuester7 on Sunday December 26, 2021 @03:53PM (#29696234)
I am happy to be proven wrong here (not an expert) but IMHO there is not much hope or solving the open decentralised communication problem with email at all. It seems that something like Matrix.org presents much more promise in this area. I also host my own Matrix server, but sadly not everyone I need to communicate with uses Matrix....
Re:Deploy a Gmail-like email server in 30 (ish) minutes by hdjjhhvvhga on Sunday December 26, 2021 @10:19AM (#29693007)
OK I run several mail servers and I do have problems but of another kind that you describe. But this one is a bit ridiculous:

> When you need to explain to people why they can't send you that 100 MB video attachment which they sent to other people just fine but only your address is bouncing and why don't you fix your email already.

The maximum attachment size for Gmail is still conservative 25 MB and they basically dictate what is currently to be expected in terms of attachments going through.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by cmeacham98 on Sunday December 26, 2021 @10:49AM (#29693328)
https://support.google.com/a/answer/9050120

According to this page the incoming limit "depends on several factors" and can be as high as 150MB.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by hdjjhhvvhga on Sunday December 26, 2021 @11:40AM (#29693865)
OK, so I tried to test it in practice, starting from 120 MB down to 25 MB. The largest that went through had 35 MB; the larger ones bounced with:

> Remote Server returned '552-5.2.3 Your message exceeded Google's message size limits. Please visit 552-5.2.3 https://support.google.com/mail/?p=MaxSizeError to view our size 552 5.2.3 guidelines.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by TimWolla on Monday December 27, 2021 @03:16PM (#29706311)
That makes sense, because the attachment is going to be base64 encoded within the email and thus the size is inflated by 33%. This results in the size being roughly 47 MB in size.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by AshamedCaptain on Sunday December 26, 2021 @12:41PM (#29694436)
You can easily search around that the Gmail limit for personal users is 50MiB, recently enlarged from 25 MiB. As the other poster says, even between Gmail accounts I still have trouble sending files larger than 30MiB.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by layer8 on Sunday December 26, 2021 @07:34PM (#29697782)
For Apple’s iCloud mail it’s even just 20 MB.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by tuldia on Sunday December 26, 2021 @10:03AM (#29692871)
Less FUD, please, don't discourage people just because you couldn't do it :-)

EDIT:

> When someone decides to run a persistent brute force attack from a botnet, eating up 100% of your CPU and you have no meaningful ways to block it.

postscreen? http://www.postfix.org/POSTSCREEN_README.html

BTW, there is soo much FUD in your comment, check http://www.postfix.org/ before claiming "someone will hack your email"

""" First of all, thank you for your interest in the Postfix project.

What is Postfix? It is Wietse Venema's mail server that started life at IBM research as an alternative to the widely-used Sendmail program. Now at Google, Wietse continues to support Postfix.

Postfix attempts to be fast, easy to administer, and secure. """

Re:Deploy a Gmail-like email server in 30 (ish) minutes by endymi0n on Sunday December 26, 2021 @11:32AM (#29693790)
It sounds less like FUD than a change in perspective.

When I was in my twenties, I would have empathized with your point. I used to host my own web servers, but back then, my main priorities were curiosity, privacy and independence.

Not just that, I opened accounts for friends and family.

A decade later, I made all my hosting someone elses‘ problem, because I had different priorities.

There‘s nothing like the sound of a friend shouting in your ear because he trusted you with his mail address and he‘s running into weird errors. Or trying to get an important email delivered after a 10h crunch shift when you just want to bring your kids to bed instead.

I‘m thankful for all those learnings, but nowadays, I‘m old enough to just want mail to frickin work, that‘s why Google does it for me on a custom domain.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by organsnyder on Sunday December 26, 2021 @03:31PM (#29696023)
As I got further into my thirties, I became much more aware of the concept of opportunity cost: by deciding to do one thing, I'm by definition deciding to not do others. Running my own mail server is one task that has not made the cut for being more worthwhile than other priorities in my life.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by jjav on Monday December 27, 2021 @03:40AM (#29700671)
Sad to see all the negativism. To anyone considering it, just run your own email infrastructure and don't let the naysayers put you down. Email is far too critical to let any megacorporation own you on it.

I spend approximately no time at all in maintaining my email infrastructure which I set up around ~10 years ago.

Of all the things I self-host and self-manage, my email server and related parts is the one which requires the least attention and ongoing work, by far. Set up postfix, it'll take some work initially, then it'll chug along forever.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by charcircuit on Sunday December 26, 2021 @10:15AM (#29692972)
All of these don't seem that out the ordinary
Re:Deploy a Gmail-like email server in 30 (ish) minutes by tuldia on Sunday December 26, 2021 @10:18AM (#29692998)
If that was the case, we wouldn't even plug anything on the internet, ffs.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by johnklos on Sunday December 26, 2021 @11:38AM (#29693834)
Seriously?

If other email providers are blocking you, smarthost through an email provider.

If you're getting brute forced, learn how to set up and run blocklistd or fail2ban.

Not getting 100 meg attachments is an issue that other email providers have, not people who run their own servers. If your server doesn't have any free disk space, that's on you. If it does, then set confMAX_MESSAGE_SIZE to whatever you want.

If by "standard X" you're talking about SPF or DKIM, there are lots of tutorials.

If your email software is vulnerable because of issues with your distro, you're doing things wrong.

The point is if you can't, don't. If you don't want to think about issues like these, then you shouldn't be running servers, anyway, so you're definitely not the target audience.

If you can, then these things aren't issues.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by yokoprime on Sunday December 26, 2021 @11:55AM (#29694017)
I get it, if you're genuinely interested in hosting email, it's fairly easy... but those who aren't will lose interest after a couple of major setbacks and that's that. E-mail is, whether you like it or not, pretty critical, so it's not the best place for hobbyists to start.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by john2010 on Sunday December 26, 2021 @02:15PM (#29695354)
> If you're getting brute forced, learn how to set up and run blocklistd or fail2ban.

What about updating OS/packages/CVE when on holiday? Note that many CVEs are usually sent only to top-tier providers.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by cookiengineer on Sunday December 26, 2021 @02:09PM (#29695304)
> fail2ban

As a sidenote: The two RCEs this year were enough for me to judge the quality of this software.

If a whois entry of the attacker's IP/domain can RCE your intrusion blocking software, I mean...really?

Re:Deploy a Gmail-like email server in 30 (ish) minutes by TedDoesntTalk on Sunday December 26, 2021 @12:52PM (#29694564)
> If other email providers are blocking you, smarthost through an email provider.

Can someone please explain what this means?

Re:Deploy a Gmail-like email server in 30 (ish) minutes by e12e on Sunday December 26, 2021 @01:11PM (#29694796)
It means no longer hosting your own server for sending email, but rather use eg smtp.gmail.com to send outgoing mail. It would mean allowing Gmail.com to send email from your domain via SPF, thus allowing all with a Gmail account to spoof your from domain/header.

Ed: as sibling correctly notes, "smart hosting" specifically referes to setting your smtp server to relay via another (eg: Gmail) - eg exim or postfix allow setting a "smart host" so that rather than looking up the receiving smtp server, all mail is shunted to the smarthost to figure out.

Added: you might get good delivery to Gmail using Gmail smarthost (requiring you to have a Gmail account) - but you might need to use outlook.com as a smarthost to get good delivery to o365 accounts... Etc.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by easrng on Sunday December 26, 2021 @01:13PM (#29694817)
Google requires that you verify ownership of a domain before you send emails as it with Gmail.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by e12e on Sunday December 26, 2021 @01:37PM (#29695069)
Ah, indeed it does.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by DarylZero on Sunday December 26, 2021 @03:27PM (#29695987)
They also require a paid account for this now. Though, I have one grandfathered in from like 15 years ago.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by TheRealDunkirk on Monday December 27, 2021 @08:54AM (#29702524)
It means that "hosting" your own email really means hosting your inbox, and only your inbox. Because "the bigs" have basically monopolized sending email, you will tire of working through everyone blocking email from your 2-bit server. You will cave, and eventually use one of those "bigs" to do the sending half of "hosting your own email." Which means they will "see" and index all your email anyway, which WAS THE POINT most of us were TRYING TO PREVENT IN THE FIRST PLACE. I gave up about 8 years ago, and gave everything to Apple.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by xanaxagoras on Sunday December 26, 2021 @12:57PM (#29694636)
Your SMTP server uses an authenticated relay through (let's say) sendgrid that you pay for. Sendgrid delivers your mail using their reputation.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by rasengan on Sunday December 26, 2021 @11:57AM (#29694040)
That's true, but to do it securely isn't as simple as one would like to believe. Setting up "DKIM/SPF/etc." simply provides auth/verify security on send, but I'm more specifically referring to the receiver side security.

If you're really properly securing your mail server, it would likely be isolated behind a firewall and only have a LAN ip of some kind and utilize UUCP for transport to another LAN machine that does not have WAN access, and then, only allow POP3/IMAP access to machines in the LAN or connected to the LAN via VPN tunnel. Finally, you would want to setup a backup system of some kind for this machine to periodically backup via rsync when the inotify/fswatch file modification triggers.

Next, you'd have a separate SMTP machine. For things like critical deliverability, you can't rely on SMTP to 'retry' albeit it's how they are supposed to act, so it would make sense to have multiple SMTP machines across multiple different backbones in different physical locations with backup power and the like with different MX priorities set.

The initial configuration and running a mail server are incredibly easy.

It's running it securely that increases the difficulty on order of magnitude (because you essentially have to setup a proper security protocol across multiple machines (a network) - defense in depth).

That said, it's easily doable if you're already running complex infrastructure. Hopefully, you're getting paid for your time and costs for doing so.

If not, then I hope you need to rely upon the protection of needing a home-invasion warrant vs a simple-subpoena since a machine at your home can't really just be 'subpoenad' while a machine at some datacenter business can. This of course assumes you're even running the machine at home because if you're doing all this on some VM the value of doing so diminishes ever so quickly.

EDIT: Just to be clear, you can't simply rely on fail2ban and some other on-machine script / snort / daemon / kernel feature to protect you. There are bugs in software/systems and 0days are very real (as well as the market places for them).

Re:Deploy a Gmail-like email server in 30 (ish) minutes by shmoogy on Sunday December 26, 2021 @11:56AM (#29694031)
Isn't the big/only issue regarding getting into inbox? I would imagine if warming / domain warming would be ridiculously difficult in modern times.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by holri on Sunday December 26, 2021 @02:33PM (#29695520)
Well, then I must do something wrong. I run my personal email server based on Debian stable on my own SBC hardware in a colo for a couple of years now . Manual maintenance is just upgrade to the next stable Debian version every 3 years or so. I had zero of the problems you describe.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by sildur on Sunday December 26, 2021 @03:25PM (#29695968)
Yeah, me too. My life was basically set up and forget. Except for that time I upgraded my instance and the upgrade came with an unexpected and unwanted IP change. Unfortunately it seemed like the new IP has been used for spam and I had to spend some time clearing my IP status. But eventually everyone understood and my IP is clear and shiny now.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by acallaghan on Sunday December 26, 2021 @04:28PM (#29696549)
Just stick with Gmail then @avian, it’s not for everyone. I think that you might be constantly think of worst cases, where as most of the time it’ll just be fine? And even I it isn’t, then I’m learning more about the web and email. When did people stop doing something because it was challenging?
Re:Deploy a Gmail-like email server in 30 (ish) minutes by emptybottle on Sunday December 26, 2021 @10:45AM (#29693288)
These concerns are common across virtually any internet facing service.

Yes, if you choose to run a service it will need to be maintained, and occasional issues will come up.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by harikb on Sunday December 26, 2021 @11:33AM (#29693800)
No, email is an especially brutal service. I had taken this path for 10+ years.

If my custom media server or private photo site setup fails, it is not a big deal. But if I can’t login to a shopping site or my family can’t checkin to a flight because the two-factor auth email disappeared in to thin air, I am the “horrible IT person” who spoiled Christmas - end of story.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by everforward on Sunday December 26, 2021 @12:43PM (#29694469)
What makes it particularly brutal, to me, is that the failures are typically silent. If GMail starts spamboxing my emails, I don't get feedback about that. If I'm not getting emails, I don't get feedback about that.

You can script checking those, but you'll have to re-implement it for each provider. And there are some that you can't; if I'm applying for a job, they're not going to give me an email account to test whether my stuff is deliverable.

HTTP services are absurdly easy to monitor in comparison.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by micromacrofoot on Sunday December 26, 2021 @04:06PM (#29696358)
I’ve tried testing gmail and it’s very difficult to even get consistent results
Re:Deploy a Gmail-like email server in 30 (ish) minutes by denton-scratch on Sunday December 26, 2021 @02:57PM (#29695745)
In my experience, the brutality grows rapidly with the number of users. If it's just for you, and you have at least one alternative account, then it's not brutal at all.

A mailserver administrator is a sysadmin. Being a sysadmin is on the face of it unrewarding - nobody pats you on the back when everything is working normally. They only call you when there's a problem (and it's usually urgent, and sometimes critical, and they'd like to know who to blame). So if you run a mailserver with users, it starts to become a people job, and things begin to matter.

People certainly rely on email to a greater extent than other services - even mobile. I can order goods online without surrendering my mobile number, but I always have to provide an email address before I can complete the order.

But I've still enjoyed administering mailservers. Perhaps I liked the slight paranoia induced by trying to reconcile the boss's demands for functionality with his demands for security.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by yokoprime on Sunday December 26, 2021 @11:57AM (#29694037)
This 100%, e-mail is too critical and is not core to what my skills are, so I outsource it, even if I think it would be fun setting up initially.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by 1vuio0pswjnm7 on Sunday December 26, 2021 @08:52PM (#29698228)
True user-controlled e-mail, the kind without third parties, contemplated in the original e-mail RFCs, is a "two-sided equation". Both sides need to run their own SMTP.^1

1. I have tested both sides running their own SMTP on small, i.e., less than 100, peer-to-peer overlay network and it works. "OTT email". Interesting question for the reader is how does spam enter this system. If the spammer is not a peer on the network, then they cannot send mail to the other peers.

If only one sides runs their own SMTP, that only solves one side of the equation. Almost every HN discussion of user-controlled e-mail focuses only on users controlling one side, while ignoring the other and leaving it to third parties. That can still have benefits such as not storing mail with a third party, but obviously only focusing on one side, e.g., the receiving side, will fall short of true "user-controlled e-mail".

User-controlled e-mail is a solvable problem for most users, i.e., those whose contacts in a given context, e.g., personal, school, or work, are under 100. User-controlled e-mail is an unsolvable problem for people who want to send e-mail to 100s of people, e.g., people they do not know, or people who want to recieve e-mail from any random person/organisation, treating their address like a phone number on a bathroom wall. Maybe, for most users, that is actually a good thing. (Given the attitudes toward "spam", it appears most users generally do not appreciate unsolicited mail.) There could be separate systems for unsolicited mail. We already have such systems in place.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by dukeofdoom on Sunday December 26, 2021 @10:04AM (#29692878)
I the webmail client experience better?

I was thinking of stopping to use gmail and hotmail, and run my own webmail client on a droplet. I don't like the idea of all my documents being tracked. Is there anything that competes with them that I could deploy.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by dqv on Sunday December 26, 2021 @10:46AM (#29693301)
Not really. Gmail is still one of the best webmail experiences IMO, so you have to prefer clients like Thunderbird if you want to go the self-hosted route. Some people really like RoundCube, but I only use it when it’s absolutely necessary. I did get some novelty out of using Squirrelmail as a teenager.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by denton-scratch on Sunday December 26, 2021 @03:05PM (#29695815)
Roundcube has a built-in editor for Sieve scripts.

Sieve is pretty cool; it runs user-defined scripts server-side, on delivery to addressee's mailbox. The scripts are in the Sieve language, which is just for mail filtering. But it's a bit abstruse - it may be rudimentary, but most users don't want to tangle with a language at all.

Anyhow, the Roundcube UI includes natively a Sieve script editor made up of drop-downs, which makes it much clearer what filter-steps you're asking for. I'm rather minimalist; I prefeer Squirrelmail, if I have to use webmail. But this feature of Roundcube is really good.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by dqv on Sunday December 26, 2021 @11:21PM (#29699161)
Interesting. I did not know it was (mail) server side! I assumed that, like many PHP applications, those filters were just ran using a cron job that calls a PHP script periodically.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by denton-scratch on Monday December 27, 2021 @06:26PM (#29708247)
It runs server-side, on the delivery server. And the scripts are stored on the delivery server too.

This means that you don't have to synchronize your filters between mobile client A, laptop client B, webmail client C. Thy're all on the delivery server (which is usually the same as your IMAP server). The filtering happens before you log in to email, and before your client knows there is an email.

Sieve is a specification, not a product (and not some specific PHP script). It's part of the Dovecot package in the Debian distro. It's client-server, only because there is a protocol for a client to upload/update scripts. So there's a wire protocol for management. But it has nothing to do with retrieving mail. Sieve on the server only affects what happens on delivery.

I think Sieve is totally the sanest way to do per-user mail fitering.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by tuldia on Sunday December 26, 2021 @10:54AM (#29693386)
Try https://www.rainloop.net/ it remembers the previous Gmail webmail interface. Pretty nice IMO.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by zigzag312 on Sunday December 26, 2021 @03:04PM (#29695810)
Unfortunate side effect of avoiding self-hosted email is that email is becoming centralized service.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by micromacrofoot on Sunday December 26, 2021 @04:01PM (#29696311)
if you’ve ever tried running your own email service you’d realize it might as well be already
Re:Deploy a Gmail-like email server in 30 (ish) minutes by jjav on Monday December 27, 2021 @03:29AM (#29700605)
> It's not the initial setup. It's the maintenance over the years that really makes you question the universe,

Initial setup of my mail server and related bits took a few days. Ongoing maintenance over the years? None, basically.

Re:Deploy a Gmail-like email server in 30 (ish) minutes by mgarfias on Sunday December 26, 2021 @02:54PM (#29695717)
100% this. I did it for years. I think I’d rather stab myself than do it again.
Re:Deploy a Gmail-like email server in 30 (ish) minutes by txdv on Sunday December 26, 2021 @09:50AM (#29692758)
i get sweaty hands from reading this