View Full Version : Limits on email Subject length?
fagricipni
06-11-2011, 12:32 AM
I am thinking about writing a custom email filter that prepends a string to the Subject header based on tests performed on the email. However, I find myself wondering if there is a limit on the length of the Subject header field; if there is, then I need to test the length of the modified subject in order to take appropriate action when the length exceeds the limit. I do not expect this to be a problem very often: since I only intend to prepend short strings, the original Subject header field would have to be already extremely close to the limit in the first place; but I do not wish to leave this possible situation unaddressed by my filter.
Hello,
RFC 2822, section 2.1.1 "Line Length Limits" would seem to indicate that no single line in an email Can exceed 998 chars and should not exceed 78 chars...
http://www.faqs.org/rfcs/rfc2822.html
I have also seen references to limits imposed by individual email clients in the 255/256 char range.
As far as any limits that may be set in the servers I will have to pass this on to Bruce and as soon as he returns to the Office this week I will ask him to post a reply.
-Bob
Bruce
06-13-2011, 12:34 PM
Bob's references to the maximum lengths are accurate. You should try to keep line lengths under 78 characters, but few (if any) modern email clients have problems with that. Headers can be "folded" (continued on the next line) to allow for longer header lengths. I am not aware of any software on our servers that has any restrictions on header lengths.
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.