-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle RFC5322 #54
Comments
I like your attention to detail, but.... It's valid but kind of a ridiculous address. Is this an email address that you use or that you know is actually used in the wild? As per the README, the goal of this project is not to parse all valid email addresses and quoted forms are specifically listed in the Assumptions part of the README as not supported. |
I did not see that in the README. Thanks. |
JoshData
added a commit
that referenced
this issue
Apr 11, 2023
…ith better exception messages People have opened issues several times about quoted local parts being incorrectly rejected. We can give a better error when it happens to head-off questions about it by parsing them so that we know when they occur. * Detect when a quoted-string local part might be present when splitting the address into a local part and domain part when the address has quoted @-signs in the local part rather than giving an error message about multiple @-signs. * Remove the surrounding quotes and un-escape the string before checking the syntax of the local part. Return the un-quoted and un-escaped string as the normalized local_part in the returned ValidatedEmail object if it's valid as an unquoted local part. * Check for invalid characters in the quoted-string (per the spec and our additional Unicode character checks) and raise exceptions. * Add a new option to accept quoted-string local parts which is off by default. When accepting them, apply Unicode normalization as per dot-atom internationalized addresses and apply minimal backslash escaping. * Update tests. See #54, #92.
JoshData
added a commit
that referenced
this issue
Apr 15, 2023
…ith better exception messages People have opened issues several times about quoted local parts being incorrectly rejected. We can give a better error when it happens to head-off questions about it by parsing them so that we know when they occur. * Detect when a quoted-string local part might be present when splitting the address into a local part and domain part when the address has quoted @-signs in the local part rather than giving an error message about multiple @-signs. * Remove the surrounding quotes and un-escape the string before checking the syntax of the local part. Return the un-quoted and un-escaped string as the normalized local_part in the returned ValidatedEmail object if it's valid as an unquoted local part. * Check for invalid characters in the quoted-string (per the spec and our additional Unicode character checks) and raise exceptions. * Add a new option to accept quoted-string local parts which is off by default. When accepting them, apply Unicode normalization as per dot-atom internationalized addresses and apply minimal backslash escaping. * Update tests. See #54, #92.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refer to section 3.4.1 of RFC 5322 and to the Wikipedia page on email addresses.
I added the following test:
The test failed:
This is a valid email address, even if hard to use.
The text was updated successfully, but these errors were encountered: