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

henriklindgren opened this issue Sep 9, 2019 · 2 comments


Copy link

@henriklindgren henriklindgren commented Sep 9, 2019


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.


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('') == ''
@henriklindgren henriklindgren added the bug label Sep 9, 2019

This comment has been minimized.

Copy link

@samuelcolvin samuelcolvin commented Sep 9, 2019

Thanks for reporting, PR welcome to fix this.


This comment has been minimized.

Copy link

@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
None yet
3 participants
You can’t perform that action at this time.