Skip to content

test(email): add the RFC 5321 Mailbox cases to the remaining drafts - #1164

Open
kabirvashisht4-glitch wants to merge 1 commit into
json-schema-org:mainfrom
kabirvashisht4-glitch:test/email-rfc5321-mailbox-all-drafts
Open

test(email): add the RFC 5321 Mailbox cases to the remaining drafts#1164
kabirvashisht4-glitch wants to merge 1 commit into
json-schema-org:mainfrom
kabirvashisht4-glitch:test/email-rfc5321-mailbox-all-drafts

Conversation

@kabirvashisht4-glitch

@kabirvashisht4-glitch kabirvashisht4-glitch commented Aug 31, 2026

Copy link
Copy Markdown

Closes #1162.

The seven cases added in 995932c (#467) only landed in draft2020-12. draft2019-09, draft7, draft6 and draft4 have been missing them ever since:

instance expected
"joe bloggs"@example.com valid
"joe..bloggs"@example.com valid
"joe@bloggs"@example.com valid
joe.bloggs@[127.0.0.1] valid
joe.bloggs@[IPv6:::1] valid
joe.bloggs@invalid=domain.com invalid
joe.bloggs@[127.0.0.300] invalid

None of them depend on anything specific to draft2020-12. format: "email" has denoted an RFC 5321 Mailbox since draft4, and each case follows directly from that grammar:

  • qtextSMTP is %d32-33 / %d35-91 / %d93-126, so a Quoted-string local part may contain SP, consecutive ., and @ — covering the three quoted cases.
  • Mailbox = Local-part "@" ( Domain / address-literal ), and address-literal admits both IPv4-address-literal and IPv6-address-literal.
  • Domain = sub-domain *("." sub-domain) with sub-domain = Let-dig [Ldh-str], so = cannot occur in a domain.
  • Snum = 1*3DIGIT ; representing a decimal integer value in the range 0 through 255, so 300 is not a valid final octet.

Per CONTRIBUTING — "When adding test cases, they should be added to all past (and future) versions of the specification which they apply to" — they belong in every draft that has the file.

The cases are inserted at their draft2020-12 positions, so after this change optional/format/email.json is identical across draft4 → draft2020-12 and v1 apart from the schema object. v1 already had all seven.

draft3 is deliberately untouched: its email.json is a much older 11-test file that has diverged from draft4+ in far more than these seven cases, and reconciling it is a separate change.

Verification

bin/jsonschema_suite check passes 11/11 with no skips (jsonschema==4.19.0).

@kabirvashisht4-glitch
kabirvashisht4-glitch requested a review from a team as a code owner August 31, 2026 02:02
The seven cases added in 995932c (json-schema-org#467) only landed in draft2020-12, so
draft2019-09, draft7, draft6 and draft4 have been missing them since:

  * quoted-string local parts containing a space, a double dot, and a @
  * IPv4 and IPv6 address literals after the @
  * a domain containing '=', which is outside Let-dig / Ldh-str
  * an address literal whose final octet is 300

None of these depend on anything specific to draft2020-12 -- the email
format has denoted an RFC 5321 Mailbox since draft4 -- so per
CONTRIBUTING they belong in every draft that has the file.

The cases are inserted at their draft2020-12 positions, which makes
email.json identical across draft4 through draft2020-12, and v1, apart
from the schema object.

Closes json-schema-org#1162
@kabirvashisht4-glitch
kabirvashisht4-glitch force-pushed the test/email-rfc5321-mailbox-all-drafts branch from 099107b to 10eca35 Compare August 31, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

email: the RFC 5321 Mailbox tests from #467 only landed in draft2020-12

1 participant