Justin Duke

A nice little list of valid and invalid email addresses

Note This is a growing and evolving list! If you see anything that I'm missing, email me and I'll add it.

I’ve been spending a lot of time working on Buttondown lately and, as you might expect for a newsletter app, lots of this work revolves around dealing with email addresses.

In an effort to save myself and others some time, I’m trying to collate a list of usefully distinct and weird invalid and valid addresses for test harnesses and such. Below is what I have so far: it’s not a complete set, but it’s comprehensive enough to handle most of the weirdnesses out there.

Valid addresses

foo@baz.com
foo.bar@baz.com
foo@bar.baz.com
foo+bar@baz.com
foo@123.456.789.123
foo@[123.456.789.123]
"foo"@baz.com
123456789@baz.com
foo@baz-quz.com
_@baz.com
________@baz.com
foo@baz.name
foo@baz.co.uk
foo-bar@baz.com
foo."bar\ qux"@baz.com
foo.bar."bux".bar.com@baz.com
baz.com@baz.com
foo.bar+qux@baz.com
foo.bar-qux@baz.com
foo.bar@baz.com.
f@baz.com
"foo.(),:;<>[]\".FOO.\"foo@\\ \"FOO\".foo"@baz.qux.com
" "@baz.com
_foo@baz.com
foo/bar=qux@baz.com
foo."bar"@baz.com
foo@bar--baz.com
foob*ar@baz.com
"foo@bar"@baz.com

Invalid addresses

foo
#@%^%#$@#$@#.com
@baz.com
Jane Doe <foo@baz.com>
qux.baz.com
foo@bar@baz.com
.foo@baz.com
foo.@baz.com
foo..bar@baz.com
あいうえお@baz.com
foo@baz.com (Jane Doe)
foo@baz
foo@-baz.com
foo@baz.qux
foo@123.456.789.12345
foo@baz..com
foo..123456@baz.com
a"b(c)d,e:f;g<h>I[j\k]l@baz.com 
foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo@baz.com
foo bar@baz.com
foo@baz.com-
foo@baz,qux.com
foo\@bar@baz.com
foo.bar
@
@@
.@

References

Liked this post? You should subscribe to my newsletter and follow me on Twitter.
© 2017 Justin Duke • All rights reserved • I hope you have a nice day.