Note that this email is considered invalid, which is correct, but permitted by https://tools.ietf.org/html/rfc6530
const schema = Joi.string().email()
Email address was marked as invalid. This is a problem as I would now have to use a regexp or simple string validation for email addresses which significantly reduces readability.
I'd hope for some method of switching between RFC versions - perhaps by passing in the rfc number. I don't really have any other 'good solutions' for this.
Google, for example support sending and recieving from RFC 6530 emails, but not signing up with them - they would use something like:
const signupSchema = Joi.string().email({compliance: 'rfc5322'})
const sendingSchema = Joi.string().email({compliance: 'rfc6530'})
Of course compliance could be changed to international: true/false' or something similar, but I think compliance is more explicit.
This should probably be brought up in https://github.com/hapijs/isemail, but leave this one opened so I can trace it.
Hadn't noticed, this has already been raised here: https://github.com/hapijs/isemail/issues/17
Ha, sorry for misdirecting you :)
isemail v3.0.0 has been released, with proper Unicode support. I made a PR here to update Joi to use it. That should resolve this once and for all ;)
Oh funny, I'd never seen this issue. Interesting idea with the compliance parameter.
As far as I understand, both RFCs will be enabled once I release the next joi version, but this request still stands as it could be interesting to be able to pick and choose whether internationalized emails should be allowed. I think this again falls onto isemail to support that, right @skeggse ?
pick and choose whether internationalized emails should be allowed
why is that?
Because user constraints. There are 2 RFCs, I can imagine systems not being ready to accept both.
I can imagine systems not being ready to accept both.
I've definitely run into this in the past. A simple thing for this might be you use DynamoDB to store email addresses which doesn't support the full set of internationalized characters (without escaping them) so you want to ensure that you have only valid characters.
Is this a requirement prior to releasing international email via [email protected]?
I'd tend to say so, as joi would start accepting emails it didn't previously.
This is an option in isemail now, as of 3.1.0. See https://github.com/hapijs/isemail/pull/160 (thanks, @papandreou!)
Guys, you can close this issue? Apparently is solved :shipit:
Has Joi updated to the latest isemail?
It takes 3.x so I guess yes https://github.com/hapijs/joi/blob/master/package.json#L18 馃殌
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.
Most helpful comment
This is an option in
isemailnow, as of3.1.0. See https://github.com/hapijs/isemail/pull/160 (thanks, @papandreou!)