domingo, 25 de enero de 2015

Caracteres válidos en un email


Pues sí, el carácter + (más) y otros caracteres especiales son perfectamente válidos para una dirección de correo electrónico.

Muchas webs hacen una incorrecta implementación de la validación de correo electrónico, sea por Javascript o validaciones en el servidor (ASP.NET, Java, PHP, etcétera).

Por ejemplo, algunas web de la Administración:

http://administracion.gob.es/pagBuzon/buzon/buzonCiudadano.htm
https://sede.mjusticia.gob.es/cs/Satellite/Sede/es/contacto
https://sede.administracionespublicas.gob.es/icpplus/controlador?accion=AC_VERFORMULARIO

Un apunte, el carácter + (y otros caracteres) son permitidos por GMail (Google) en el nombre de cuentas de correo, siendo uno de los tipos de cuentas de correo más utilizadas.

TOMEN NOTA de esto.

The format of email addresses is local-part@domain

The local-part of the email address may use any of these ASCII characters.[4] RFC 6531 permits Unicode characters beyond the ASCII range:

  • Uppercase and lowercase English letters (a–z, A–Z) (ASCII: 65–90, 97–122)
  • Digits 0 to 9 (ASCII: 48–57)
  • These special characters: - _ ~ ! $ & ' ( ) * + , ; = : and percentile encoding i.e. %20
  • Character . (dot, period, full stop) (ASCII: 46) provided that it is not the first or last character, and provided also that it does not appear consecutively (e.g. John..Doe@example.com is not allowed).
  • Special characters are allowed with restrictions. They are:
    • Space and "(),:;<>@[\] (ASCII: 32, 34, 40, 41, 44, 58, 59, 60, 62, 64, 91–93)
Valid email addresses
  • niceandsimple@example.com
  • very.common@example.com
  • a.little.lengthy.but.fine@dept.example.com
  • disposable.style.email.with+symbol@example.com
  • other.email-with-dash@example.com
  • "much.more unusual"@example.com
  • "very.unusual.@.unusual.com"@example.com
  • "very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual"@strange.example.com
  • admin@mailserver1 (local domain name with no TLD)
  • !#$%&'*+-/=?^_`{}|~@example.org
  • "()<>[]:,;@\\\"!#$%&'*+-/=?^_`{}| ~.a"@example.org
  • " "@example.org (space between the quotes)
  • üñîçøðé@example.com (Unicode characters in local part)
  • üñîçøðé@üñîçøðé.com (Unicode characters in domain part)
Invalid email addresses
  • Abc.example.com (an @ character must separate the local and domain parts)
  • A@b@c@example.com (only one @ is allowed outside quotation marks)
  • a"b(c)d,e:f;g<h>i[j\k]l@example.com (none of the special characters in this local part is allowed outside quotation marks)
  • just"not"right@example.com (quoted strings must be dot separated or the only element making up the local-part)
  • this is"not\allowed@example.com (spaces, quotes, and backslashes may only exist when within quoted strings and preceded by a backslash)
  • this\ still\"not\\allowed@example.com (even if escaped (preceded by a backslash), spaces, quotes, and backslashes must still be contained by quotes)
  • john..doe@example.com (double dot before @)
  • john.doe@example..com (double dot after @)
  • a valid address with a leading space
  • a valid address with a trailing space



Source: http://en.wikipedia.org/wiki/Email_address#RFC_specification

http://www.xavirobot.com/blog/wp-content/uploads/2011/01/caracteres_email.html

No hay comentarios:

Publicar un comentario