Opened 13 years ago

Closed 12 years ago

#9371 closed defect (fixed)

dojox.validate.regexp.emailAddress allowing bad emails

Reported by: sgourley Owned by: Adam Peller
Priority: high Milestone: 1.4
Component: Dojox Version: 1.3.0
Keywords: validationtexbox Cc:
Blocked By: Blocking:


[email protected] is validating to true.

<input id="txt_name" type="text" name="email" value="" style="width: 250px;"

dojotype="dijit.form.ValidationTextBox?" regexpgen="dojox.validate.regexp.emailAddress" required="true" invalidmessage="Invalid Email Address." />

Change History (8)

comment:1 Changed 13 years ago by dante

afaik, [email protected] is a valid email address (as per the spec). There is nothing stating an email address requires a TLD. Perhaps this could be put in as an option, but generally speaking: .*@.* is valid

comment:2 Changed 13 years ago by Adam Peller

plus, I think we stopped restricting tlds now that iana has opened up tld registration.

comment:3 Changed 12 years ago by jow

A FQDN does need to be more than a single token. Otherwise it is unqualified.

The email address validator uses the validation regex.

My reading of the code suggests that if "allowNamed=false" and "allowLocal=false", then it should NOT accept "b" as a host name.

Even with allowLocal and allowNamed set to false, the regex for host does not require both a host AND a tld.

Don't know how to submit a patch, but the change is from "*" to "+" in line 111 (follows)

var hostNameRE = "((?:" + domainLabelRE + "
.)*" + domainNameRE + "

should be

var hostNameRE = "((?:" + domainLabelRE + "
.)+" + domainNameRE + "

comment:4 Changed 12 years ago by bill

Component: GeneralDojox
Owner: changed from anonymous to Adam Peller

comment:5 Changed 12 years ago by jow

Wanted to be sure I wasn't full of it, so I checked the RFC

It says a local alias (vs. a FQDN) must NOT appear in an SMTP transaction.

I hope this is helpful.

comment:6 Changed 12 years ago by Adam Peller

see #9926 for example

comment:7 Changed 12 years ago by Adam Peller

Milestone: tbd1.4

comment:8 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: newclosed

Fixed in [20703] Thanks, jow

Note: See TracTickets for help on using tickets.