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

EmailStr is not case-sensitive on local part of email per RFC 5321 #798

Closed
henriklindgren opened this issue Sep 9, 2019 · 2 comments
Closed
Labels

Comments

@henriklindgren
Copy link
Contributor

@henriklindgren henriklindgren commented Sep 9, 2019

Bug

EmailStr validate-method performs lower() on whole string including local part, violating RFC 5321 by not conforming to

The local-part of a mailbox MUST BE treated as case sensitive.
https://tools.ietf.org/rfc/rfc5321.txt

See

return name or email[: email.index('@')], email.lower()

  • OS: Any
  • Python version import sys; print(sys.version): Any
  • Pydantic version import pydantic; print(pydantic.VERSION): 0.32.2

Where possible please include a self contained code snippet describing your bug:

import pydantic
assert pydantic.EmailStr.validate('AbC@example.com') == 'AbC@example.com'
@henriklindgren henriklindgren added the bug label Sep 9, 2019
@samuelcolvin

This comment has been minimized.

Copy link
Owner

@samuelcolvin samuelcolvin commented Sep 9, 2019

Thanks for reporting, PR welcome to fix this.

@dmontagu

This comment has been minimized.

Copy link
Collaborator

@dmontagu dmontagu commented Oct 7, 2019

Closing as it looks like this was addressed by #801. Thanks for the contribution @henriklindgren!

@dmontagu dmontagu closed this Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.