gpt4 book ai didi

email - Amazon SES 是否支持接收电子邮件附件

转载 作者:行者123 更新时间:2023-12-03 00:33:37 27 4
gpt4 key购买 nike

看来 Amazon SES 已开始支持接收电子邮件: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-consider-use-case.html

可以将收到的电子邮件配置为保存到 S3。是否也支持在收到的电子邮件中接收附件?有关如何将附件保存到 S3 以及如何检索附件的信息吗?

最佳答案

是的,通过创建接收规则并定义将消息保存到 S3 的操作,您可以从规则中指定的存储桶中检索电子邮件及其附件作为 S3 对象。

例如,如果您为收件人 s3@sms.example.com 指定规则,并分配一个 S3 操作以写入前缀下的 S3 存储桶调用 sms-example.com,则消息将传送到该存储桶该收件人。

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-consider-use-case.html 中所述:

Amazon SES delivers you the raw, unmodified email, which is typicallyin Multipurpose Internet Mail Extensions (MIME) format. For moreinformation about MIME format, see RFC 2045.

这意味着附件将以 MIME 格式进行编码,如 Multipart Message

由于电子邮件是作为原始 MIME 电子邮件发送的,因此您需要解析该文件并提取附件。以下是带有附件的电子邮件的示例:

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=frontier

This is a message with multiple parts in MIME format.
--frontier
Content-Type: text/plain

This is the body of the message.
--frontier
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64

PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg
Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==
--frontier--

您可以在 Content-Type: application/octet-stream 开头看到附件。附件以 Base64 编码。

参见RFC 2045 Multipurpose Internet Mail Extensions

<小时/>

这是发送到 S3 的完整消息,包括名为“example.jpg”的 JPG 附件。它已交付到以下 S3 位置:https://s3.amazonaws.com/sms-example.com/messages/jldcn43gv5tt9qvhuia34ihodm6erpmqe3l7ghg1 。对象名称取自邮件提供的 SMTP ID。

Return-Path: <user@example.com>
Received: from mx6.example.com (mx6.example.com [255.255.245.6])
by inbound-smtp.us-east-1.amazonaws.com with SMTP id jldcn43gv5tt9qvhuia34ihodm6erpmqe3l7ghg1
for s3@sms.example.com;
Thu, 27 Jul 2017 16:53:34 +0000 (UTC)
X-SES-Spam-Verdict: PASS
X-SES-Virus-Verdict: PASS
Received-SPF: softfail (spfCheck: transitioning domain of example.com does not designate 255.255.245.6 as permitted sender) client-ip=255.255.245.6; envelope-from=user@example.com; helo=mx6.example.com;
Authentication-Results: amazonses.com;
spf=softfail (spfCheck: transitioning domain of example.com does not designate 255.255.245.6 as permitted sender) client-ip=255.255.245.6; envelope-from=user@example.com; helo=mx6.example.com;
X-SES-RECEIPT: AEFBQUFBQUFBQUFHbmZUa1QwOTA4N1dQc2ZiRGFQMTFMdzBNdzNkWG1uMEFEaGpIeEo4eHRuWUIrZUp3ZzJwK1RhZE1sWDhGY0RGWUg3Q2Q2U25Eb3BjNVVtTnhNQjVaWWhUN3c1NU4yWDRHMUxrNFlaRTRzcFU4aE5MbDZWUnBuVEdXN1VsNExBa2hrUHBMQnlPN1hDdzZnZXB1ek53MkwvZkVUcHpiZ3hJK2hESmNNUm5sNGxPazNMYnQrSG11UjY0djFxZ2VBalF6QlhZRnlWdWdQamcwTzlNN2xHZEticG5oZUQ1ZFVoTC9WWUtiZjY5amhkMTlRd1BWbUkyMnpIbmJUb0xpMzhVTlBMSzBqZzI3MFZHVFQvcU5CaHA0Rw==
X-SES-DKIM-SIGNATURE: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1501174414;
h=X-SES-RECEIPT:Date:Subject:Message-ID:From:To:MIME-Version:Content-Type;
bh=Kf3QaHVBBiEvy382/1pLBxRFSsmLtlEpffsi6Kju+B4=;
b=h8+aAxvaaTyhF1HrkKjx7wWmdZ9IZ1wBAhULLQ6Yrf2ILYgiI5dWReJ5pZ5B3gkz
IBTbMyLoX5/8mAxHck0OT8mHs7phuIh0kad3Aioel92PYKeVkr+k33/dQmD3B5r5UKn
VEM41uSKQu2rGwB5CuAIgoGmKYMyeXnmX+bi6JL0=
X-Footer: a21zbXguY29t
Received: from mx4.example.com ([192.99.225.232])
(authenticated user admin@kmsmx.com)
by mx6.example.com (Mailer 9.2.3) with ESMTPSA
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits))
for s3@sms.example.com;
Thu, 27 Jul 2017 10:53:30 -0600
X-Footer: ZG9qaWdneS5jb20=
Received: from localhost ([127.0.0.1])
by mx4.example.com (Mailer 9.2.3) with ESMTPSA
for s3@sms.example.com;
Thu, 27 Jul 2017 10:53:04 -0600
Date: Thu, 27 Jul 2017 10:53:04 -0600
Subject: attachment
X-Mailer: Mailer 9.2.3/Mailer Client
X-User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
Message-ID: <2230798078-6450@mx4.example.com>
From: User <user@example.com>
To: s3@sms.example.com
X-Priority: 3
Importance: Normal
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-u4HpRD436UcA8Yj9oMVl"

--=-u4HpRD436UcA8Yj9oMVl
Content-Type: multipart/alternative; boundary="=-89WEH0obI4GHeo+VHXBi"

--=-89WEH0obI4GHeo+VHXBi
Content-Type: text/plain; charset="utf-8"


--=-89WEH0obI4GHeo+VHXBi
Content-Type: text/html; charset="utf-8"

<html><head></head><body></body></html>
--=-89WEH0obI4GHeo+VHXBi--

--=-u4HpRD436UcA8Yj9oMVl
Content-Type: image/jpeg; name="example.jpg"
Content-Disposition: attachment; filename="example.jpg"
Content-Transfer-Encoding: base64

/9j/4AAQSkZJRgABAQEAYABgAAD/4RDaRXhpZgAATU0AKgAAAAgABAE7AAIAAAAFAAAISodpAAQA
AAABAAAIUJydAAEAAAAKAAAQyOocAAcAAAgMAAAAPgAAAAAc6gAAAAgAAAAAAAAAAAAAAAAAAAAA

--=-u4HpRD436UcA8Yj9oMVl--

关于email - Amazon SES 是否支持接收电子邮件附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36586592/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com