Checking if email is valid

Jon Ribbens jon+usenet at unequivocal.eu
Thu Nov 2 08:00:27 EDT 2023


On 2023-11-02, Simon Connah <simon.n.connah at protonmail.com> wrote:
> Valid as in conforms to the standard. Although having looked at the
> standard that might be more difficult than originally planned.

Yes. Almost nobody actually implements "the standard" as in RFC 2822
section 3.4.1 (which can contain, for example, non-printable control
characters, and comments), nor is it particularly clear that they
should. So while checking against "the spec" might sound right, it's
highly unlikely that it's what you actually want. Would you really
want to allow:

    (jam today) "chris @ \"home\""@ (Chris's host.)public.example

for example? And would you be able to do anything with it if you did?


More information about the Python-list mailing list