Skip to content

Commit 63065d5

Browse files
ensure we do not parse email strings permissively
e.g. we do not accept the entire "From" line from an email, nor two comma-separated email addresses
1 parent 83e866b commit 63065d5

File tree

7 files changed

+70
-0
lines changed

7 files changed

+70
-0
lines changed

tests/draft-next/optional/format/email.json

+10
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@
115115
"description": "an invalid IPv4-address-literal",
116116
"data": "joe.bloggs@[127.0.0.300]",
117117
"valid": false
118+
},
119+
{
120+
"description": "two email addresses is not valid",
121+
122+
"valid": false
123+
},
124+
{
125+
"description": "full \"From\" header is invalid",
126+
"data": "\"Winston Smith\" <[email protected]> (Records Department)",
127+
"valid": false
118128
}
119129
]
120130
}

tests/draft2019-09/optional/format/email.json

+10
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@
8080
"description": "two subsequent dots inside local part are not valid",
8181
"data": "[email protected]",
8282
"valid": false
83+
},
84+
{
85+
"description": "two email addresses is not valid",
86+
87+
"valid": false
88+
},
89+
{
90+
"description": "full \"From\" header is invalid",
91+
"data": "\"Winston Smith\" <[email protected]> (Records Department)",
92+
"valid": false
8393
}
8494
]
8595
}

tests/draft2020-12/optional/format/email.json

+10
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@
115115
"description": "an invalid IPv4-address-literal",
116116
"data": "joe.bloggs@[127.0.0.300]",
117117
"valid": false
118+
},
119+
{
120+
"description": "two email addresses is not valid",
121+
122+
"valid": false
123+
},
124+
{
125+
"description": "full \"From\" header is invalid",
126+
"data": "\"Winston Smith\" <[email protected]> (Records Department)",
127+
"valid": false
118128
}
119129
]
120130
}

tests/draft3/optional/format/email.json

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
"description": "two subsequent dots inside local part are not valid",
4848
"data": "[email protected]",
4949
"valid": false
50+
},
51+
{
52+
"description": "two email addresses is not valid",
53+
54+
"valid": false
55+
},
56+
{
57+
"description": "full \"From\" header is invalid",
58+
"data": "\"Winston Smith\" <[email protected]> (Records Department)",
59+
"valid": false
5060
}
5161
]
5262
}

tests/draft4/optional/format/email.json

+10
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@
7777
"description": "two subsequent dots inside local part are not valid",
7878
"data": "[email protected]",
7979
"valid": false
80+
},
81+
{
82+
"description": "two email addresses is not valid",
83+
84+
"valid": false
85+
},
86+
{
87+
"description": "full \"From\" header is invalid",
88+
"data": "\"Winston Smith\" <[email protected]> (Records Department)",
89+
"valid": false
8090
}
8191
]
8292
}

tests/draft6/optional/format/email.json

+10
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@
7777
"description": "two subsequent dots inside local part are not valid",
7878
"data": "[email protected]",
7979
"valid": false
80+
},
81+
{
82+
"description": "two email addresses is not valid",
83+
84+
"valid": false
85+
},
86+
{
87+
"description": "full \"From\" header is invalid",
88+
"data": "\"Winston Smith\" <[email protected]> (Records Department)",
89+
"valid": false
8090
}
8191
]
8292
}

tests/draft7/optional/format/email.json

+10
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@
7777
"description": "two subsequent dots inside local part are not valid",
7878
"data": "[email protected]",
7979
"valid": false
80+
},
81+
{
82+
"description": "two email addresses is not valid",
83+
84+
"valid": false
85+
},
86+
{
87+
"description": "full \"From\" header is invalid",
88+
"data": "\"Winston Smith\" <[email protected]> (Records Department)",
89+
"valid": false
8090
}
8191
]
8292
}

0 commit comments

Comments
 (0)