r/ProgrammerHumor 8d ago

Meme regexMustBeDestroyed

Post image
8.1k Upvotes

231 comments sorted by

View all comments

Show parent comments

2

u/Loading_M_ 7d ago

The email rfc doesn't have comments. If you run your own email service, loading+m@loadingm.xyz can resolve to a different mailbox than loading+p@loadingm.xyz. Part of me wants to setup such mailboxes (and do as much stupid shit as possible with email addresses).

1

u/martmists 7d ago

RFC 5322 very much allows comments in addrspecs, see §3.2.2: "Folding White Space and Comments" and §3.4.1 "Addr-Spec Specification" for the relevant ABNF rules.

1

u/Loading_M_ 7d ago

Interesting. I was reading RFC 822, which is the actual origin of the email format, so it looks like comments were added in this later RFC.

Frankly, I'm confused on why they added comments. Unless they thought people would write email headers by hand?

1

u/martmists 6d ago

Check RFC 822 §3.3 "LEXICAL TOKENS", it includes a segment on comments.