Skip to content
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

Refs #30512, #15042 -- Added local-only address to sanitize_email() tests cases. #11472

Merged
merged 1 commit into from Jun 13, 2019
Merged

Refs #30512, #15042 -- Added local-only address to sanitize_email() tests cases. #11472

merged 1 commit into from Jun 13, 2019

Conversation

carltongibson
Copy link
Member

@carltongibson carltongibson commented Jun 13, 2019

email.headerregistry.parser.get_mailbox() returns a token with a token_type attribute.

If token_type is 'invalid-mailbox' then RFC violations have been detected. Emails with only the local part, and no domain, are correctly parsed but are marked as 'invalid-mailbox'.

As per #15042, local-only are supported, to enable sending to addresses on localhost.

sanitize_email() does not currently check token_type. This test is added to avoid a regression in case this is revisited in the future.

…ests cases.

email.headerregistry.parser.get_mailbox() returns a token with a `token_type` attribute.

If `token_type` is `’invalid-mailbox’` then RFC violations have been detected. Emails with only the local part, and no domain,  are correctly parsed but are marked as `’invalid-mailbox’`.

As per #15042, local-only are supported, to enable sending to addresses on localhost.

sanitize_email() does not currently check `token_type`. This test is added to avoid a regression in case this is revisited in the future.
@carltongibson carltongibson merged commit 1564e42 into django:master Jun 13, 2019
@carltongibson carltongibson deleted the sanitize-email-test branch June 13, 2019 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants