AWS SES S3处理入站电子邮件 [英] AWS SES S3 process inbound email
问题描述
我正在研究基于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)格式。
每当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屋!