Skip to content

Validating email addresses with >3 subdomain levels fail #136

Closed
@bcroby

Description

@bcroby

When validating email addresses, there is an if statement (around line 1407) which checks to see if there are more than 3 subdomain levels. I recently ran into an issue with a US public school email address which had 4 levels to their subdomain (ex: username@mail.school.k12.il.us).

Here's the if statement that was tripping it up:
if (domain.split('.').length > 3 || domain.split('..').length > 1)

After tweaking the threshold to be 4 (instead of 3), it resolved the problem. I don't know if this is necessarily a "bug", but wanted to bring it up in case other people experience this issue as well.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions