What is the email subject length limit?

前端 未结 5 762
名媛妹妹
名媛妹妹 2020-11-29 19:33

How many characters are allowed to be in the subject line of Internet email? I had a scan of The RFC for email but could not see specifically how long it was allowed to be.

5条回答
  •  一整个雨季
    2020-11-29 19:36

    RFC2322 states that the subject header "has no length restriction"

    but to produce long headers but you need to split it across multiple lines, a process called "folding".

    subject is defined as "unstructured" in RFC 5322

    here's some quotes ([...] indicate stuff i omitted)

    3.6.5. Informational Fields
      The informational fields are all optional.  The "Subject:" and
      "Comments:" fields are unstructured fields as defined in section
      2.2.1, [...]
    
    2.2.1. Unstructured Header Field Bodies
      Some field bodies in this specification are defined simply as
      "unstructured" (which is specified in section 3.2.5 as any printable
      US-ASCII characters plus white space characters) 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
      "folding" and "unfolding" as described in section 2.2.3).
    
    2.2.3  [...]  An unfolded header field has no length restriction and
      therefore may be indeterminately long.
    

提交回复
热议问题