tags:

views:

61

answers:

1

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  A: 

US ASCII characters only.

This is defined by RFC 822.

There is no line limit in the standard.

Strictly for improved readability, long header lines (greater than 65 or 72 characters) should be "folded" (CRLF followed by space is interpreted as space).

Note that even though the standards have no limitation on the line length, actual implementations may have imposed artificial limitations.

Therefore, to ensure that it gets through most email servers, I recommend keeping it to 128 characters. This seems to be the standard line length for encoding mechanisms such a yEnc, which was developed through testing to see what works in the real world.

Edit

I've found references that say that many implementations assume a 1000 character limit, and some older gateways may have trouble with lines over 255 characters. So, 255 might be a safe bet.

Marcus Adams