Skip to content

Bug Hunt: Email validation evaluates shouldbe@invalid as true#369

Closed
warbrett wants to merge 1 commit intohapijs:masterfrom
warbrett:badEmailValidation
Closed

Bug Hunt: Email validation evaluates shouldbe@invalid as true#369
warbrett wants to merge 1 commit intohapijs:masterfrom
warbrett:badEmailValidation

Conversation

@warbrett
Copy link

TLD should be required...

@hueniverse
Copy link
Contributor

Not anymore with all the custom domain names.

@hueniverse hueniverse closed this Jun 20, 2014
@hueniverse hueniverse self-assigned this Jun 20, 2014
@seldo
Copy link

seldo commented Jul 2, 2014

Can we reconsider this?

Even with the profusion of new TLDs it is still impossible to have an email address of the form name@oneword; technically an email address like user@localhost is valid but that seems like an edge case that would never arise in a real-world site, while somebody omitting the ".com" from their email address is a relatively common error.

Suggest a regex that requires at least one character on either side of at least one period after the @ would resolve this without requiring an exhaustive list of TLDs.

@hueniverse
Copy link
Contributor

@skeggse?

@skeggse
Copy link

skeggse commented Jul 15, 2014

@hueniverse sorry for the delay.

isemail does intentionally validate shouldbe@invalid as valid.

I guess I could add a domains option that specifies how many domains should be present for the address to be considered valid.

@hueniverse
Copy link
Contributor

What's considered valid? Would be useful to have a flag that we can use to meet expectations.

@skeggse
Copy link

skeggse commented Jul 27, 2014

The intended use is to validate the domain using the checkDNS option. That option makes isemail asynchronous, so it might not work so well with joi.

I would really prefer not to include a hardcoded list of valid top-level domains to validate against, but I don't really see any other way. That shouldn't be a difficult change to make, but feel free to submit a pull request.

@hueniverse
Copy link
Contributor

@skeggse would you rather I checked for tld outside of isemail?

@hueniverse hueniverse reopened this Jul 28, 2014
@skeggse
Copy link

skeggse commented Aug 3, 2014

@seldo: worth mentioning that the email address human@io is valid--.io has an MX record and supports email addresses directly.

@hueniverse I added a tldWhitelist option and a minDomainAtoms option (naming flexible) in globesherpa/node-isemail#3.

@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

non issue Issue is not a problem or requires changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants