Search code examples
emailsmtp

Are comments allowed in email address domain part?


Comments are allowed in email address local part - for example cat(veryangry)lives@inmyhouse.com, but is it possible to add comments in email domain part like - catlives@(veryangry)inmyhouse.com? Will SMTP servers accept that?

Just tried on POSTFIX - email comments are rejected even in email local part... In domain part accepted, but I think those comments are not recognized (or POSTFIX email filter is not so strict).

Revising my SMTP server email filter.. Now all email comments are removed, but if message is relayed - it is unclear if they should be also sent. It could be that many SMTP servers will not accept such email.. Trying to find some info in RFCs..


Solution

  • Crazy, but it's legal, from RFC2822 (from chapter: A.5. White space, comments, and other oddities):

    From: Pete(A wonderful \) chap) <pete(his account)@silly.test(his host)>

    ..The above example is aesthetically displeasing, but perfectly legal...