RFC-compliant email address validation

This test suite comes from Dominic Sayers and is a mix of RFC examples and examples from other validators.

The test suite is currently allowing addresses that are unroutable on the public Internet, such as first.last@example.123. This behavior is disabled by default, but can be switched on; the tests are run in both modes for comparison.


 

Expected

Strict Mode

Public Mode

Percent correct

-

98%

96%

Number correct

-

276 / 280

269 / 280

Test # 1
first.last@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@iana.org

Valid

Valid

Valid

Test # 2
1234567890123456789012345678901234567890123456789012345678901234@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

1234567890123456789012345678901234567890123456789012345678901234@iana.org

Valid

Valid

Valid

Test # 3
first.last@sub.do,com
Expected result: Invalid
Comment: Mistyped comma instead of dot (replaces old #3 which was the same as #57)
Source: Rob <bob@bob.com>

first.last@sub.do,com

Invalid

Invalid

Invalid

Test # 4
"first\"last"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

"first\"last"@iana.org

Valid

Valid

Valid

Test # 5
first\@last@iana.org
Expected result: Invalid
Comment: Escaping can only happen within a quoted string
Source: Dominic Sayers

first\@last@iana.org

Invalid

Invalid

Invalid

Test # 6
"first@last"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

"first@last"@iana.org

Valid

Valid

Valid

Test # 7
"first\\last"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

"first\\last"@iana.org

Valid

Valid

Valid

Test # 8
x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x2
Expected result: Valid
Comment: Total length reduced to 254 characters so it's still valid
Source: Dominic Sayers

x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x2

Valid

Valid

Valid

Test # 9
1234567890123456789012345678901234567890123456789012345678@12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.123456789012345678901234567890123456789012345678901234567890123.iana.org
Expected result: Valid
Comment: Total length reduced to 254 characters so it's still valid
Source: RFC 3696 erratum 1690

1234567890123456789012345678901234567890123456789012345678@12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.123456789012345678901234567890123456789012345678901234567890123.iana.org

Valid

Valid

Valid

Test # 10
first.last@[12.34.56.78]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 erratum 1690

first.last@[12.34.56.78]

Valid

Valid

Valid

Test # 11
first.last@[IPv6:::12.34.56.78]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@[IPv6:::12.34.56.78]

Valid

Valid

Valid

Test # 12
first.last@[IPv6:1111:2222:3333::4444:12.34.56.78]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333::4444:12.34.56.78]

Valid

Valid

Valid

Test # 13
first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.56.78]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.56.78]

Valid

Valid

Valid

Test # 14
first.last@[IPv6:::1111:2222:3333:4444:5555:6666]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@[IPv6:::1111:2222:3333:4444:5555:6666]

Valid

Valid

Valid

Test # 15
first.last@[IPv6:1111:2222:3333::4444:5555:6666]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333::4444:5555:6666]

Valid

Valid

Valid

Test # 16
first.last@[IPv6:1111:2222:3333:4444:5555:6666::]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333:4444:5555:6666::]

Valid

Valid

Valid

Test # 17
first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888]

Valid

Valid

Valid

Test # 18
first.last@x23456789012345678901234567890123456789012345678901234567890123.iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@x23456789012345678901234567890123456789012345678901234567890123.iana.org

Valid

Valid

Valid

Test # 19
first.last@3com.com
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@3com.com

Valid

Valid

Valid

Test # 20
first.last@123.iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

first.last@123.iana.org

Valid

Valid

Valid

Test # 21
123456789012345678901234567890123456789012345678901234567890@12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.12345.iana.org
Expected result: Invalid
Comment: Entire address is longer than 254 characters
Source: RFC 3696 erratum 1690

123456789012345678901234567890123456789012345678901234567890@12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.12345.iana.org

Invalid

Invalid

Invalid

Test # 22
first.last
Expected result: Invalid
Comment: No @
Source: Dominic Sayers

first.last

Invalid

Invalid

Invalid

Test # 23
12345678901234567890123456789012345678901234567890123456789012345@iana.org
Expected result: Invalid
Comment: Local part more than 64 characters
Source: Dominic Sayers

12345678901234567890123456789012345678901234567890123456789012345@iana.org

Invalid

Invalid

Invalid

Test # 24
.first.last@iana.org
Expected result: Invalid
Comment: Local part starts with a dot
Source: Dominic Sayers

.first.last@iana.org

Invalid

Invalid

Invalid

Test # 25
first.last.@iana.org
Expected result: Invalid
Comment: Local part ends with a dot
Source: Dominic Sayers

first.last.@iana.org

Invalid

Invalid

Invalid

Test # 26
first..last@iana.org
Expected result: Invalid
Comment: Local part has consecutive dots
Source: Dominic Sayers

first..last@iana.org

Invalid

Invalid

Invalid

Test # 27
"first"last"@iana.org
Expected result: Invalid
Comment: Local part contains unescaped excluded characters
Source: Dominic Sayers

"first"last"@iana.org

Invalid

Invalid

Invalid

Test # 28
"first\last"@iana.org
Expected result: Valid
Comment: Any character can be escaped in a quoted string
Source: Dominic Sayers

"first\last"@iana.org

Valid

Valid

Valid

Test # 29
"""@iana.org
Expected result: Invalid
Comment: Local part contains unescaped excluded characters
Source: Dominic Sayers

"""@iana.org

Invalid

Invalid

Invalid

Test # 30
"\"@iana.org
Expected result: Invalid
Comment: Local part cannot end with a backslash
Source: Dominic Sayers

"\"@iana.org

Invalid

Invalid

Invalid

Test # 31
""@iana.org
Expected result: Invalid
Comment: Local part is effectively empty
Source: Dominic Sayers

""@iana.org

Invalid

Invalid

Invalid

Test # 32
first\\@last@iana.org
Expected result: Invalid
Comment: Local part contains unescaped excluded characters
Source: Dominic Sayers

first\\@last@iana.org

Invalid

Invalid

Invalid

Test # 33
first.last@
Expected result: Invalid
Comment: No domain
Source: Dominic Sayers

first.last@

Invalid

Invalid

Invalid

Test # 34
x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456
Expected result: Invalid
Comment: Domain exceeds 255 chars
Source: Dominic Sayers

x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456

Invalid

Invalid

Invalid

Test # 35
first.last@[.12.34.56.78]
Expected result: Invalid
Comment: Only char that can precede IPv4 address is ':'
Source: Dominic Sayers

first.last@[.12.34.56.78]

Invalid

Invalid

Invalid

Test # 36
first.last@[12.34.56.789]
Expected result: Invalid
Comment: Can't be interpreted as IPv4 so IPv6 tag is missing
Source: Dominic Sayers

first.last@[12.34.56.789]

Invalid

Invalid

Invalid

Test # 37
first.last@[::12.34.56.78]
Expected result: Invalid
Comment: IPv6 tag is missing
Source: Dominic Sayers

first.last@[::12.34.56.78]

Invalid

Invalid

Invalid

Test # 38
first.last@[IPv5:::12.34.56.78]
Expected result: Invalid
Comment: IPv6 tag is wrong
Source: Dominic Sayers

first.last@[IPv5:::12.34.56.78]

Invalid

Invalid

Invalid

Test # 39
first.last@[IPv6:1111:2222:3333::4444:5555:12.34.56.78]
Expected result: Valid
Comment: RFC 4291 disagrees with RFC 5321 but is cited by it
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333::4444:5555:12.34.56.78]

Valid

Valid

Valid

Test # 40
first.last@[IPv6:1111:2222:3333:4444:5555:12.34.56.78]
Expected result: Invalid
Comment: Not enough IPv6 groups
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333:4444:5555:12.34.56.78]

Invalid

Invalid

Invalid

Test # 41
first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:12.34.56.78]
Expected result: Invalid
Comment: Too many IPv6 groups (6 max)
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:12.34.56.78]

Invalid

Invalid

Invalid

Test # 42
first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777]
Expected result: Invalid
Comment: Not enough IPv6 groups
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777]

Invalid

Invalid

Invalid

Test # 43
first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888:9999]
Expected result: Invalid
Comment: Too many IPv6 groups (8 max)
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888:9999]

Invalid

Invalid

Invalid

Test # 44
first.last@[IPv6:1111:2222::3333::4444:5555:6666]
Expected result: Invalid
Comment: Too many '::' (can be none or one)
Source: Dominic Sayers

first.last@[IPv6:1111:2222::3333::4444:5555:6666]

Invalid

Invalid

Invalid

Test # 45
first.last@[IPv6:1111:2222:3333::4444:5555:6666:7777]
Expected result: Valid
Comment: RFC 4291 disagrees with RFC 5321 but is cited by it
Source: Dominic Sayers

first.last@[IPv6:1111:2222:3333::4444:5555:6666:7777]

Valid

Valid

Valid

Test # 46
first.last@[IPv6:1111:2222:333x::4444:5555]
Expected result: Invalid
Comment: x is not valid in an IPv6 address
Source: Dominic Sayers

first.last@[IPv6:1111:2222:333x::4444:5555]

Invalid

Invalid

Invalid

Test # 47
first.last@[IPv6:1111:2222:33333::4444:5555]
Expected result: Invalid
Comment: 33333 is not a valid group in an IPv6 address
Source: Dominic Sayers

first.last@[IPv6:1111:2222:33333::4444:5555]

Invalid

Invalid

Invalid

Test # 48
first.last@example.123
Expected result: Valid
Comment: TLD can't be all digits
Source: Dominic Sayers

first.last@example.123

Valid

Valid

Invalid

Test # 49
first.last@com
Expected result: Valid
Comment: Mail host must be second- or lower level
Source: Dominic Sayers

first.last@com

Valid

Valid

Invalid

Test # 50
first.last@-xample.com
Expected result: Invalid
Comment: Label can't begin with a hyphen
Source: Dominic Sayers

first.last@-xample.com

Invalid

Invalid

Invalid

Test # 51
first.last@exampl-.com
Expected result: Invalid
Comment: Label can't end with a hyphen
Source: Dominic Sayers

first.last@exampl-.com

Invalid

Invalid

Invalid

Test # 52
first.last@x234567890123456789012345678901234567890123456789012345678901234.iana.org
Expected result: Invalid
Comment: Label can't be longer than 63 octets
Source: Dominic Sayers

first.last@x234567890123456789012345678901234567890123456789012345678901234.iana.org

Invalid

Invalid

Invalid

Test # 53
"Abc\@def"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (February 2004)

"Abc\@def"@iana.org

Valid

Valid

Valid

Test # 54
"Fred\ Bloggs"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (as amended by erratum 2005-07-09)

"Fred\ Bloggs"@iana.org

Valid

Valid

Valid

Test # 55
"Joe.\\Blow"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (as amended by erratum 2005-07-09)

"Joe.\\Blow"@iana.org

Valid

Valid

Valid

Test # 56
"Abc@def"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (as amended by erratum 2005-07-09)

"Abc@def"@iana.org

Valid

Valid

Valid

Test # 57
"Fred Bloggs"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (February 2004)

"Fred Bloggs"@iana.org

Valid

Valid

Valid

Test # 58
user+mailbox@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (February 2004)

user+mailbox@iana.org

Valid

Valid

Valid

Test # 59
customer/department=shipping@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (February 2004)

customer/department=shipping@iana.org

Valid

Valid

Valid

Test # 60
$A12345@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (February 2004)

$A12345@iana.org

Valid

Valid

Valid

Test # 61
!def!xyz%abc@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (February 2004)

!def!xyz%abc@iana.org

Valid

Valid

Valid

Test # 62
_somename@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: RFC 3696 (February 2004)

_somename@iana.org

Valid

Valid

Valid

Test # 63
dclo@us.ibm.com
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Doug Lovell (LinuxJournal, June 2007)

dclo@us.ibm.com

Valid

Valid

Valid

Test # 64
abc\@def@iana.org
Expected result: Invalid
Comment: This example from RFC 3696 was corrected in an erratum
Source: Doug Lovell (LinuxJournal, June 2007)

abc\@def@iana.org

Invalid

Invalid

Invalid

Test # 65
abc\\@iana.org
Expected result: Invalid
Comment: This example from RFC 3696 was corrected in an erratum
Source: Doug Lovell (LinuxJournal, June 2007)

abc\\@iana.org

Invalid

Invalid

Invalid

Test # 66
peter.piper@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Doug Lovell (LinuxJournal, June 2007)

peter.piper@iana.org

Valid

Valid

Valid

Test # 67
Doug\ \"Ace\"\ Lovell@iana.org
Expected result: Invalid
Comment: Escaping can only happen in a quoted string
Source: Doug Lovell (LinuxJournal, June 2007)

Doug\ \"Ace\"\ Lovell@iana.org

Invalid

Invalid

Invalid

Test # 68
"Doug \"Ace\" L."@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Doug Lovell (LinuxJournal, June 2007)

"Doug \"Ace\" L."@iana.org

Valid

Valid

Valid

Test # 69
abc@def@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

abc@def@iana.org

Invalid

Invalid

Invalid

Test # 70
abc\\@def@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

abc\\@def@iana.org

Invalid

Invalid

Invalid

Test # 71
abc\@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

abc\@iana.org

Invalid

Invalid

Invalid

Test # 72
@iana.org
Expected result: Invalid
Comment: No local part
Source: Doug Lovell (LinuxJournal, June 2007)

@iana.org

Invalid

Invalid

Invalid

Test # 73
doug@
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

doug@

Invalid

Invalid

Invalid

Test # 74
"qu@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

"qu@iana.org

Invalid

Invalid

Invalid

Test # 75
ote"@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

ote"@iana.org

Invalid

Invalid

Invalid

Test # 76
.dot@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

.dot@iana.org

Invalid

Invalid

Invalid

Test # 77
dot.@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

dot.@iana.org

Invalid

Invalid

Invalid

Test # 78
two..dot@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

two..dot@iana.org

Invalid

Invalid

Invalid

Test # 79
"Doug "Ace" L."@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

"Doug "Ace" L."@iana.org

Invalid

Invalid

Invalid

Test # 80
Doug\ \"Ace\"\ L\.@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

Doug\ \"Ace\"\ L\.@iana.org

Invalid

Invalid

Invalid

Test # 81
hello world@iana.org
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

hello world@iana.org

Invalid

Invalid

Invalid

Test # 82
gatsby@f.sc.ot.t.f.i.tzg.era.l.d.
Expected result: Invalid
Comment: Doug Lovell says this should fail
Source: Doug Lovell (LinuxJournal, June 2007)

gatsby@f.sc.ot.t.f.i.tzg.era.l.d.

Invalid

Invalid

Invalid

Test # 83
test@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test@iana.org

Valid

Valid

Valid

Test # 84
TEST@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

TEST@iana.org

Valid

Valid

Valid

Test # 85
1234567890@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

1234567890@iana.org

Valid

Valid

Valid

Test # 86
test+test@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test+test@iana.org

Valid

Valid

Valid

Test # 87
test-test@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test-test@iana.org

Valid

Valid

Valid

Test # 88
t*est@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

t*est@iana.org

Valid

Valid

Valid

Test # 89
+1~1+@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

+1~1+@iana.org

Valid

Valid

Valid

Test # 90
{_test_}@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

{_test_}@iana.org

Valid

Valid

Valid

Test # 91
"[[ test ]]"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

"[[ test ]]"@iana.org

Valid

Valid

Valid

Test # 92
test.test@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test.test@iana.org

Valid

Valid

Valid

Test # 93
"test.test"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

"test.test"@iana.org

Valid

Valid

Valid

Test # 94
test."test"@iana.org
Expected result: Valid
Comment: Obsolete form, but documented in RFC 5322
Source: Dave Child

test."test"@iana.org

Valid

Valid

Valid

Test # 95
"test@test"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

"test@test"@iana.org

Valid

Valid

Valid

Test # 96
test@123.123.123.x123
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test@123.123.123.x123

Valid

Valid

Valid

Test # 97
test@123.123.123.123
Expected result: Valid
Comment: Top Level Domain won't be all-numeric (see RFC 3696 Section 2). I disagree with Dave Child on this one.
Source: Dave Child

test@123.123.123.123

Valid

Valid

Invalid

Test # 98
test@[123.123.123.123]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test@[123.123.123.123]

Valid

Valid

Valid

Test # 99
test@example.iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test@example.iana.org

Valid

Valid

Valid

Test # 100
test@example.example.iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test@example.example.iana.org

Valid

Valid

Valid

Test # 101
test.iana.org
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test.iana.org

Invalid

Invalid

Invalid

Test # 102
test.@iana.org
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test.@iana.org

Invalid

Invalid

Invalid

Test # 103
test..test@iana.org
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test..test@iana.org

Invalid

Invalid

Invalid

Test # 104
.test@iana.org
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

.test@iana.org

Invalid

Invalid

Invalid

Test # 105
test@test@iana.org
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test@test@iana.org

Invalid

Invalid

Invalid

Test # 106
test@@iana.org
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dave Child

test@@iana.org

Invalid

Invalid

Invalid

Test # 107
-- test --@iana.org
Expected result: Invalid
Comment: No spaces allowed in local part
Source: Dave Child

-- test --@iana.org

Invalid

Invalid

Invalid

Test # 108
[test]@iana.org
Expected result: Invalid
Comment: Square brackets only allowed within quotes
Source: Dave Child

[test]@iana.org

Invalid

Invalid

Invalid

Test # 109
"test\test"@iana.org
Expected result: Valid
Comment: Any character can be escaped in a quoted string
Source: Dave Child

"test\test"@iana.org

Valid

Valid

Valid

Test # 110
"test"test"@iana.org
Expected result: Invalid
Comment: Quotes cannot be nested
Source: Dave Child

"test"test"@iana.org

Invalid

Invalid

Invalid

Test # 111
()[]\;:,><@iana.org
Expected result: Invalid
Comment: Disallowed Characters
Source: Dave Child

()[]\;:,><@iana.org

Invalid

Invalid

Invalid

Test # 112
test@.
Expected result: Invalid
Comment: Dave Child says so
Source: Dave Child

test@.

Invalid

Invalid

Invalid

Test # 113
test@example.
Expected result: Invalid
Comment: Dave Child says so
Source: Dave Child

test@example.

Invalid

Invalid

Invalid

Test # 114
test@.org
Expected result: Invalid
Comment: Dave Child says so
Source: Dave Child

test@.org

Invalid

Invalid

Invalid

Test # 115
test@123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012.com
Expected result: Invalid
Comment: 255 characters is maximum length for domain. This is 256.
Source: Dave Child

test@123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012.com

Invalid

Invalid

Invalid

Test # 116
test@example
Expected result: Valid
Comment: Dave Child says so
Source: Dave Child

test@example

Valid

Valid

Invalid

Test # 117
test@[123.123.123.123
Expected result: Invalid
Comment: Dave Child says so
Source: Dave Child

test@[123.123.123.123

Invalid

Invalid

Invalid

Test # 118
test@123.123.123.123]
Expected result: Invalid
Comment: Dave Child says so
Source: Dave Child

test@123.123.123.123]

Invalid

Invalid

Invalid

Test # 119
NotAnEmail
Expected result: Invalid
Comment: Phil Haack says so
Source: Phil Haack

NotAnEmail

Invalid

Invalid

Invalid

Test # 120
@NotAnEmail
Expected result: Invalid
Comment: Phil Haack says so
Source: Phil Haack

@NotAnEmail

Invalid

Invalid

Invalid

Test # 121
"test\\blah"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

"test\\blah"@iana.org

Valid

Valid

Valid

Test # 122
"test\blah"@iana.org
Expected result: Valid
Comment: Any character can be escaped in a quoted string
Source: Phil Haack

"test\blah"@iana.org

Valid

Valid

Valid

Test # 123
"test\&#13;blah"@iana.org
Expected result: Valid
Comment: Quoted string specifically excludes carriage returns unless escaped
Source: Phil Haack

"test\&#13;blah"@iana.org

Valid

Valid

Valid

Test # 124
"test&#13;blah"@iana.org
Expected result: Invalid
Comment: Quoted string specifically excludes carriage returns
Source: Phil Haack

"test&#13;blah"@iana.org

Invalid

Invalid

Invalid

Test # 125
"test\"blah"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

"test\"blah"@iana.org

Valid

Valid

Valid

Test # 126
"test"blah"@iana.org
Expected result: Invalid
Comment: Phil Haack says so
Source: Phil Haack

"test"blah"@iana.org

Invalid

Invalid

Invalid

Test # 127
customer/department@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

customer/department@iana.org

Valid

Valid

Valid

Test # 128
_Yosemite.Sam@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

_Yosemite.Sam@iana.org

Valid

Valid

Valid

Test # 129
~@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

~@iana.org

Valid

Valid

Valid

Test # 130
.wooly@iana.org
Expected result: Invalid
Comment: Phil Haack says so
Source: Phil Haack

.wooly@iana.org

Invalid

Invalid

Invalid

Test # 131
wo..oly@iana.org
Expected result: Invalid
Comment: Phil Haack says so
Source: Phil Haack

wo..oly@iana.org

Invalid

Invalid

Invalid

Test # 132
pootietang.@iana.org
Expected result: Invalid
Comment: Phil Haack says so
Source: Phil Haack

pootietang.@iana.org

Invalid

Invalid

Invalid

Test # 133
.@iana.org
Expected result: Invalid
Comment: Phil Haack says so
Source: Phil Haack

.@iana.org

Invalid

Invalid

Invalid

Test # 134
"Austin@Powers"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

"Austin@Powers"@iana.org

Valid

Valid

Valid

Test # 135
Ima.Fool@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

Ima.Fool@iana.org

Valid

Valid

Valid

Test # 136
"Ima.Fool"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

"Ima.Fool"@iana.org

Valid

Valid

Valid

Test # 137
"Ima Fool"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Phil Haack

"Ima Fool"@iana.org

Valid

Valid

Valid

Test # 138
Ima Fool@iana.org
Expected result: Invalid
Comment: Phil Haack says so
Source: Phil Haack

Ima Fool@iana.org

Invalid

Invalid

Invalid

Test # 139
phil.h\@\@ck@haacked.com
Expected result: Invalid
Comment: Escaping can only happen in a quoted string
Source: Phil Haack

phil.h\@\@ck@haacked.com

Invalid

Invalid

Invalid

Test # 140
"first"."last"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

"first"."last"@iana.org

Valid

Valid

Valid

Test # 141
"first".middle."last"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

"first".middle."last"@iana.org

Valid

Valid

Valid

Test # 142
"first\\"last"@iana.org
Expected result: Invalid
Comment: Contains an unescaped quote
Source: Dominic Sayers

"first\\"last"@iana.org

Invalid

Invalid

Invalid

Test # 143
"first".last@iana.org
Expected result: Valid
Comment: obs-local-part form as described in RFC 5322
Source: Dominic Sayers

"first".last@iana.org

Valid

Valid

Valid

Test # 144
first."last"@iana.org
Expected result: Valid
Comment: obs-local-part form as described in RFC 5322
Source: Dominic Sayers

first."last"@iana.org

Valid

Valid

Valid

Test # 145
"first"."middle"."last"@iana.org
Expected result: Valid
Comment: obs-local-part form as described in RFC 5322
Source: Dominic Sayers

"first"."middle"."last"@iana.org

Valid

Valid

Valid

Test # 146
"first.middle"."last"@iana.org
Expected result: Valid
Comment: obs-local-part form as described in RFC 5322
Source: Dominic Sayers

"first.middle"."last"@iana.org

Valid

Valid

Valid

Test # 147
"first.middle.last"@iana.org
Expected result: Valid
Comment: obs-local-part form as described in RFC 5322
Source: Dominic Sayers

"first.middle.last"@iana.org

Valid

Valid

Valid

Test # 148
"first..last"@iana.org
Expected result: Valid
Comment: obs-local-part form as described in RFC 5322
Source: Dominic Sayers

"first..last"@iana.org

Valid

Valid

Valid

Test # 149
foo@[\1.2.3.4]
Expected result: Invalid
Comment: RFC 5321 specifies the syntax for address-literal and does not allow escaping
Source: Cal Henderson

foo@[\1.2.3.4]

Invalid

Invalid

Invalid

Test # 150
"first\\\"last"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

"first\\\"last"@iana.org

Valid

Valid

Valid

Test # 151
first."mid\dle"."last"@iana.org
Expected result: Valid
Comment: Backslash can escape anything but must escape something
Source: Dominic Sayers

first."mid\dle"."last"@iana.org

Valid

Valid

Valid

Test # 152
Test.&#13;&#10; Folding.&#13;&#10; Whitespace@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

Test.&#13;&#10; Folding.&#13;&#10; Whitespace@iana.org

Valid

Valid

Valid

Test # 153
first."".last@iana.org
Expected result: Invalid
Comment: Contains a zero-length element
Source: Dominic Sayers

first."".last@iana.org

Invalid

Invalid

Invalid

Test # 154
first\last@iana.org
Expected result: Invalid
Comment: Unquoted string must be an atom
Source: Dominic Sayers

first\last@iana.org

Invalid

Invalid

Invalid

Test # 155
Abc\@def@iana.org
Expected result: Invalid
Comment: Was incorrectly given as a valid address in the original RFC 3696
Source: RFC 3696 erratum 246

Abc\@def@iana.org

Invalid

Invalid

Invalid

Test # 156
Fred\ Bloggs@iana.org
Expected result: Invalid
Comment: Was incorrectly given as a valid address in the original RFC 3696
Source: RFC 3696 erratum 246

Fred\ Bloggs@iana.org

Invalid

Invalid

Invalid

Test # 157
Joe.\\Blow@iana.org
Expected result: Invalid
Comment: Was incorrectly given as a valid address in the original RFC 3696
Source: RFC 3696 erratum 246

Joe.\\Blow@iana.org

Invalid

Invalid

Invalid

Test # 158
first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.567.89]
Expected result: Invalid
Comment: IPv4 part contains an invalid octet
Source: Cal Henderson

first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.567.89]

Invalid

Invalid

Invalid

Test # 159
"test\&#13;&#10; blah"@iana.org
Expected result: Invalid
Comment: Folding white space can't appear within a quoted pair
Source: Cal Henderson

"test\&#13;&#10; blah"@iana.org

Invalid

Invalid

Invalid

Test # 160
"test&#13;&#10; blah"@iana.org
Expected result: Valid
Comment: This is a valid quoted string with folding white space
Source: Phil Haack

"test&#13;&#10; blah"@iana.org

Valid

Valid

Valid

Test # 161
{^c\@**Dog^}@cartoon.com
Expected result: Invalid
Comment: This is a throwaway example from Doug Lovell's article. Actually it's not a valid address.
Source: Doug Lovell (LinuxJournal, June 2007)

{^c\@**Dog^}@cartoon.com

Invalid

Invalid

Invalid

Test # 162
(foo)cal(bar)@(baz)iamcal.com(quux)
Expected result: Valid
Comment: A valid address containing comments
Source: Cal Henderson

(foo)cal(bar)@(baz)iamcal.com(quux)

Valid

Valid

Valid

Test # 163
cal@iamcal(woo).(yay)com
Expected result: Valid
Comment: A valid address containing comments
Source: Cal Henderson

cal@iamcal(woo).(yay)com

Valid

Valid

Valid

Test # 164
"foo"(yay)@(hoopla)[1.2.3.4]
Expected result: Invalid
Comment: Address literal can't be commented (RFC 5321)
Source: Cal Henderson

"foo"(yay)@(hoopla)[1.2.3.4]

Invalid

Valid

Valid

Test # 165
cal(woo(yay)hoopla)@iamcal.com
Expected result: Valid
Comment: A valid address containing comments
Source: Cal Henderson

cal(woo(yay)hoopla)@iamcal.com

Valid

Valid

Valid

Test # 166
cal(foo\@bar)@iamcal.com
Expected result: Valid
Comment: A valid address containing comments
Source: Cal Henderson

cal(foo\@bar)@iamcal.com

Valid

Valid

Valid

Test # 167
cal(foo\)bar)@iamcal.com
Expected result: Valid
Comment: A valid address containing comments and an escaped parenthesis
Source: Cal Henderson

cal(foo\)bar)@iamcal.com

Valid

Valid

Valid

Test # 168
cal(foo(bar)@iamcal.com
Expected result: Invalid
Comment: Unclosed parenthesis in comment
Source: Cal Henderson

cal(foo(bar)@iamcal.com

Invalid

Invalid

Invalid

Test # 169
cal(foo)bar)@iamcal.com
Expected result: Invalid
Comment: Too many closing parentheses
Source: Cal Henderson

cal(foo)bar)@iamcal.com

Invalid

Invalid

Invalid

Test # 170
cal(foo\)@iamcal.com
Expected result: Invalid
Comment: Backslash at end of comment has nothing to escape
Source: Cal Henderson

cal(foo\)@iamcal.com

Invalid

Invalid

Invalid

Test # 171
first().last@iana.org
Expected result: Valid
Comment: A valid address containing an empty comment
Source: Dominic Sayers

first().last@iana.org

Valid

Valid

Valid

Test # 172
first.(&#13;&#10; middle&#13;&#10; )last@iana.org
Expected result: Valid
Comment: Comment with folding white space
Source: Dominic Sayers

first.(&#13;&#10; middle&#13;&#10; )last@iana.org

Valid

Valid

Valid

Test # 173
first(12345678901234567890123456789012345678901234567890)last@(1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890)iana.org
Expected result: Invalid
Comment: Too long with comments, not too long without
Source: Dominic Sayers

first(12345678901234567890123456789012345678901234567890)last@(1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890)iana.org

Invalid

Invalid

Invalid

Test # 174
first(Welcome to&#13;&#10; the ("wonderful" (!)) world&#13;&#10; of email)@iana.org
Expected result: Valid
Comment: Silly example from my blog post
Source: Dominic Sayers

first(Welcome to&#13;&#10; the ("wonderful" (!)) world&#13;&#10; of email)@iana.org

Valid

Valid

Valid

Test # 175
pete(his account)@silly.test(his host)
Expected result: Valid
Comment: Canonical example from RFC 5322
Source: RFC 5322

pete(his account)@silly.test(his host)

Valid

Valid

Valid

Test # 176
c@(Chris's host.)public.example
Expected result: Valid
Comment: Canonical example from RFC 5322
Source: RFC 5322

c@(Chris's host.)public.example

Valid

Valid

Valid

Test # 177
jdoe@machine(comment).  example
Expected result: Valid
Comment: Canonical example from RFC 5322
Source: RFC 5322

jdoe@machine(comment).  example

Valid

Valid

Valid

Test # 178
1234   @   local(blah)  .machine .example
Expected result: Valid
Comment: Canonical example from RFC 5322
Source: RFC 5322

1234   @   local(blah)  .machine .example

Valid

Valid

Valid

Test # 179
first(middle)last@iana.org
Expected result: Invalid
Comment: Can't have a comment or white space except at an element boundary
Source: Dominic Sayers

first(middle)last@iana.org

Invalid

Invalid

Invalid

Test # 180
first(abc.def).last@iana.org
Expected result: Valid
Comment: Comment can contain a dot
Source: Dominic Sayers

first(abc.def).last@iana.org

Valid

Valid

Valid

Test # 181
first(a"bc.def).last@iana.org
Expected result: Valid
Comment: Comment can contain double quote
Source: Dominic Sayers

first(a"bc.def).last@iana.org

Valid

Valid

Valid

Test # 182
first.(")middle.last(")@iana.org
Expected result: Valid
Comment: Comment can contain a quote
Source: Dominic Sayers

first.(")middle.last(")@iana.org

Valid

Valid

Valid

Test # 183
first(abc("def".ghi).mno)middle(abc("def".ghi).mno).last@(abc("def".ghi).mno)example(abc("def".ghi).mno).(abc("def".ghi).mno)com(abc("def".ghi).mno)
Expected result: Invalid
Comment: Can't have comments or white space except at an element boundary
Source: Dominic Sayers

first(abc("def".ghi).mno)middle(abc("def".ghi).mno).last@(abc("def".ghi).mno)example(abc("def".ghi).mno).(abc("def".ghi).mno)com(abc("def".ghi).mno)

Invalid

Invalid

Invalid

Test # 184
first(abc\(def)@iana.org
Expected result: Valid
Comment: Comment can contain quoted-pair
Source: Dominic Sayers

first(abc\(def)@iana.org

Valid

Valid

Valid

Test # 185
first.last@x(1234567890123456789012345678901234567890123456789012345678901234567890).com
Expected result: Valid
Comment: Label is longer than 63 octets, but not with comment removed
Source: Cal Henderson

first.last@x(1234567890123456789012345678901234567890123456789012345678901234567890).com

Valid

Valid

Valid

Test # 186
a(a(b(c)d(e(f))g)h(i)j)@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Cal Henderson

a(a(b(c)d(e(f))g)h(i)j)@iana.org

Valid

Valid

Valid

Test # 187
a(a(b(c)d(e(f))g)(h(i)j)@iana.org
Expected result: Invalid
Comment: Braces are not properly matched
Source: Cal Henderson

a(a(b(c)d(e(f))g)(h(i)j)@iana.org

Invalid

Invalid

Invalid

Test # 188
name.lastname@domain.com
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

name.lastname@domain.com

Valid

Valid

Valid

Test # 189
.@
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

.@

Invalid

Invalid

Invalid

Test # 190
a@b
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

a@b

Valid

Valid

Invalid

Test # 191
@bar.com
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

@bar.com

Invalid

Invalid

Invalid

Test # 192
@@bar.com
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

@@bar.com

Invalid

Invalid

Invalid

Test # 193
a@bar.com
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

a@bar.com

Valid

Valid

Valid

Test # 194
aaa.com
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

aaa.com

Invalid

Invalid

Invalid

Test # 195
aaa@.com
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

aaa@.com

Invalid

Invalid

Invalid

Test # 196
aaa@.123
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

aaa@.123

Invalid

Invalid

Invalid

Test # 197
aaa@[123.123.123.123]
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

aaa@[123.123.123.123]

Valid

Valid

Valid

Test # 198
aaa@[123.123.123.123]a
Expected result: Invalid
Comment: extra data outside ip
Source: Paul Gregg

aaa@[123.123.123.123]a

Invalid

Invalid

Invalid

Test # 199
aaa@[123.123.123.333]
Expected result: Invalid
Comment: not a valid IP
Source: Paul Gregg

aaa@[123.123.123.333]

Invalid

Invalid

Invalid

Test # 200
a@bar.com.
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

a@bar.com.

Invalid

Invalid

Invalid

Test # 201
a@bar
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

a@bar

Valid

Valid

Invalid

Test # 202
a-b@bar.com
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

a-b@bar.com

Valid

Valid

Valid

Test # 203
+@b.c
Expected result: Valid
Comment: TLDs can be any length
Source: Paul Gregg

+@b.c

Valid

Valid

Valid

Test # 204
+@b.com
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

+@b.com

Valid

Valid

Valid

Test # 205
a@-b.com
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

a@-b.com

Invalid

Invalid

Invalid

Test # 206
a@b-.com
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

a@b-.com

Invalid

Invalid

Invalid

Test # 207
-@..com
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

-@..com

Invalid

Invalid

Invalid

Test # 208
-@a..com
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

-@a..com

Invalid

Invalid

Invalid

Test # 209
a@b.co-foo.uk
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

a@b.co-foo.uk

Valid

Valid

Valid

Test # 210
"hello my name is"@stutter.com
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

"hello my name is"@stutter.com

Valid

Valid

Valid

Test # 211
"Test \"Fail\" Ing"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

"Test \"Fail\" Ing"@iana.org

Valid

Valid

Valid

Test # 212
valid@about.museum
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

valid@about.museum

Valid

Valid

Valid

Test # 213
invalid@about.museum-
Expected result: Invalid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

invalid@about.museum-

Invalid

Invalid

Invalid

Test # 214
shaitan@my-domain.thisisminekthx
Expected result: Valid
Comment: Disagree with Paul Gregg here
Source: Paul Gregg

shaitan@my-domain.thisisminekthx

Valid

Valid

Valid

Test # 215
test@...........com
Expected result: Invalid
Comment: ......
Source: Paul Gregg

test@...........com

Invalid

Invalid

Invalid

Test # 216
foobar@192.168.0.1
Expected result: Valid
Comment: ip need to be []
Source: Paul Gregg

foobar@192.168.0.1

Valid

Valid

Invalid

Test # 217
"Joe\\Blow"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

"Joe\\Blow"@iana.org

Valid

Valid

Valid

Test # 218
Invalid \&#10; Folding \&#10; Whitespace@iana.org
Expected result: Invalid
Comment: This isn't FWS so Dominic Sayers says it's invalid
Source: Paul Gregg

Invalid \&#10; Folding \&#10; Whitespace@iana.org

Invalid

Invalid

Invalid

Test # 219
HM2Kinsists@(that comments are allowed)this.is.ok
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

HM2Kinsists@(that comments are allowed)this.is.ok

Valid

Valid

Valid

Test # 220
user%uucp!path@berkeley.edu
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Paul Gregg

user%uucp!path@berkeley.edu

Valid

Valid

Valid

Test # 221
"first(last)"@iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

"first(last)"@iana.org

Valid

Valid

Valid

Test # 222
 &#13;&#10; (&#13;&#10; x &#13;&#10; ) &#13;&#10; first&#13;&#10; ( &#13;&#10; x&#13;&#10; ) &#13;&#10; .&#13;&#10; ( &#13;&#10; x) &#13;&#10; last &#13;&#10; (  x &#13;&#10; ) &#13;&#10; @iana.org
Expected result: Valid

Notice: Undefined index: comment in /mnt/webroot/code.iamcal.com/www/php/rfc822/tests/index.php on line 151
Source: Dominic Sayers

 &#13;&#10; (&#13;&#10; x &#13;&#10; ) &#13;&#10; first&#13;&#10; ( &#13;&#10; x&#13;&#10; ) &#13;&#10; .&#13;&#10; ( &#13;&#10; x) &#13;&#10; last &#13;&#10; (  x &#13;&#10; ) &#13;&#10; @iana.org

Valid

Valid

Valid

Test # 223
first.last @iana.org
Expected result: Valid
Comment: FWS is allowed after local part (this is similar to #152 but is the test proposed by John Kloor)
Source: John Kloor

first.last @iana.org

Valid

Valid

Valid

Test # 224
test. &#13;&#10; &#13;&#10; obs@syntax.com
Expected result: Valid
Comment: obs-fws allows multiple lines (test 2: space before break)
Source: George Pollard

test. &#13;&#10; &#13;&#10; obs@syntax.com

Valid

Valid

Valid

Test # 225
test.&#13;&#10;&#13;&#10; obs@syntax.com
Expected result: Invalid
Comment: obs-fws must have at least one WSP per line
Source: George Pollard

test.&#13;&#10;&#13;&#10; obs@syntax.com

Invalid

Invalid

Invalid

Test # 226
"Unicode NULL \␀"@char.com
Expected result: Valid
Comment: Can have escaped Unicode Character 'NULL' (U+0000)
Source: George Pollard

"Unicode NULL \␀"@char.com

Valid

Invalid

Invalid

Test # 227
"Unicode NULL ␀"@char.com
Expected result: Invalid
Comment: Cannot have unescaped Unicode Character 'NULL' (U+0000)
Source: George Pollard

"Unicode NULL ␀"@char.com

Invalid

Invalid

Invalid

Test # 228
Unicode NULL \␀@char.com
Expected result: Invalid
Comment: Escaped Unicode Character 'NULL' (U+0000) must be in quoted string
Source: George Pollard

Unicode NULL \␀@char.com

Invalid

Invalid

Invalid

Test # 229
cdburgess+!#$%&'*-/=?+_{}|~test@gmail.com
Expected result: Valid
Comment: Example given in comments
Source: cdburgess

cdburgess+!#$%&'*-/=?+_{}|~test@gmail.com

Valid

Valid

Valid

Test # 230
first.last@[IPv6:::a2:a3:a4:b1:b2:b3:b4]
Expected result: Valid
Comment: :: only elides one zero group (IPv6 authority is RFC 4291)
Source: Dominic Sayers

first.last@[IPv6:::a2:a3:a4:b1:b2:b3:b4]

Valid

Valid

Valid

Test # 231
first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3::]
Expected result: Valid
Comment: :: only elides one zero group (IPv6 authority is RFC 4291)
Source: Dominic Sayers

first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3::]

Valid

Valid

Valid

Test # 232
first.last@[IPv6::]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::]

Invalid

Invalid

Invalid

Test # 233
first.last@[IPv6:::]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:::]

Valid

Valid

Valid

Test # 234
first.last@[IPv6::::]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::::]

Invalid

Invalid

Invalid

Test # 235
first.last@[IPv6::b4]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::b4]

Invalid

Invalid

Invalid

Test # 236
first.last@[IPv6:::b4]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:::b4]

Valid

Valid

Valid

Test # 237
first.last@[IPv6::::b4]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::::b4]

Invalid

Invalid

Invalid

Test # 238
first.last@[IPv6::b3:b4]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::b3:b4]

Invalid

Invalid

Invalid

Test # 239
first.last@[IPv6:::b3:b4]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:::b3:b4]

Valid

Valid

Valid

Test # 240
first.last@[IPv6::::b3:b4]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::::b3:b4]

Invalid

Invalid

Invalid

Test # 241
first.last@[IPv6:a1::b4]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::b4]

Valid

Valid

Valid

Test # 242
first.last@[IPv6:a1:::b4]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:::b4]

Invalid

Invalid

Invalid

Test # 243
first.last@[IPv6:a1:]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:]

Invalid

Invalid

Invalid

Test # 244
first.last@[IPv6:a1::]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::]

Valid

Valid

Valid

Test # 245
first.last@[IPv6:a1:::]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:::]

Invalid

Invalid

Invalid

Test # 246
first.last@[IPv6:a1:a2:]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:a2:]

Invalid

Invalid

Invalid

Test # 247
first.last@[IPv6:a1:a2::]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:a2::]

Valid

Valid

Valid

Test # 248
first.last@[IPv6:a1:a2:::]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:a2:::]

Invalid

Invalid

Invalid

Test # 249
first.last@[IPv6:0123:4567:89ab:cdef::]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:0123:4567:89ab:cdef::]

Valid

Valid

Valid

Test # 250
first.last@[IPv6:0123:4567:89ab:CDEF::]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:0123:4567:89ab:CDEF::]

Valid

Valid

Valid

Test # 251
first.last@[IPv6:::a3:a4:b1:ffff:11.22.33.44]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:::a3:a4:b1:ffff:11.22.33.44]

Valid

Valid

Valid

Test # 252
first.last@[IPv6:::a2:a3:a4:b1:ffff:11.22.33.44]
Expected result: Valid
Comment: :: only elides one zero group (IPv6 authority is RFC 4291)
Source: Dominic Sayers

first.last@[IPv6:::a2:a3:a4:b1:ffff:11.22.33.44]

Valid

Valid

Valid

Test # 253
first.last@[IPv6:a1:a2:a3:a4::11.22.33.44]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:a2:a3:a4::11.22.33.44]

Valid

Valid

Valid

Test # 254
first.last@[IPv6:a1:a2:a3:a4:b1::11.22.33.44]
Expected result: Valid
Comment: :: only elides one zero group (IPv6 authority is RFC 4291)
Source: Dominic Sayers

first.last@[IPv6:a1:a2:a3:a4:b1::11.22.33.44]

Valid

Valid

Valid

Test # 255
first.last@[IPv6::11.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::11.22.33.44]

Invalid

Invalid

Invalid

Test # 256
first.last@[IPv6::::11.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::::11.22.33.44]

Invalid

Invalid

Invalid

Test # 257
first.last@[IPv6:a1:11.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:11.22.33.44]

Invalid

Invalid

Invalid

Test # 258
first.last@[IPv6:a1::11.22.33.44]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::11.22.33.44]

Valid

Valid

Valid

Test # 259
first.last@[IPv6:a1:::11.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:::11.22.33.44]

Invalid

Invalid

Invalid

Test # 260
first.last@[IPv6:a1:a2::11.22.33.44]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:a2::11.22.33.44]

Valid

Valid

Valid

Test # 261
first.last@[IPv6:a1:a2:::11.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:a2:::11.22.33.44]

Invalid

Invalid

Invalid

Test # 262
first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.44]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.44]

Valid

Valid

Valid

Test # 263
first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.xx]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.xx]

Invalid

Invalid

Invalid

Test # 264
first.last@[IPv6:0123:4567:89ab:CDEF::11.22.33.44]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:0123:4567:89ab:CDEF::11.22.33.44]

Valid

Valid

Valid

Test # 265
first.last@[IPv6:0123:4567:89ab:CDEFF::11.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:0123:4567:89ab:CDEFF::11.22.33.44]

Invalid

Invalid

Invalid

Test # 266
first.last@[IPv6:a1::a4:b1::b4:11.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::a4:b1::b4:11.22.33.44]

Invalid

Invalid

Invalid

Test # 267
first.last@[IPv6:a1::11.22.33]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::11.22.33]

Invalid

Invalid

Invalid

Test # 268
first.last@[IPv6:a1::11.22.33.44.55]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::11.22.33.44.55]

Invalid

Invalid

Invalid

Test # 269
first.last@[IPv6:a1::b211.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::b211.22.33.44]

Invalid

Invalid

Invalid

Test # 270
first.last@[IPv6:a1::b2:11.22.33.44]
Expected result: Valid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::b2:11.22.33.44]

Valid

Valid

Valid

Test # 271
first.last@[IPv6:a1::b2::11.22.33.44]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::b2::11.22.33.44]

Invalid

Invalid

Invalid

Test # 272
first.last@[IPv6:a1::b3:]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1::b3:]

Invalid

Invalid

Invalid

Test # 273
first.last@[IPv6::a2::b4]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::a2::b4]

Invalid

Invalid

Invalid

Test # 274
first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3:]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3:]

Invalid

Invalid

Invalid

Test # 275
first.last@[IPv6::a2:a3:a4:b1:b2:b3:b4]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Dominic Sayers

first.last@[IPv6::a2:a3:a4:b1:b2:b3:b4]

Invalid

Invalid

Invalid

Test # 276
first.last@[IPv6:a1:a2:a3:a4::b1:b2:b3:b4]
Expected result: Invalid
Comment: IPv6 authority is RFC 4291
Source: Daniel Marschall

first.last@[IPv6:a1:a2:a3:a4::b1:b2:b3:b4]

Invalid

Invalid

Invalid

Test # 277
test@test.com
Expected result: Valid
Comment: test.com has an A-record but not an MX-record
Source: Dominic Sayers

test@test.com

Valid

Valid

Valid

Test # 278
test@example.com&#10;
Expected result: Invalid
Comment: Address has a newline at the end
Source: Michael Rushton

test@example.com&#10;

Invalid

Valid

Valid

Test # 279
test@xn--example.com
Expected result: Valid
Comment: Address is at an Internationalized Domain Name (Punycode)
Source: Michael Rushton

test@xn--example.com

Valid

Valid

Valid

Test # 280
test@Bücher.ch
Expected result: Valid
Comment: Address is at an Internationalized Domain Name (UTF-8)
Source: Michael Rushton

test@Bücher.ch

Valid

Invalid

Invalid