Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum length of a display name in an email address

According to the question "What is the maximum length of a valid email address?", the maximum length of the address is 254. But I like to know what would be the maximum length of the display name:

Display Name <[email protected]>

Following this link https://www.ietf.org/mail-archive/web/ietf-822/current/msg00086.html the size is unlimited but practically according this link https://www.ietf.org/mail-archive/web/ietf-822/current/msg00088.html the size would be 72 characters. But I believe this answer is a bit outdated? What would be reasonable limit for today?

like image 835
Trendfischer Avatar asked Aug 15 '14 15:08

Trendfischer


1 Answers

If you ask the maximal length allowed by the specs (the normative source is RFC5322 as of current_timestamp) then, indeed, there is no limit, since folding allows you to have an unlimted length of any field (while still respecting the advised 78 [or the larger 998] character limit).

Practical limit is a very subjective question, since "practical" would be the length which is fully displayed by "most" clients and environments; now that's pretty hard to calculate.

I would say the upper limit of practicality would be the total length of 78 characters from the "From:" header up to the last ">" character of the email address, since longer ones may probably break up while displaying in almost all environments, which would give you around 40 characters to use even for longer email addresses.

Most clients, however, probably expects to display around 20-25 characters under normal circumstances.

These are all displayed characters and not the actual length in bytes of a whatever way encoded address (especially for long utf-8 codes).

like image 118
grin Avatar answered Sep 30 '22 13:09

grin