ietf-corpus

rfc-3676

The Text/Plain Format and DelSp Parameters

R. Gellens
date2004-02 streamIETF wgnon working group statusPROPOSED STANDARD pages20 canonicalhttps://www.rfc-editor.org/rfc/rfc3676 doi10.17487/RFC3676
This specification establishes two parameters (Format and DelSP) to be used with the Text/Plain media type. In the presence of these parameters, trailing whitespace is used to indicate flowed lines and a canonical quote indicator is used to indicate quoted lines. This results in an encoding which appears as normal Text/Plain in older implementations, since it is in fact normal Text/Plain, yet provides for superior wrapping/flowing, and quoting. This document supersedes the one specified in RFC 2646, "The Text/Plain Format Parameter", and adds the DelSp parameter to accommodate languages/coded character sets in which ASCII spaces are not used or appear rarely. [STANDARDS-TRACK]

obsoletes

Extracted elements (30)

design-rationale §3.3

New rich media types such as Text/Enriched and Text/HTML were rejected as solutions to embarrassing line wrap because they suffered from poor backwards compatibility and hostile user reactions when displayed as plain text. Format=Flowed was chosen because it is, in all significant ways, valid Text/Plain and renders acceptably without any special handling.

email

design-rationale §Appendix A

The DelSp mechanism was selected over other proposed techniques because it maximizes interoperability across four client populations: those supporting neither RFC 2646 nor RFC 3676, those supporting RFC 2646 only, those supporting RFC 3676, each further split by whether they handle languages with or without common spaces.

email

design-rationale §Appendix A

The DelSp parameter was added specifically to allow Format=Flowed to be used with languages and coded character sets in which ASCII spaces are rare or absent (e.g., certain Asian languages). Without DelSp=yes, inserting soft line breaks as SP CRLF would leave an extra space in the decoded text.

email

interoperability-note §5

Format=Flowed interoperates with older (non-aware) clients because flowed lines are valid Text/Plain. Non-aware clients display them with trailing whitespace visible but otherwise readable; space-stuffing produces a leading space on certain lines, which is considered a minor cosmetic issue.

email

interoperability-note §5

Hand-aligned text such as ASCII art, source code, and tables SHOULD be sent as fixed (not flowed) lines to prevent reflowing from destroying their alignment.

email

interoperability-note §4.5

If a receiving agent wishes to reformat flowed quoted lines, it SHOULD de-quote (count and remove '>' markers), reformat, and re-quote with the same number of '>' characters. This preserves quote depth across reflowing.

email

interoperability-note §5

Messages generated with DelSp=yes and received by Format=Flowed-aware but DelSp-unaware clients will display an extra trailing space after removal of soft line breaks. For languages where spaces are common, generators MAY always use DelSp=no to avoid this.

email

normative-requirement §4.2 SHOULD NOT

A generating agent SHOULD NOT insert a space in an unnatural location (such as into a word). If a word by itself exceeds 78 characters (but is under 998, the SMTP line length limit), the agent SHOULD send the word as-is.

email

normative-requirement §4.5 MUST

All lines of a paragraph MUST be either all unquoted or all quoted with the same quote depth. Whenever quote depth changes between adjacent lines, the earlier line MUST NOT be a flowed line.

email

normative-requirement §4.5 SHOULD

An interpreting agent SHOULD apply the 'quote-depth-wins' rule for improperly formatted messages: if a flowed line is followed by a line of different quote depth, the flowed line is treated as the last line of its paragraph.

email

normative-requirement §4.1 SHOULD

An interpreting agent SHOULD treat a flowed line as ending its paragraph if it is followed by a line of different quote depth or by a signature separator, or if it is at the end of the body.

email

normative-requirement §4 SHOULD NOT

DelSp SHOULD NOT be specified in Text content types other than Text/Plain with Format=Flowed when creating messages. When receiving, DelSp SHOULD be ignored if present in any other content type.

email

normative-requirement §4.2 MUST NOT

Generating agents MUST NOT place soft line breaks in a way that causes any paragraph line to become a signature separator line, since paragraphs cannot contain signature separator lines.

email

normative-requirement §4.4 MUST

On generation, any unquoted lines starting with '>', and any lines starting with a space or 'From ', MUST be space-stuffed by prepending a single SP.

email

normative-requirement §4.2 SHOULD NOT

Quoted-Printable encoding SHOULD NOT be used with Format=Flowed unless absolutely necessary (e.g., 8-bit characters over a 7-bit transport). A message SHOULD NOT be Quoted-Printable encoded solely to protect trailing spaces unless the body is cryptographically signed or encrypted.

email

normative-requirement §4.2 SHOULD

When generating flowed text, lines SHOULD be 78 characters or fewer in length, counting trailing white space and any stuffing space, but not the CRLF. Words exceeding 78 characters SHOULD be sent as-is, exceeding the limit.

email

normative-requirement §4.2 MUST

When the newer soft-line-break insertion technique is used (inserting SP before CRLF), the DelSp parameter MUST be used and MUST be set to 'yes'. When the older technique is used, if DelSp is specified it MUST be set to 'no'.

email

protocol-element §4.1

A fixed line is any line that does not end in a space, or an empty line (just CRLF). Fixed lines are self-contained and not joined with adjacent lines during reflowing.

email

protocol-element §4.1

A flowed line is defined as a line that ends with a trailing space (SP) before the CRLF. The trailing space is the signal that the line continues logically into the next line. If DelSp=yes, that trailing space is logically deleted after parsing.

email

protocol-element §4.1

A paragraph is one or more flowed lines followed by one fixed line, where all lines must be either all unquoted or all quoted with the same quote depth. A series of flowed lines constitutes a logical unit eligible to be wrapped and joined for display.

email

protocol-element §4.3

A signature separator line is an optionally quoted, optionally stuffed line consisting of DASH DASH SP ('-- '). It is neither flowed nor fixed and must be transmitted as-is. Paragraphs must not end with a signature separator line.

email

protocol-element §4.4

Space-stuffing prepends a single SP to any generated line that begins with '>', 'From ', or SP, to prevent misinterpretation. On reception, if the first character is a space, it is logically deleted after the quote-mark test and before the flowed-line test.

email

protocol-element §4.5

The canonical quote indicator is one or more '>' characters at the start of a line. The count of '>' characters defines the quote depth. Space-stuffing means '>>' and '>> ' are semantically equivalent (both depth-2), but '> >' is depth-1 with content '> ...'.

email

protocol-element §4

The DelSp parameter for Text/Plain takes values 'Yes' or 'No' (case-insensitive). If absent or unrecognized, No is assumed. It is only defined for use with Format=Flowed and controls whether the trailing space that signals a soft line break is logically deleted on reception.

email

protocol-element §4

The Format parameter for Text/Plain takes values 'Fixed' or 'Flowed' (case-insensitive). If absent or unrecognized, Fixed is assumed. Format=Flowed indicates the flowed-text encoding defined by this specification was used on generation.

email

registry §9

IANA updated the Text/Plain Media Type registration to add a reference to this specification (RFC 3676), which defines the Format and DelSp parameters for that media type.

registry, email

security-consideration §4.6

OpenPGP (RFC 2440) ignores trailing whitespace when computing cleartext signatures, making it possible to silently add a Format=Flowed header and arbitrary trailing spaces to a signed Format=Fixed message in transit without detection. This would alter rendering for Format=Flowed-aware clients. Use of OpenPGP with Format=Flowed is strongly discouraged; OpenPGP/MIME is recommended instead.

email, security, crypto

security-consideration §4.6

Using Format=Flowed with digitally signed or encrypted messages may cause interoperability problems or security vulnerabilities, because flowed text may be altered (line breaks and trailing spaces added or removed) between composition and transmission or between reception and display, changing the text seen by cryptographic processors.

email, security, crypto

wire-format §4.2

A soft line break is encoded as SP CRLF. With the older technique (DelSp=no), the SP is an existing space in the text; with the newer technique (DelSp=yes), an SP is inserted before the CRLF. A hard line break is a bare CRLF with no preceding space.

email

wire-format §6

The ABNF defines flowed-body as zero or more paragraphs, fixed lines, and signature separators. A paragraph is '1*flowed-line fixed-line'. A flowed-line ends with 'flow = SP' before CRLF; stuffing is a leading SP added on generation and deleted on reception. The quote-mark is '>'.

email