Amazon SES - 电子邮件地址中的非ASCII字符

Kon*_*uła 13 .net email punycode amazon-web-services amazon-ses

我正在尝试使用Amazon SDK for .NET和SES发送电子邮件.我有一封包含特殊字母的电子邮件,例如:

ęxąmplę@źćż.com

对于域部分,我读到有关Punycode的方法,并且工作正常.但对于地址的本地部分,我似乎无法找到解决方案:我尝试使用RFC 2047编码整个电子邮件,但随后SES返回'缺少最终@域'错误,所以我尝试只编码一个本地部分,所以电子邮件将是

=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=@punycodeemail.com
Run Code Online (Sandbox Code Playgroud)

但这似乎也不起作用.有人成功地解决了这个问题吗?

Mar*_*own 5

所以这是我发现的:

The base SMTP email address specification (RFC 5322 Section 3.4) does not allow email addresses outside a limited subset of the 7-bit ASCII range. In order to support email addresses like the one in the question both the sending and receiving email servers need to support an extension to SMTP called SMTPUTF8 defined in RFC 6531.

According to a conversation I had with Amazon SES's support team SMTPUTF8 isn't widely supported currently (23 Nov 2017) and as such they don't support it either. Their development team is working on it, however they have no idea when, or even if, it will make it to production.

The following comment that is currently in the .Net SDK documentation about MIME Encoding seems to be somewhat of a red herring.

By default, the string must be 7-bit ASCII. If the text must contain any other characters, then you must use MIME encoded-word syntax (RFC 2047) instead of a literal string. MIME encoded-word syntax uses the following form: =?charset?encoding?encoded-text?=. For more information, see RFC 2047.

Since I chatted to Amazon about this they seem to be correcting some parts of the documentation a better description can be found in the API documentation.

Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the local part of a destination email address (the part of the email address that precedes the @ sign) may only contain 7-bit ASCII characters. If the domain part of an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using Punycode, as described in RFC3492.