Maximum length of "subject line" and body of an email

Posted on 2002-03-06
Last Modified: 2008-02-01
We need to store the content of incoming emails in
our database.

For determining the proper column lengths we need
to know how many characters a subject line and the
body of an email can contain (maximum values).

In RFC 821/822 I did not find a specification for that.
Question by:Lewis
  • 5
LVL 24

Expert Comment

Comment Utility
Subject line, I don't recall we had to expand ours, tho'. Might be best to go as near 255 as you are comfortable. Many cases the line is truncated before recipient sees it anyway.

For text, It seems to go on forever. At least one client (Lotus) and one server truncate inconsistently around 64 KB. Best IMO is either go with known limits, if internal EM, or to allow it to be open-ended, if open to the world.

I also think your rfc references are old (<1000) and without looking I'd guess they've been superceded by now (with minor changes for modern world).
LVL 24

Expert Comment

Comment Utility
fwiw, we had to also expand the field for sender. THey are now being inhuman, long unique numbers to refect the recipients, for list maintenance.
LVL 24

Expert Comment

Comment Utility
Beware, that eMail itself can fall under a variety of protocols. That said,

822 has no such limit, the way I read it, it is not geared for filesytems or databases, but for terminal I/O. It does not use character counters (as you seek) or fixed or max length, but pre-agreed-to terminators (effectively infinite, in and of itself, fo your context); sample quote:


        Each header field may be represented on exactly one line  con-
        sisting  of the name of the field and its body, and terminated
        by a CRLF; this is what the parser sees.  For readability, the
        field-body  portion of long header fields may be "folded" onto
        multiple lines of the actual field.  "Long" is commonly inter-
        preted  to  mean greater than 65 or 72 characters.  The former
        length serves as a limit, when the message is to be viewed  on
        most  simple terminals which use simple display software; how-
        ever, the limit is not imposed by this standard.
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

LVL 24

Expert Comment

Comment Utility
821 gives similar answer, and calls for 7-bit ascii:
"         Without some provision for data transparency the character
         sequence "<CRLF>.<CRLF>" ends the mail text and cannot be sent
         by the user.

"The mail data may contain any of the 128 ASCII characters."

"The maximum total length of a text line including the <CRLF> is 1000 characters (but not counting the leading dot duplicated for transparency)."

The intent is that the message is not terminated through other than keyboard sequence, thus under user's discretionary control. Friendly. For RFCs, the 'C' is for Comment, not rule, they are more guidelines agreed to than fixed rules enforced by a big-brother. Since messages were typed, sizes were constrained by users getting tired of typing. This was prior to modern methods of pasting in files like Excel spreadsheets into the middle of a message. Internet was using FTP to move files around at the time, then permitted them to be attached (not embedded, as many in this topic area attempt).
LVL 24

Accepted Solution

SunBow earned 100 total points
Comment Utility
About a year ago 821 & 822 were (Y2K) superceded by 2821 & 2822, FYI if a glutton for details. Sample 2822:

"There are two limits that this standard 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."

Note that for database purposes, one can define field as 'line' with multiple occurences.

Subject line is not structured, as such it falls under 2.2.1:

"2.2.1. Unstructured Header Field Bodies

   Some field bodies in this standard are defined simply as
   "unstructured" (which is specified below as any US-ASCII characters,
   except for CR and LF) with no further restrictions.  These are
   referred to as unstructured field bodies.  Semantically, unstructured
   field bodies are simply to be treated as a single line of characters
   with no further processing (except for header "folding" and
   "unfolding" as described in section 2.2.3).

(you already have the quote on what is constraint for a single line)
LVL 44

Expert Comment

Comment Utility
Hello Lewis

this question is open for more then 2 months
time to clean up
if not stated otherwise

my recom will be
-points to SunBow
-this will be finalized by an EE Moderator
-with no further update (09.11.2002)


posted by ToolzEE v1.0

Expert Comment

Comment Utility
Question has been closed as per recommendation

JGould-EE Moderator

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Pegasus Mail ( is a donation ware that is a collaboration of David Harris along with his team members. It is a desktop mail client that offers the option of configuring more than one mail account with single set up. It supports…
Ransomware continues to be a growing problem for both personal and business users alike and Antivirus companies are still struggling to find a reliable way to protect you from this dangerous threat.
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now