Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum size of email X-Headers

We are looking at sticking some metadata into the X-Headers of email messages. These emails are for consumption by internal systems, and will be hosted on an Exchange server.

Is there a maximum size for the ammount of data that we can store in an X-Header?

Are there any limitations, such as special characters, that I should know about?

like image 700
Spike Williams Avatar asked Apr 27 '10 13:04

Spike Williams


1 Answers

US ASCII characters only.

This is defined by RFC 822.

There is no limit on the length of a header body in the standard, though there is a line length limit, which imposes a limit on the length of the header name.

There are two limits that this specification places on the number of characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.

You can, however, extend the header body beyond a single line with "folding". The receiver then "unfolds" the lines.

An unfolded header field has no length restriction and therefore may be indeterminately long.

The header name cannot be folded, so the header name cannot be longer than the line limit.

Note that even though the standards have no limitation on the total length of the header body, actual implementations may have imposed artificial limitations.

like image 56
Marcus Adams Avatar answered Sep 27 '22 18:09

Marcus Adams