AWS SES S3 处理入站电子邮件 [英] AWS SES S3 process inbound email

查看:35
本文介绍了AWS SES S3 处理入站电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发基于 AWS SES 的电子邮件发布系统.对于所有传入的电子邮件,我已将路由设置为将消息保存在 S3 存储桶中,以便我可以异步处理它们.我遇到的问题是消息以原始格式保存在 S3 存储桶中:标题、电子邮件正文等 + 加密附件(一个巨大的字符串) - 全部在一个文件中.

I'm working on a publish by email system based on AWS SES. For all incoming emails I've set routing to save messages in an S3 bucket so I can asynchronously process them. The problem I have is that the messages are saved in the S3 bucket in a raw format: headers, email body, etc + the encrypted attachment (a huge string) - all in a single file.

有没有办法在 AWS SES 级别将电子邮件与附件分开,并将两者保存在单独的文件中?我正在尝试以我需要的格式直接从 AWS 获取数据,并避免在流程中添加另一个处理步骤.

Is there a way to break the email message apart form the attachment and save both in separate files at AWS SES level? I'm trying to get the data in the format I need straight from AWS and avoid adding another processing step to the process.

如果 AWS SES 不提供这样的功能,那么处理这些消息以获得上述结果的正确方法是什么?

If AWS SES doesn't provide such a feature, what would be the proper way to process these messages to obtain the result described above?

推荐答案

让 SES 自动为您拆分电子邮件似乎不太可能.根据此处的文档:

It doesn't look possible to have SES automatically split up the email for you. As per the documentation here:

Amazon SES 为您提供未经修改的原始电子邮件,这通常是多用途 Internet 邮件扩展 (MIME) 格式.

Amazon SES provides you the raw, unmodified email, which is typically in Multipurpose Internet Mail Extensions (MIME) format.

每当 SES 将新电子邮件文件放入 S3 时,我都会使用 S3 或 SNS 来触发 Lambda 函数.Lambda 函数可以按照您的意愿拆分文件,然后将这些新文件写入另一个 S3 存储桶.

I would use S3 or SNS to trigger a Lambda function whenever SES puts a new email file to S3. The Lambda function could split the file however you wish, then write those new files to another S3 bucket.

这篇关于AWS SES S3 处理入站电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆