Assumptions: Dangerous Things

How long can a name be? How short can an email address be?

All around us, IT systems have built-in assumptions and limitations. To be clear, they always have had limits, either explicitly chosen, or ones beyond which the system tends to fail in unpredictable ways. However, now that so many facets of our lives are inextricably linked to these systems, these limits can have real impacts upon real people.

Take the 2013 problems suffered by Janice “Lokelani” Keihanaikukauakahihuliheekahaunaele. She has an unusually long surname at 35 characters – and ID Cards / Driving Licences could not handle it[1].

Janice’s surname here truncated to 34 characters

Having a name mismatch in an official document is more than merely inconvenient, especially if different official documents truncate your name in different ways. It can lead to bureaucratic nightmares, being denied boarding on an aeroplane, and all sorts of complex situations.

The UK Passport has a shorter limit than this – 30 characters for a surname. But at least there is a defined way to handle names which do not fit. And, maybe, this is key: having a standard way to handle things which do not fit means that this has to at least have been considered. The real problems occur when there is no defined exception-handling process.

Extract from HMG Guidance[2]

Not wanting to cause too many problems[3], I did check the likely limits before finalising the names of my children – which vary between 31 and 35 characters in length (including a space between each name element and the next, so 28 – 32 characters without), so each has more letters in their name than there are letters in the (English) alphabet.

Many limits are unnecessarily arbitrary, and what has been grinding my gears this week has been systems which refuse to accept one of my email addresses because it is “too short” to be an email address.

Just How Short Can An Email Address Be?

There are a few answers to this, because some implementation and policy issues introduce limits that could in theory change in future.

The basic form of an email address is localpart@domainname

The localpart has to exist, which places a minimum limit of one character upon it. The @ symbol is mandatory, so we have 2 plus the length of the domainname as a lower limit.

IANA Policy Limitations

The minimum length of a gTLD – Generic Top Level Domain – is 3 characters. These include things like net, com, int, org, and a plethora of new ones which all tend to be much longer than 3 characters.

The minimum length of a ccTLD – Country Code Top Level Domain – is 2 characters. These include things like uk, fr, de, es, je, ua, za, gg, aq, and so on[4].

These limits are a matter of policy; there is no “technical” reason for disallowing single character gTLDs or ccTLDs – but their scarcity hardly makes it worthwhile. Thus it is highly unlikely that this policy would ever be changed.

So, the shortest possible domain names are ccTLDs, and ccTLDs with a single-character subdomain (plus the dot between them).

Mail Client Limitations

Back in the 1990s, I did have the opportunity to briefly insert an MX Record directly against a ccTLD. This would in theory allow for an email address of just 4 characters in length, of the form “a@bc”. However, this experiment failed completely because mail clients (and indeed MTAs – mail routers) all tend to barf on single-label domain names (that is, ones which don’t contain even a single dot).

This limitation is not a matter of policy, but of individual mail clients. There is no chance of all these clients relaxing this limitation, thus addresses of this form are generally unusable.

All of which brings us to a current minimum length for an email address of 6 characters, of the form “a@b.cd”. It does mean finding a ccTLD which is prepared to sell one a single-letter subdomain, but I did that years ago[5].

Unfortunately, I keep meeting websites which refused to accept an email address of less than 7, 8 or even 9 characters in length. Why?!

I even had an email dialogue with one of these sites, who assured me that such an email address could not work, until I drew their attention to the address I was using to quite happily communicate with them in both directions, which was 6 characters long.

The problem with these particular systems is that someone has made some incorrect assumptions and then coded them into the system. I can’t quite fathom why such systems even need a lower limit; they should ALL be verifying ownership of the entered email address by sending a one-time code to the supplied address and only accepting the address for use once the user has proven they have access to the mailbox by entering this code. If the user supplies a non-existent or broken email address, they’ll never be able to enter the one-time code, and that filters out bad addresses.

Maybe next I should start pushing the envelope in the other direction, where there is some degree of uncertainty.

RFC5322 states 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 MAIL FROM or RCPT TO command as well).

But then there is this:

In addition to restrictions on syntax, there is a length limit on email addresses. That limit is a maximum of 64 characters (octets) in the "local part" (before the "@") and a maximum of 255 characters (octets) in the domain part (after the "@") for a total length of 320 characters. However, there is a restriction in RFC 2821 on the length of an address in MAIL and RCPT commands of 254 characters. Since addresses that do not fit in those fields are not normally useful, the upper limit on address lengths should normally be considered to be 254.
— rfc-editor.org

Clearly some experimentation needed 😏

Footnotes

[1] USA Today story still available here.

[2] Full document here

[3] For once

[4] Have a couple of Geek Points if you can identify each of those listed without looking them up. Otherwise… you clearly need to get out LESS!

[5] I literally got fed up with typing “tinyurl.com” – an outrageous 11 characters for the domain name of a URL “shortening” service.

Leave a comment