JoshData / python-email-validator

A robust email syntax and deliverability validation library for Python.
The Unlicense
1.15k stars 112 forks source link

Email address can have multiple `@` signs #103

Closed matiuszka closed 1 year ago

matiuszka commented 1 year ago

Email address local part can have multiple @ signs as long as the local part is in quotes:

>>> validate_email('"very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual"@strange.example.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/matnowak/.pyenv/versions/3.10.6/lib/python3.10/site-packages/email_validator/__init__.py", line 304, in validate_email
    raise EmailSyntaxError("The email address is not valid. It must have exactly one @-sign.")
email_validator.EmailSyntaxError: The email address is not valid. It must have exactly one @-sign.

ref: https://www.rfc-editor.org/rfc/rfc5322#section-3.2.4

JoshData commented 1 year ago

This is not supported by design. It's discussed in the README. If you need to accept addresses like that, there are some suggested alternative libraries listed right at the top of the README.

matiuszka commented 1 year ago

Ok, thanks for the clarification.