Skip to content

Validate email domains are ASCII to better align with AWS Simple Email Service (SES) support#7380

Merged
mitchellhenke merged 4 commits intomainfrom
mitchellhenke/stricter-email-domain-name-validation
Nov 22, 2022
Merged

Validate email domains are ASCII to better align with AWS Simple Email Service (SES) support#7380
mitchellhenke merged 4 commits intomainfrom
mitchellhenke/stricter-email-domain-name-validation

Conversation

@mitchellhenke
Copy link
Contributor

🛠 Summary of changes

We had a few unhandled exceptions from SES when trying to send to non-ASCII domain names (NR link) with the exception Aws::SES::Errors::InvalidParameterValue: Domain contains illegal character.

SES documentation confirms this:

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.

I tested non-ASCII in the local part of the email address as well as the domain part. I tested both, and was able to receive emails to addresses with non-ASCII characters in the local part, but received the same error with non-ASCII characters in the domain. Due to that, this PR only adds ASCII validation to the domain for now.

…l Service (SES) support

changelog: Bug Fixes, Email, Validate email domains are ASCII to better align with AWS Simple Email Service (SES) support
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Mitchell Henke and others added 3 commits November 21, 2022 16:27
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@mitchellhenke mitchellhenke merged commit 23a3e9b into main Nov 22, 2022
@mitchellhenke mitchellhenke deleted the mitchellhenke/stricter-email-domain-name-validation branch November 22, 2022 20:01
@mdiarra3 mdiarra3 mentioned this pull request Nov 23, 2022
mitchellhenke pushed a commit that referenced this pull request Nov 23, 2022
…l Service (SES) support (#7380)

* Validate email domains are ASCII to better align with AWS Simple Email Service (SES) support

changelog: Bug Fixes, Email, Validate email domains are ASCII to better align with AWS Simple Email Service (SES) support

* Update app/validators/form_email_validator.rb

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>

* rescue email parsing exception

* add domain validation to AddUserEmailForm

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
This was referenced Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants