Invalid email address (which has invalid domain) is rejected by Email
apps. It should not be detected as email in the first place (as
 RFC standards 5322).

As email apps reject these invalid Email-Addresses, So exclusion of
improper email addresses from getting detected as email Intent, would
definitely improve the User Experience & save user efforts.

As per section 3.4.1 of RFC 5322
(http://tools.ietf.org/html/rfc5322#section-3.4.1).
A domain is consisted as=
"domain = dot-atom / domain-literal / obs-domain"

A dot atom "contains no characters other than atext characters or "."
surrounded by atext characters". Hence, by definition, a dot atom may
not contain two or more consecutive periods.

atext Reference
(http://tools.ietf.org/html/rfc5322#section-3.2.3)

Modified the Regex to identify the same, added more unit test cases

BUG=571804

Review URL: https://codereview.chromium.org/1541093002

Cr-Commit-Position: refs/heads/master@{#366901}
2 files changed