Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the longest possible email address? [duplicate]

Tags:

Possible Duplicate:
Exceeding Max Email Address Sizes

Is there a technical limitation to how long email addresses can be? Are there practical limitations imposed by the different major email providers out there (Google, Microsoft, etc.)?

De jure or de facto, is there a limit on the number of characters in an email address?

like image 321
Milimetric Avatar asked Oct 10 '11 19:10

Milimetric


2 Answers

What is the maximum length of an email address?

254 characters

"This arises from the simple arithmetic of maximum length of a domain (255 characters) + maximum length of a mailbox (64 characters) + the @ symbol = 320 characters. Wrong. This canard is actually documented in the original version of RFC3696. It was corrected in the errata. There's actually a restriction from RFC5321 on the path element of an SMTP transaction of 256 characters. But this includes angled brackets around the email address, so the maximum length of an email address is 254 characters." - Dominic Sayers

-> https://web.archive.org/web/20130710170052/http://www.eph.co.uk/resources/email-address-length-faq/

like image 105
MasterCassim Avatar answered Nov 04 '22 18:11

MasterCassim


De jure:

There are multiple limits, on each part of an address.

RFC5322 specifies that mail lines MUST be less than 998 characters, which would put an upper limit on addresses a bit shorter than that (need to include the command as well).

But RFC5321 specifies:

4.5.3.1.1.  Local-part  The maximum total length of a user name or other local-part is 64 octets.  4.5.3.1.2.  Domain  The maximum total length of a domain name or number is 255 octets.  4.5.3.1.3.  Path  The maximum total length of a reverse-path or forward-path is 256 octets (including the punctuation and element separators). 

So, 64 octets for username, 254 for <username@domain>.

De facto:

You can test compliance yourself with plus-syntax. Email yourself at yourusername+whateveryouwant@yourdomain.

like image 42
Alex Feinman Avatar answered Nov 04 '22 19:11

Alex Feinman