mirror of
https://github.com/django/django.git
synced 2025-02-08 08:26:13 +00:00
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.