TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Deploy a Gmail-like email server in 30 (ish) minutes

192 点作者 acallaghan超过 3 年前

28 条评论

avian超过 3 年前
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.
评论 #29692620 未加载
评论 #29693007 未加载
评论 #29692871 未加载
评论 #29693834 未加载
评论 #29695520 未加载
评论 #29696549 未加载
评论 #29693288 未加载
评论 #29698228 未加载
评论 #29692878 未加载
评论 #29695810 未加载
评论 #29700605 未加载
评论 #29695717 未加载
评论 #29692758 未加载
15characterslon超过 3 年前
&gt; It was easier than I thought to create a mail server that works as well as Gmail’s<p>No it isn&#x27;t and no you didn&#x27;t.<p>The article doesn&#x27;t even cover basic stuff like email rules and spam filtering (incl. tuning and spam learning). It doesn&#x27;t &quot;look after itself&quot; like the author wanted (article doesn&#x27;t mention any update strategy). The author acknowledges that email servers are &quot;open to attack&quot; but this setup doesn&#x27;t seem to include any security improvements over traditional setups. In fact, maintaining this looks harder due to the amount of custom scripts and lack of good documentation.<p>And of course it doesn&#x27;t cover any of the things that actually make Gmail special like labels, having a consistent set of apps for web and mobile, push notifications (esp. on iOS), really good spam filtering, really good search (incl. OCR for attachments), high availability, image proxying, smart suggestions, datacenter security, Google doing code and infrastructure audits all the time, using reproducible builds, ...<p>It&#x27;s great that the author is experimenting and learning, but if I had any private data hosted by the author, I would be worried now.
评论 #29694412 未加载
评论 #29696905 未加载
评论 #29694117 未加载
评论 #29700712 未加载
评论 #29693056 未加载
tuldia超过 3 年前
The nicest email stack is: postfix, dovecot, rspamd and rainloop.<p>EDIT: go check it out :-) <a href="https:&#x2F;&#x2F;www.rainloop.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.rainloop.net&#x2F;</a><p>EDIT 2: I don&#x27;t understand why other comments are so agressive against the author for sharing how he runs his own mail server, I&#x27;m not sure if it comes from one&#x27;s frustration, failures, unreasonable expectations about email, but I noticed that everything related to servers or email receives this hate (here on HN, eh?). Come on, let&#x27;s start a new year where we appreciate someone sharing their experience in running a mail server :-)<p>Happy Holidays!
评论 #29693154 未加载
评论 #29694363 未加载
评论 #29692876 未加载
siraben超过 3 年前
I recently got into running my own mail server on my NixOS instance using[0]. The server has a total of 1.5 GB RAM and 10 GB of disk space, but it was sufficient to get 10&#x2F;10 on mail tester[1]. Here&#x27;s my 12 line mailserver config[2]. It was quite liberating once everything was set up, because then you know you are in full control of your communications.<p>It was more annoying to set up DNS than the mailserver itself, is there a good way to automate that as well?<p>[0] <a href="https:&#x2F;&#x2F;gitlab.com&#x2F;simple-nixos-mailserver&#x2F;nixos-mailserver" rel="nofollow">https:&#x2F;&#x2F;gitlab.com&#x2F;simple-nixos-mailserver&#x2F;nixos-mailserver</a><p>[1] <a href="https:&#x2F;&#x2F;www.mail-tester.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.mail-tester.com&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;siraben&#x2F;dotfiles&#x2F;blob&#x2F;master&#x2F;server&#x2F;mailserver.nix" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;siraben&#x2F;dotfiles&#x2F;blob&#x2F;master&#x2F;server&#x2F;mails...</a>
评论 #29693348 未加载
评论 #29693469 未加载
geoah超过 3 年前
&gt; The blog article is the setup to make Docker Mailserver act like a Gmail server.<p>I&#x27;m not sure what a Gmail server is. I was expecting this to include a web ui, admin ui, and the things that actually make Gmail hard to move away from. The docker-mailserver container doesn&#x27;t seem to include something like that or am I just not seeing it?<p>The killer feature for Gmail has always been the spam protection and the fact that the emails I sent actually get delivered.
评论 #29695178 未加载
johnklos超过 3 年前
This is nice, but even though I&#x27;ve administered email servers for a quarter of a century, I haven&#x27;t got the foggiest clue what makes an email server &quot;Gmail-like&quot;. What does &quot;Gmail server&quot; mean?<p>I would think, if anything, that what Gmail has that typical email servers do not is somewhat decent webmail, but that can&#x27;t be it because webmail isn&#x27;t even mentioned.<p>Or is this another one of those instances where people use &quot;Linux&quot; to refer to all things Unix? I genuinely would like to know.
评论 #29694812 未加载
评论 #29696453 未加载
lazyweb超过 3 年前
In my experience [1] running a small private mail server is very much doable, and a good learning experience.<p>[1] <a href="https:&#x2F;&#x2F;jschumacher.info&#x2F;2021&#x2F;05&#x2F;running-a-private-mail-server-for-six-years-easy-peasy&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jschumacher.info&#x2F;2021&#x2F;05&#x2F;running-a-private-mail-serv...</a>
focom超过 3 年前
I think those projects:<p>- <a href="https:&#x2F;&#x2F;mailinabox.email&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mailinabox.email&#x2F;</a><p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;modoboa&#x2F;modoboa" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;modoboa&#x2F;modoboa</a><p>are better replacement. They are battery included with a webUI
评论 #29693392 未加载
ireflect超过 3 年前
So many negative comments, sheesh.<p>Many of us run our own small email servers quite successfully, even in 2021. Every time there&#x27;s a post about it on HN, all these commenters come forward to say it&#x27;s a fools errand, that it&#x27;s nearly impossible, nobody should try it, anybody who says it&#x27;s a good idea is a lying idiot, etc.<p>Sure, it&#x27;s not for everyone and there are pitfalls that require effort and sometimes creative solutions to overcome. We should celebrate these projects like we do with other similarly challenging projects that get posted.
jeroenhd超过 3 年前
You can&#x27;t replicate Gmail, but with Mailcow I&#x27;ve gotta say the whole process is pretty seamless. You can throw it onto a 5 euro VPS at Contabo, run docker-compose up and be done. Just regularly run the update and backup scripts to make sure you&#x27;re up to date but that&#x27;s it, really.<p>Exchange ActiveSync, multi domain + multi aliases with catchalls, (temporary) aliases, mail delivery rules, TLS requirements, you name it, all configurable in the web UI. There&#x27;s even a built in DNS checking tool to verify that all the necessary records are set up right.
评论 #29696984 未加载
评论 #29694138 未加载
评论 #29694452 未加载
twobitshifter超过 3 年前
If you just want your own address, iCloud+ now supports custom domains. You might already be subscribed to it and not know it. This also includes private relay and email hiding. It might be the easiest way to move your email out of gmail.<p><a href="https:&#x2F;&#x2F;support.apple.com&#x2F;guide&#x2F;icloud&#x2F;add-a-custom-domain-mma473945269&#x2F;icloud" rel="nofollow">https:&#x2F;&#x2F;support.apple.com&#x2F;guide&#x2F;icloud&#x2F;add-a-custom-domain-m...</a>
评论 #29693932 未加载
评论 #29693484 未加载
bsd44超过 3 年前
I had to manage email infrastructure for years as part of my job and I really don&#x27;t see how running your own email server can be a good idea for anyone. Setting it up superficially might be a quick and easy task but maintaining it stable takes hell of a lot of effort. I seriously cringe every time I see this type of guide and articles, it just makes me think that people who write them have zero experience running a mail server and have no idea what it takes to set up one that is secure and stable.<p>For majority of people best middle ground is to buy a cheap domain and a cheap cPanel&#x2F;web hosting and just use that to host emails. You&#x27;ll be done in 5min, it will cost you a cup of coffee and you won&#x27;t have the headache maintaining anything other than passwords.
评论 #29694294 未加载
评论 #29700764 未加载
eoo超过 3 年前
AFAIK Digital Ocean blocks outbound connections to port 25. Has the author actually tried this setup?<p>Source: <a href="https:&#x2F;&#x2F;docs.digitalocean.com&#x2F;support&#x2F;why-is-smtp-blocked&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.digitalocean.com&#x2F;support&#x2F;why-is-smtp-blocked&#x2F;</a>
评论 #29695779 未加载
评论 #29694473 未加载
评论 #29698016 未加载
throwaway984393超过 3 年前
You know, it&#x27;s possible to build a house by yourself in about a day or two with no knowledge of carpentry. But I wouldn&#x27;t want to live in it :)
istillwritecode超过 3 年前
incoming email is easy. Outgoing email is a whole different ball game. I tried setting up an SMTP server on digital ocean and found it to be impossible due to the fact that all Digital Ocean IP ranges are on various blacklists. I moved the server to AWS and was able to eventually get a running SMTP server, but it requires additional steps to gain the trust of AWS and outlook.com and other providers. It SHOULD be possible to set up an email server if you never never never never never send marketing email. If you DO send marketing email, then your stuff should be sent straight to the garbage bin and you should be on a blacklist. That&#x27;s the whole point of spam.
pigbearpig超过 3 年前
I&#x27;ll be interested in the one month update post.
remram超过 3 年前
What&#x27;s a good way to monitor a self-hosted mail server? I can easily set up uptimerobot.com or similar and get alerted if my website fails, whether it&#x27;s a DNS, IP, firewall, nginx, TLS^, application, or database issue. Is there a way to check my mail server and get alerted if it is not accepting emails for some reason?<p>^: uptimerobot.com specifically doesn&#x27;t warn you if your site works but is using an expired certificate, be careful there
评论 #29695196 未加载
systemsincode超过 3 年前
Good article - seems comparing with Gmail upset some peeps but well done for having a go and trying to not just using off the shelf saas for every little things. Progress should have made it easier to host stuff ourselves not harder right?
评论 #29696339 未加载
maltris超过 3 年前
For docker and mail, also check out &quot;mailcow dockerized&quot;. Lovely stack of software, been using it for 5 years with no problems.
imwillofficial超过 3 年前
This absolutely nothing like gmail. The great parts of gmail can’t be replicated at home anymore, unfortunately.
评论 #29693815 未加载
mysterydip超过 3 年前
Let&#x27;s say I&#x27;m tired of self-hosting my email (for all the reasons previously mentioned by others). What&#x27;s a good option of privacy-conscious provider I can move my domains to?
评论 #29696000 未加载
Tepix超过 3 年前
Now you have your own mail server. Great! But if you don&#x27;t know how it works or if you don&#x27;t have something that will help you maintain it, sooner or later it will break.
评论 #29696511 未加载
boplicity超过 3 年前
You can deploy an email server almost instantly by getting a cheap vps with cPanel on it -- with everything you needed already configured, including spam filtering, security, etc.
salzig超过 3 年前
Uhm, what about MailCow[0]? found it quite a while ago. Didn’t test it so far.<p>[0]: <a href="https:&#x2F;&#x2F;mailcow.email&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mailcow.email&#x2F;</a>
oliwarner超过 3 年前
It opens with some fair points why somebody might not, but the main reason —perhaps on par with the constant security headaches— isn&#x27;t there. You will <i>never</i> block spam as effectively as Google, Microsoft, FastMail, etc.<p>They see [for lack of a better word] infinite times more spam and ham than you&#x27;ll ever be able to train your little Spam Assassin database, and millions of users to sort through it.<p>Email without spam control is not a pleasant experience.
评论 #29696493 未加载
评论 #29700773 未加载
ohiovr超过 3 年前
Mail servers are all pretty much blacklisted by IP unless you work some kind of deal with someone somewhere.
评论 #29695573 未加载
danlugo92超过 3 年前
Zoho has a 1 dollar a year plan for using with your own domain.
评论 #29697286 未加载
tuananh超过 3 年前
define gmail-like :)