问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/2721605/maximum-size-of-email-x-headers