Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the RFC 822 format for the email addresses?

I have to make a regular expression for the email addresses (RFC 822) and I want to know which characters are allowed in the local part and in the domain.

I found this https://www.rfc-editor.org/rfc/rfc822#section-6.1 but I don't see that it says which are the valid characters.

like image 366
Adrian Avatar asked Aug 31 '13 18:08

Adrian


1 Answers

According to RFC 822, the local part may contain any ASCII character, since local-part is defined using word, which is defined as atom / quoted-string; atom covers most ASCII characters, and the rest can be written in a quoted-string. There are syntactic restrictions, but obeying them, any ASCII character can be used.

On similar grounds, RFC 822 allows any ASCII character in the domain part.

On the other hand, RFC 822 was obsoleted in 2001 by RFC 2822, which in turn was obsoleted in 2008 by RFC 5322. The status of RFCs can be checked from the RFC Editor’s RFC database.

like image 175
Jukka K. Korpela Avatar answered Nov 27 '22 11:11

Jukka K. Korpela