AWS SES - 在 S3 中存储发送到“testing@my-domain.com”的电子邮件,在 iCloud 中接收发送到“me@my-domain.com”的其他电子邮件?
简短说明
我试图弄清楚如何使用AWS SES接收电子邮件并将其存储在S3存储桶中,但仅用于域的特定电子邮件地址。我想通过电子邮件提供商iCloud(或任何其他提供商)处理的其余电子邮件。
为什么
我正在研究CDK构造,为了测试此构造,我需要接收到特定电子邮件地址的电子邮件([email  procectioned]我还需要阅读此电子邮件的内容才能完成测试,但是我拥有的域已经设置为接收到该域内其他电子邮件地址的电子邮件(
[email  procectioned] protection“ class =” __ cf_email__“ data-cfemail =” ea878faa8793c78e85878b8384b8384c8384c4898587> [email  procected]
例如)。目前,该域通过Namecheap(任意DNS注册商)进行注册,并通过ICLOUD设置电子邮件客户端。
问题
我发现的问题是,要接收来自AWS SES的电子邮件,我需要在Namecheap上配置MX记录,以指向AWS SES。如果我这样做,那么我将不再能够从我域上的任何其他电子邮件地址中收到电子邮件cfemail =“ 197A76776D787A6D597460347D767478770777777674”> [email  protiveed] [email  prected] iCloud(或任何其他电子邮件提供商)上的,因为电子邮件只能根据最高优先级MX记录转到一台服务器。
本质
if email_address == '[email protected]' then
save_to_s3_bucket()
else
default_send_to_icloud()
上
-
我能做的一件事是在iCloud中应用一条规则,该规则将从
[email  protected]
电子邮件,请访问任何其他地址。这将起作用的唯一方法是,如果我购买了第二个域并将电子邮件转发到该域上的地址。在这里,我可以在没有冲突的情况下设置MX记录,因为此域仅用于此目的,并保存到S3桶中。我不喜欢这种方法,因为现在我必须购买每年12美元的重复费用,以收到电子邮件进行测试的单一目的。这似乎是我问题的过度解决方案。
将电子邮件发送到S3存储端端点
这是一个虚构的解决方案(据我所知),但想证明我已经调查了这条路线。这个想法是,如果AWS S3提供了一项服务,他们控制了任何人都可以将电子邮件发送给的域,然后您可以配置S3存储桶以接受来自某些Regex域字符串的电子邮件,并允许将其保存到您的存储桶中文件。 (我没有充实整个过程是什么,而只是给出粗略的概念)
这不起作用,因为这不是S3的电流产品(但如果他们添加它会很酷)。
向iCloud 前进 最后一个选项感觉就像是配置的噩梦,但是想法是配置AWS SES通过将域的MX记录设置为指向所有电子邮件,以接收所有电子邮件。然后,我们可以应用基于规则的过滤器来转发我们未保存到s3上的电子邮件。
这种方法有很多问号,例如电子邮件似乎是从SES发送的吗?我将如何通过iCloud响应电子邮件?需要从SES调查延迟,删除电子邮件等。
我真的不想这样做,因为感觉就像是一场配置的噩梦。我还没有这样做,所以请让我知道它是否比我想象的要简单。
这些是我迄今为止发现的唯一解决方案,还有其他解决方案吗?我发现很难相信我是唯一遇到过这样一个问题的人,但是谷歌搜索这样的解决方案非常困难。
Short Description
I am trying to figure out how to use AWS SES to receive email and store this in an S3 bucket, but only for a specific email address of a domain. The rest of the emails I would like to be handled by my email provider iCloud (or any other provider).
Why
I am working on a CDK Construct, and in order to test this construct I need to receive an email to a specific email address ([email protected]
for example). I also need to read the contents of this email in order to complete the testing, however the domain I own is already setup to receive emails to other email addresses within that domain ([email protected]
, and [email protected]
for example). Currently, this domain is registered through NameCheap (arbitrary DNS registrar) and the email client is setup through iCloud.
The Problem
The issue I am finding is that in order to receive email from AWS SES, I need to configure MX records for my domain on NameCheap to point to AWS SES. If I do this then I will no longer be able to receive emails from any other email addresses on my domain such as [email protected]
or [email protected]
on iCloud (or any other email provider) as emails can only go to one server based upon the highest priority MX record.
In essence a pseudocode example of the logic I would like to have:
if email_address == '[email protected]' then
save_to_s3_bucket()
else
default_send_to_icloud()
Investigated Solutions
Purchase second domain
One thing I could do, is apply a rule in iCloud that would forward all emails from the
[email protected]
email to go to any other address. The only way this would work is if I purchased a second domain and forwarded emails to an address on this domain. Here I could setup the MX records with no conflict as this domain would be used only for this purpose, and save to S3 bucket.I don't like this approach because now I have to purchase a recurring fee of $12/year for a singular purpose of receiving an email for a test. This seems like an overkill solution for my problem.
Send email to S3 Bucket Endpoint
This is an imaginary solution (to the best of my knowledge), but wanted to show I have investigated this route. The idea would be if AWS S3 offered a service where they controlled a domain that anyone could send an email to, and then you could configure your S3 bucket to accept emails from some REGEX domain string and allow these to be saved to your bucket as a file. (I haven't fleshed out what the whole process is, but just giving rough concept)
This does not work as this is not a current offering from S3 (but would be pretty cool if they added it).
Forward to iCloud
The last option feels like a configuration nightmare, but the idea would be to configure AWS SES to receive all emails by setting the MX records of the domain to point there. Then we could apply rule-based filter to forward the emails that we aren't saving to S3 on to the iCloud server.This approach has quite a few question marks, such as would the email appear to be sent from SES? How would I respond via iCloud to emails? Would need to investigate latency, dropped emails, etc. from SES.
I really don't want to do this as it feels like a nightmare of configuration. I have not done this though so please let me know if it is simpler than I might imagine.
These are the only solutions I have found thus far, are there any other solutions? I find it hard to believe I am the only person who has come across an issue like this, but googling for a solution like this is extremely difficult.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番搜索后,我找到了使用原始域的子域的解决方案。如果我这样做,那么我可以维护根域的原始 MX 记录并接收发送到我的 iCloud(或任何其他提供商)的电子邮件。接下来,我可以将 MX 记录添加到子域,所有电子邮件现在都将定向到 AWS SES。
这样做的好处是子域在大多数(所有?)DNS 注册商中都是免费的。
AWS SES MX 配置文档
立即 来自
[电子邮件受保护]
,[电子邮件受保护]
等将转到iCloud。所有发送至[电子邮件受保护]
,[电子邮件受保护]
等将转到AWS。After some searching I found a solution by using a subdomain of my original domain. If I do this, then I can maintain the original MX records of my root domain and receive emails to my iCloud (or any other provider). Next I can add MX records to a subdomain, all emails will now be directed to AWS SES.
The benefit of doing it this way is that subdomains are free in most (all?) DNS registrars.
AWS SES MX Configuration Docs
Now all emails from
[email protected]
,[email protected]
, etc will go to iCloud. All emails to[email protected]
,[email protected]
, etc will go to AWS.