Validation E-mail address. Reading RFC


In your hands, a hundred-five hundred times got validator e-mail address. You lazily stretched out, slowly remembering how should this address look mentally noted that it should be:

a) a user name consisting of letters, numbers and symbols. and -;
b) one and only one dog;
c) a valid domain, immediately following the dog;
d) something else that I missed …

You are not watching you reach for your keyboard, no problem groping for the key combination Shift + 2, double-click it … and open a bug tracker …

Stop

And why did you decide that your "abc" right? You are somewhere on this read? Can you poke a finger in the regulatory document? No? And not too sure he is right? Then let’s try to sort out together, but for a little bit of literacy classes.

As you know, or may not know many things the Internet has not yet standardized. But there are people who are deeply fond of all sorts of regulations, and to live without them can not. Therefore, they begin to write them yourself, and then combined in various community and write their already small groups of several hundred people. A striking example of such an organization is the Internet Society or ISOC, which publishes information document format RFC (Request for Comments). It is worth noting that the contribution of this organization in the development of the Internet can not be overestimated. Although the documents RFC and are not official standards, but many in a membrane, despite this, they are widely used Internet community, replacing the missing standards. In short, these are the documents that are produced Best Practices and Other …
More on this subject I have nothing to say. The most curious is poison in Wikipedia and the accompanying resources, and we return to our sheep, I mean to address.

So let’s look at the RFC. And we start with RFC 2821. This document describes (section 2.3.10) of the address before the @, the local part (local part) and tells us that:

Consequently, and due to a long history of problems when intermediate hosts have attempted to optimize transport by modifying them, the local-part MUST be interpreted and assigned semantics only by the host specified in the domain part of the address.
That is, the local part of the e-mail address should be interpreted (ie, validation), only a mail server on the host specified after the @. Already interesting, is not it?

Now let us turn to in RFC 2822, which considers the e-mail addresses in more detail. Section 3.4.1 of this document states that:

An addr-spec is a specific Internet identifier that contains a locally interpreted string followed by the at-sign character ("@", ASCII value 64) followed by an Internet domain. The locally interpreted string is either a quoted-string or a dot-atom.

What is a dot-atom? The answer to this question is contained in Section 3.2.4 of the same document. Dot-atom – a string consisting of atoms separated by dots, and atoms, in turn soy – it’s all numbers and letters in Latin characters as well (Warning) characters:

! $ & * – = ^ `| ~ #% ‘+ /? _ {}

Moreover, as you may have noticed in Section 3.4.1 mentioned on quoted-string, ie the possibility to use any character at all in the local part of addresses, provided that they escaped with a backslash, or surrounded by double quotes.
And finally, let’s look at the document RFC 3696 in the third section, we find confirmation of our findings:

Without quotes, local-parts may consist of any combination of alphabetic characters, digits, or any of the special characters
! # $% & ‘* + – / =? ^ _ `. {|} ~

Here we find a few examples of e-mail address (hang on, all of the following addresses – use Valid):

Abc \ @ def@example.com
Fred \ Bloggs@example.com
Joe. \ \ Blow@example.com
"Abc @ def" @ example.com
"Fred Bloggs" @ example.com
user + mailbox@example.com
customer / department = shipping@example.com
$ A12345@example.com
! Def! Xyz% abc@example.com
_somename@example.com

That’s all…

See Also

    Advertising

    Archives