Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon SES - Non - ASCII Characters in e-mail address

I'm trying to send an e-mail using Amazon SDK for .NET and SES. I have an e-mail which consists of special letters, for example:

ęxąmplę@źćż.com

For the domain part, i read about Punycode and that works fine. But for the local part of the address, i can't seem to find a solution: I tried using RFC 2047 encoding for whole e-mail, but then SES return 'missing final @ domain' error, so I tried to encode only a local part, so the e-mail would be

=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=@punycodeemail.com

but that didn't seem to work also. Has someone successfuly resolved that?

like image 205
Konrad Mikuła Avatar asked Sep 06 '17 07:09

Konrad Mikuła


People also ask

How do I create an AWS SES email address?

Open the Amazon SES console at https://console.aws.amazon.com/ses/ . In the left navigation pane, under Configuration, choose Verified identities. In the list of identities, choose the identity you want to configure where the Identity type is Email address and Status is Verified.

Can AWS SES send email to unverified address?

You can only send mail to verified email addresses and domains, or to the Amazon SES mailbox simulator.

What is Amazon SES configuration?

Configuration sets are groups of rules that you can apply to your verified identities. A verified identity is a domain, subdomain, or email address you use to send email through Amazon SES When you apply a configuration set to an email, all of the rules in that configuration set are applied to the email.


1 Answers

So here is what I've found out:

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.

like image 182
Martin Brown Avatar answered Oct 04 '22 10:10

Martin Brown