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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A serverless email server on AWS using S3 and SES

422 点作者 mzehrer超过 5 年前

19 条评论

arno1超过 5 年前
&gt; This stack was created out of frustration due to the fact that to this day there&#x27;s no easy way to have a full email server without the overhead of installing and configuring all servers needed to handle incoming and outgoing messages.<p>Interesting approach, though I solved this frustration by the use of a Docker and kept &quot;my data is mine&quot; + &quot;no vendor lock-in&quot; + &quot;I control all the gears&quot; approach. (Though, it&#x27;s not perfect since VPS is ran by &quot;someone&quot; else.. but that place where you run this stack can be easily changed at your convenience). Simple docker-compose.yml with 3 images and voila.<p>This AWS S3 SES setup looks far more complex than what I did using only 3 docker images: the postfix (for smtp), dovecot (for imap), opendkim (for email sigining &amp; verification). It&#x27;s really easy to fire-up a VPS with a single click nowadays.<p>If someone is interested in the images I am using:<p>- <a href="https:&#x2F;&#x2F;git.nixaid.com&#x2F;arno&#x2F;postfix" rel="nofollow">https:&#x2F;&#x2F;git.nixaid.com&#x2F;arno&#x2F;postfix</a><p>- <a href="https:&#x2F;&#x2F;git.nixaid.com&#x2F;arno&#x2F;dovecot" rel="nofollow">https:&#x2F;&#x2F;git.nixaid.com&#x2F;arno&#x2F;dovecot</a><p>- <a href="https:&#x2F;&#x2F;git.nixaid.com&#x2F;arno&#x2F;opendkim" rel="nofollow">https:&#x2F;&#x2F;git.nixaid.com&#x2F;arno&#x2F;opendkim</a><p>Then you just feed the images with the right configs (main.cf, master.cf, .., dovecot.conf, opendkim.conf).<p>It&#x27;s also possible to template the configs and make the variable-based configs. Make things scale friendly. I am also using Terraform to automate the server deployment&#x2F;DNS record updates so it is easy to get from 0 to 100.<p>The only drawback is that you are the one to maintain the OS&#x2F;SW upgrades, security, etc.. but that&#x27;s something I really want to do by myself instead of relying on someone else :-)
评论 #21955392 未加载
评论 #21955707 未加载
评论 #21954460 未加载
评论 #21954486 未加载
评论 #21995468 未加载
评论 #21960071 未加载
评论 #21957613 未加载
评论 #21955197 未加载
评论 #21955976 未加载
评论 #21954551 未加载
giu超过 5 年前
Just a friendly reminder, since I&#x27;ve worked with SES in the past: Don&#x27;t forget about bounces when using SES [0].<p>From [0]:<p>&gt; If your bounce rate is 5% or greater, we&#x27;ll place your account under review.<p>To sum it up, try to keep track of bounced e-mails by using the SES notifications [1].<p>[0] <a href="https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;ses&#x2F;latest&#x2F;DeveloperGuide&#x2F;e-faq.html#e-faq-bn" rel="nofollow">https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;ses&#x2F;latest&#x2F;DeveloperGuide&#x2F;e-faq....</a><p>[1] <a href="https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;ses&#x2F;latest&#x2F;DeveloperGuide&#x2F;monitor-sending-using-notifications.html" rel="nofollow">https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;ses&#x2F;latest&#x2F;DeveloperGuide&#x2F;monito...</a>
评论 #21955762 未加载
abjKT26nO8超过 5 年前
I don&#x27;t know anything about serverless --- to this day I fail to understand what this word is even supposed to mean. And the deployment diagram[1] sure looks complicated to me. I think I prefer old-school servers.<p>[1]: &lt;<a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;0x4447&#x2F;0x4447-product-s3-email&#x2F;assets&#x2F;diagram.png&gt;" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;0x4447&#x2F;0x4447-product-s3-e...</a>
评论 #21954404 未加载
评论 #21954634 未加载
评论 #21954778 未加载
评论 #21954387 未加载
评论 #21954730 未加载
评论 #21954394 未加载
评论 #21954728 未加载
评论 #21957757 未加载
评论 #21954578 未加载
评论 #21954499 未加载
评论 #21955426 未加载
评论 #21954532 未加载
评论 #21954629 未加载
评论 #21954575 未加载
评论 #21956830 未加载
评论 #21958732 未加载
评论 #21954914 未加载
评论 #21954983 未加载
评论 #21954377 未加载
评论 #21954526 未加载
primitivesuave超过 5 年前
Thanks for putting this together and documenting it so well. I’ve had to build this solution twice now, and far less elegantly.<p>The S3 PUT charges caught me off guard the first time (receiving lots of marketing&#x2F;spam email will cost $1&#x2F;1000 emails). I ended up putting small emails up to 400 kB in dynamoDB and only using S3 for large emails and attachments, which could be a means of cost reduction in this solution as well.
评论 #21954453 未加载
Cyph0n超过 5 年前
I’ve been working on a small side project that involves processing incoming email. In particular, it’s an app that needs to do something for each email it receives from (hopefully paying!) users.<p>I am not interested in storing user mail, so SES is just too costly, at least according to a quick worst-case calculation.<p>That leaves me with two options:<p>1. Self-hosted Postfix<p>2. Mail service like Mailgun<p>With (1), there is no need to worry about overages, but scaling the mail server might be challenging.<p>The advantage of (2) over SES is that you are only charged a flat fee for each email, regardless of size. Emails are then automatically deleted after some period of time. Scaling up and down is easy.<p>For now, I am using Mailgun, but I am writing the mail processing daemon in a way that will make it easy to transition to Postfix, if needed.<p>Also, I decided to write the mail processing backend in Rust, so I’ve been learning the language as I go!
评论 #21955852 未加载
评论 #21956062 未加载
评论 #21955828 未加载
评论 #21955723 未加载
coding123超过 5 年前
Seems like a crazy amount of architecture. Does AWS keep all this stuff organized in some way, or will my personal experiments in Lamba accidentally break this because it&#x27;s all merged together?<p>Say I&#x27;ve installed this.<p>I now want to write my own lamba service to handle contact form POSTs or something. Then I decide to delete it, but I accidentally delete one of these crazy email things. What happens?
评论 #21956696 未加载
theqult超过 5 年前
&gt;his day there&#x27;s no easy way to have a full email server without the overhead of installing and configuring all servers needed to handle incoming and outgoing messages.<p><a href="https:&#x2F;&#x2F;mailinabox.email&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mailinabox.email&#x2F;</a>
anonu超过 5 年前
Now someone just needs to create a serverless (aka client side or browser only) Gmail like interface you can host on S3.<p>And the shackles will be broken...
评论 #21954701 未加载
评论 #21954852 未加载
insomniacity超过 5 年前
I&#x27;m missing something - how are people reading this in an email client if it doesn&#x27;t have IMAP support?
评论 #21954989 未加载
评论 #21956061 未加载
评论 #21956734 未加载
bsder超过 5 年前
Please don&#x27;t use &#x27;+&#x27; for special purposes in email addresses without making it changeable (I recommend &#x27;_&#x27; instead).<p>Yes, it is &quot;nominally&quot; accepted--in reality there are too many website that &quot;validate&quot; email addresses and barf on &#x27;+&#x27;.
newman8r超过 5 年前
If you only need to read the emails from S3, take a look at this project <a href="https:&#x2F;&#x2F;github.com&#x2F;mewa&#x2F;s3abird" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mewa&#x2F;s3abird</a>
lowdose超过 5 年前
Yes this is legit! Got it to work on a throwaway domain under 30 minutes.
whatsmyusername超过 5 年前
You can get receive at any address on a domain forwarded to whatever email you want if you&#x27;re registered with Monicker.<p>I imagine most other registrars offer the same thing.
glandium超过 5 年前
Note that SES only retries delivery for a fixed 840 minutes (not configurable), which is an annoyingly too short amount of time.
Boulth超过 5 年前
Wow, this is cool! JSON structures resemble JMAP. I wonder what&#x27;d be the effort to add JMAP endpoint to this?
评论 #21954713 未加载
评论 #21954679 未加载
coder1977超过 5 年前
How does this compare to setting up something like sendy (sendy.co) on lightsail and connecting to SES?
raoulbhatia超过 5 年前
... and I thought about a similar thing (Email server using Lambdas) just yesterday ... ^^
z3t4超过 5 年前
What about email signing?
评论 #21954856 未加载
eivindga超过 5 年前
Cool project! I&#x27;ll make sure to test it someday.<p>Thanks for sharing!