Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum internet email Message-ID length

Tags:

I'm looking for the maximum character length allowed for an internet Message-ID field for validation purposes within an application. I've reviewed sources such as RFC-2822 and Wikipedia "Message-ID" as well as this SO question, among other various places. The closest answer I can find is "998 characters" because that is the maximum length that the specification allows for each line in an internet message (from RFC-2822), and the Message-ID field cannot be multiple lines.

Is 998 characters the definitive answer? Is there no such limit?

like image 315
rory.ap Avatar asked May 06 '15 14:05

rory.ap


People also ask

What is the maximum email address length?

"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.

What is the Message-ID in Gmail?

Finding the Message-ID in Gmail Your gmail ID is the unique name that comes before @gmail in your email address and it will never change. Finding the Message-ID in Gmail is pretty easy - you simply open the email you want, click on the Down arrow for more options on the right-hand side, and then click on Show Original.

Do emails have a unique ID?

Message-ID is a unique identifier for a digital message, most commonly a globally unique identifier used in email and Usenet newsgroups. Message-IDs are required to have a specific format which is a subset of an email address and be globally unique. No two different messages must ever have the same Message-ID.


Video Answer


1 Answers

If there's one thing I've learned about email, it must be that it's a massively distributed system for fuzzing email software. That is, no matter what the RFCs say, you will find emails violating them, some email software coping and some failing. I think most will limp along with the robustness principle in mind.

With that out of the way, I think the maximum RFC compliant Message-ID length is 995 characters.

The maximum line length per the RFC you cite is 998 characters. That would include the "Message-ID:" field name, but you can do line folding between the field name and the field body. The line containing the actual Message-ID would then contain a space (the folding whitespace), "<", Message-ID, and ">". Semantically, the angle brackets are not part of the Message-ID. Therefore you end up with a maximum of 998 - 3 = 995 characters.

like image 99
Jani Avatar answered Sep 28 '22 03:09

Jani