Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
email@123.123.123.123
email@[123.123.123.123]
"email"@example.com
1234567890@example.com
email@example-one.com
_______@example.com
email@example.name
email@example.museum
email@example.co.jp
firstname-lastname@example.com
List of Strange Valid Email Addresses
much.”more\ unusual”@example.com
very.unusual.”@”.unusual.com@example.com
very.”(),:;<>[]”.VERY.”very@\\ "very”.unusual@strange.example.com
List of Invalid Email Addresses
plainaddress
#@%^%#$@#$@#.com
@example.com
Joe Smith <email@example.com>
email.example.com
email@example@example.com
.email@example.com
email.@example.com
email..email@example.com
あいうえお@example.com
email@example.com (Joe Smith)
email@example
email@-example.com
email@example.web
email@111.222.333.44444
email@example..com
Abc..123@example.com
List of Strange Invalid Email Addresses
”(),:;<>[\]@example.com
just”not”right@example.com
this\ is"really"not\allowed@example.com
@sunethshehan
Copy link

sunethshehan commented Jun 9, 2022

nice-click-nice

@thurst28
Copy link

thurst28 commented Jul 1, 2022

ok

@AndyJPhillips-lively
Copy link

AndyJPhillips-lively commented Jul 1, 2022

ok

@romarioschneider
Copy link

romarioschneider commented Jul 19, 2022

ok

@MetaMmodern
Copy link

MetaMmodern commented Jul 25, 2022

ok

@micahbf
Copy link

micahbf commented Jul 26, 2022

ok

@KthProg
Copy link

KthProg commented Jul 27, 2022

ok

@jmadelaine
Copy link

jmadelaine commented Jul 27, 2022

ok

@johnd3v
Copy link

johnd3v commented Aug 17, 2022

ok

@ooyendyk
Copy link

ooyendyk commented Aug 26, 2022

ok

@maxpushka
Copy link

maxpushka commented Sep 2, 2022

ok

@manucabral
Copy link

manucabral commented Sep 19, 2022

ok

@JulianBissekkou
Copy link

JulianBissekkou commented Sep 30, 2022

ok

@stefanschaller
Copy link

stefanschaller commented Sep 30, 2022

ok

@ckpanchal
Copy link

ckpanchal commented Oct 7, 2022

ok

@ndelanou
Copy link

ndelanou commented Oct 10, 2022

ok

@AlyanQ
Copy link

AlyanQ commented Oct 14, 2022

ok

@Diaz-adrianz
Copy link

Diaz-adrianz commented Oct 15, 2022

ok

@KevzPeter
Copy link

KevzPeter commented Oct 20, 2022

ok

@randrasek-eb
Copy link

randrasek-eb commented Oct 20, 2022

ok

@zackpi
Copy link

zackpi commented Nov 16, 2022

ok

@lucastrajtenberg
Copy link

lucastrajtenberg commented Nov 16, 2022

ok

@cizordj
Copy link

cizordj commented Nov 17, 2022

ok

@Manuel-Zapp-Studio
Copy link

Manuel-Zapp-Studio commented Nov 17, 2022

ok

@stefanschaller
Copy link

stefanschaller commented Nov 17, 2022

ok

@dhoepfl
Copy link

dhoepfl commented Nov 17, 2022

email@123.123.123.123
email@[123.123.123.123]
these two mail ids are Invalid.

According to RFC5322:

Parsing "email" local-part

local-part = dot-atom
dot-atom = dot-atom-text
dot-atom-text = 1*atext
atext = ALPHA

"email" is a valid local-part

Parsing "123.123.123.123" domain

domain = dot-atom
dot-atom = dot-atom-text
dot-atom-text = 1*atext *("." 1*atext)
atext = DIGIT

"123" is a valid 1*atext, so "123.123.123.123" is a valid domain.

Parsing "[123.123.123.123]" domain

domain = domain-literal
domain-literal = "[" *(dtext) "]"
dtext = %d49 / %d50 / %d51

"123" is a valid *(dtext), so "[123.123.123.123]" is a valid domain.

@dhoepfl
Copy link

dhoepfl commented Nov 17, 2022

"email@example.com (Joe Smith)" is valid according to RFC5322:

(local-part see previous comment)

domain = obs-domain
obs-domain = atom *("." atom)
atom = 1*atext [CFWS]
atext = ALPHA
CFWS = 1*([FWS] comment)
comment = "(" *([FWS] ccontent) ")"
ccontent = ctext
ctext = ... ; US-ASCII

"example" matches as atom
"com (Joe Smith)" matches as atext+CFWS
("com" is 1*atext, " " is FWS, "(Joe Smith)" is comment)

@dhoepfl
Copy link

dhoepfl commented Nov 17, 2022

That being said, I think that "email@123.123.123.123" and "email@example.com (Joe Smith)" are invalid according to RFC5321.
(Sorry, the parser I implemented currently only checks for RFC5322 compliance.)

@jsaxon-cars
Copy link

jsaxon-cars commented Nov 23, 2022

Where's the regex to validate this list???

@micahbf
Copy link

micahbf commented Nov 23, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment