1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781
|
<pre>Network Working Group R. Gellens, Editor
Request for Comments: 2646 Qualcomm
Updates: <a href="./rfc2046">2046</a> August 1999
Category: Standards Track
<span class="h1">The Text/Plain Format Parameter</span>
Status of this Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (1999). All Rights Reserved.
Table of Contents
<a href="#section-1">1</a>. Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-2">2</a>
<a href="#section-2">2</a>. Conventions Used in this Document . . . . . . . . . . . . . <a href="#page-2">2</a>
<a href="#section-3">3</a>. The Problem . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-2">2</a>
<a href="#section-3.1">3.1</a>. Paragraph Text . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-3.2">3.2</a>. Embarrassing Line Wrap . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-3.3">3.3</a>. New Media Types . . . . . . . . . . . . . . . . . . . . <a href="#page-4">4</a>
<a href="#section-4">4</a>. The Format Parameter to the Text/Plain Media Type . . . . . <a href="#page-4">4</a>
<a href="#section-4.1">4.1</a>. Generating Format=Flowed . . . . . . . . . . . . . . . <a href="#page-5">5</a>
<a href="#section-4.2">4.2</a>. Interpreting Format=Flowed . . . . . . . . . . . . . . . <a href="#page-6">6</a>
<a href="#section-4.3">4.3</a>. Usenet Signature Convention . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-4.4">4.4</a>. Space-Stuffing . . . . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-4.5">4.5</a>. Quoting . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-4.6">4.6</a>. Digital Signatures and Encryption . . . . . . . . . . . <a href="#page-9">9</a>
<a href="#section-4.7">4.7</a>. Line Analysis Table . . . . . . . . . . . . . . . . . . <a href="#page-10">10</a>
<a href="#section-4.8">4.8</a>. Examples . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-10">10</a>
<a href="#section-5">5</a>. ABNF . . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-11">11</a>
<a href="#section-6">6</a>. Failure Modes . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-11">11</a>
<a href="#section-6.1">6.1</a>. Trailing White Space Corruption . . . . . . . . . . . . <a href="#page-11">11</a>
<a href="#section-7">7</a>. Security Considerations . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-8">8</a>. IANA Considerations . . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-9">9</a>. Internationalization Considerations . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-10">10</a>. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-11">11</a>. References . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-13">13</a>
<a href="#section-12">12</a>. Editor's Address . . . . . . . . . . . . . . . . . . . . . <a href="#page-13">13</a>
<a href="#section-13">13</a>. Full Copyright Statement . . . . . . . . . . . . . . . . . . <a href="#page-14">14</a>
<span class="grey">Gellens Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Abstract</span>
Interoperability problems have been observed with erroneous labelling
of paragraph text as Text/Plain, and with various forms of
"embarrassing line wrap." (See <a href="#section-3">section 3</a>.)
Attempts to deploy new media types, such as Text/Enriched [<a href="#ref-RICH" title=""The text/enriched MIME Content-type"">RICH</a>] and
Text/HTML [<a href="#ref-HTML" title=""Hypertext Markup Language -- 2.0"">HTML</a>] have suffered from a lack of backwards compatibility
and an often hostile user reaction at the receiving end.
What is required is a format which is in all significant ways
Text/Plain, and therefore is quite suitable for display as
Text/Plain, and yet allows the sender to express to the receiver
which lines can be considered a logical paragraph, and thus flowed
(wrapped and joined) as appropriate.
This memo proposes a new parameter to be used with Text/Plain, and,
in the presence of this parameter, the use of trailing whitespace to
indicate flowed lines. This results in an encoding which appears as
normal Text/Plain in older implementations, since it is in fact
normal Text/Plain.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Conventions Used in this Document</span>
The key words "REQUIRED", "MUST", "MUST NOT", "SHOULD", "SHOULD NOT",
and "MAY" in this document are to be interpreted as described in "Key
words for use in RFCs to Indicate Requirement Levels" [<a href="#ref-KEYWORDS" title=""Key words for use in RFCs to Indicate Requirement Levels"">KEYWORDS</a>].
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. The Problem</span>
The Text/Plain media type is the lowest common denominator of
Internet email, with lines of no more than 997 characters (by
convention usually no more than 80), and where the CRLF sequence
represents a line break [<a href="#ref-MIME-IMT" title=""Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types"">MIME-IMT</a>].
Text/Plain is usually displayed as preformatted text, often in a
fixed font. That is, the characters start at the left margin of the
display window, and advance to the right until a CRLF sequence is
seen, at which point a new line is started, again at the left margin.
When a line length exceeds the display window, some clients will wrap
the line, while others invoke a horizontal scroll bar.
Text which meets this description is defined by this memo as "fixed".
Some interoperability problems have been observed with this media
type:
<span class="grey">Gellens Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. Paragraph Text</span>
Many modern programs use a proportional-spaced font and CRLF to
represent paragraph breaks. Line breaks are "soft", occurring as
needed on display. That is, characters are grouped into a paragraph
until a CRLF sequence is seen, at which point a new paragraph is
started. Each paragraph is displayed, starting at the left margin
(or paragraph indent), and continuing to the right until a word is
encountered which does not fit in the remaining display width. This
word is displayed at the left margin of the next line. This
continues until the paragraph ends (a CRLF is seen). Extra vertical
space is left between paragraphs.
Text which meets this description is defined by this memo as
"flowed".
Numerous software products erroneously label this media type as
Text/Plain, resulting in much user discomfort.
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>. Embarrassing Line Wrap</span>
As Text/Plain messages get quoted in replies or forwarded messages,
the length of each line gradually increases, resulting in
"embarrassing line wrap." This results in text which is at best hard
to read, and often confuses attributions.
Example:
>>>>>>This is a comment from the first message to show a
>quoting example.
>>>>>This is a comment from the second message to show a
>quoting example.
>>>>This is a comment from the third message.
>>>This is a comment from the fourth message.
It can be confusing to assign attribution to lines 2 and 4 above.
In addition, as devices with display widths smaller than 80
characters become more popular, embarrassing line wrap has become
even more prevalent, even with unquoted text.
<span class="grey">Gellens Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
Example:
This is paragraph text that is
meant to be flowed across
several lines.
However, the sending mailer is
converting it to fixed text at
a width of 72
characters, which causes it to
look like this when shown on a
PDA with only
30 character lines.
<span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a>. New Media Types</span>
Attempts to deploy new media types, such as Text/Enriched [<a href="#ref-RICH" title=""The text/enriched MIME Content-type"">RICH</a>] and
Text/HTML [<a href="#ref-HTML" title=""Hypertext Markup Language -- 2.0"">HTML</a>] have suffered from a lack of backwards compatibility
and an often hostile user reaction at the receiving end.
In particular, Text/Enriched requires that open angle brackets ("<")
and hard line breaks be doubled, with resulting user unhappiness when
viewed as Text/Plain. Text/HTML requires even more alteration of
text, with a corresponding increase in user complaints.
A proposal to define a new media type to explicitly represent the
paragraph form suffered from a lack of interoperability with
currently deployed software. Some programs treat unknown subtypes of
Text as an attachment.
What is desired is a format which is in all significant ways
Text/Plain, and therefore is quite suitable for display as
Text/Plain, and yet allows the sender to express to the receiver
which lines can be considered a logical paragraph, and thus flowed
(wrapped and joined) as appropriate.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. The Format Parameter to the Text/Plain Media Type</span>
This document defines a new MIME parameter for use with Text/Plain:
Name: Format
Value: Fixed, Flowed
(Neither the parameter name nor its value are case sensitive.)
If not specified, a value of Fixed is assumed. The semantics of the
Fixed value are the usual associated with Text/Plain [<a href="#ref-MIME-IMT" title=""Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types"">MIME-IMT</a>].
<span class="grey">Gellens Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
A value of Flowed indicates that the definition of flowed text (as
specified in this memo) was used on generation, and MAY be used on
reception.
This section discusses flowed text; <a href="#section-5">section 5</a> provides a formal
definition.
Because flowed lines are all-but-indistinguishable from fixed lines,
currently deployed software treats flowed lines as normal Text/Plain
(which is what they are). Thus, no interoperability problems are
expected.
Note that this memo describes an on-the-wire format. It does not
address formats for local file storage.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. Generating Format=Flowed</span>
When generating Format=Flowed text, lines SHOULD be shorter than 80
characters. As suggested values, any paragraph longer than 79
characters in total length could be wrapped using lines of 72 or
fewer characters. While the specific line length used is a matter of
aesthetics and preference, longer lines are more likely to require
rewrapping and to encounter difficulties with older mailers. It has
been suggested that 66 character lines are the most readable.
(The reason for the restriction to 79 or fewer characters between
CRLFs on the wire is to ensure that all lines, even when displayed by
a non-flowed-aware program, will fit in a standard 80-column screen
without having to be wrapped. The limit is 79, not 80, because while
80 fit on a line, the last column is often reserved for a line-wrap
indicator.)
When creating flowed text, the generating agent wraps, that is,
inserts 'soft' line breaks as needed. Soft line breaks are added
between words. Because a soft line break is a SP CRLF sequence, the
generating agent creates one by inserting a CRLF after the occurance
of a space.
A generating agent SHOULD NOT insert white space into a word (a
sequence of printable characters not containing spaces). If faced
with a word which exceeds 79 characters (but less than 998
characters, the [<a href="#ref-SMTP" title=""Simple Mail Transfer Protocol"">SMTP</a>] limit on line length), the agent SHOULD send
the word as is and exceed the 79-character limit on line length.
<span class="grey">Gellens Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
A generating agent SHOULD:
1. Ensure all lines (fixed and flowed) are 79 characters or
fewer in length, counting the trailing space but not
counting the CRLF, unless a word by itself exceeds 79
characters.
2. Trim spaces before user-inserted hard line breaks.
3. Space-stuff lines which start with a space, "From ", or
">".
In order to create messages which do not require space-stuffing, and
are thus more aesthetically pleasing when viewed as Format=Fixed, a
generating agent MAY avoid wrapping immediately before ">", "From ",
or space.
(See sections <a href="#section-4.4">4.4</a> and <a href="#section-4.5">4.5</a> for more information on space-stuffing and
quoting, respectively.)
A Format=Flowed message consists of zero or more paragraphs, each
containing one or more flowed lines followed by one fixed line. The
usual case is a series of flowed text lines with blank (empty) fixed
lines between them.
Any number of fixed lines can appear between paragraphs.
[<a id="ref-Quoted-Printable">Quoted-Printable</a>] encoding SHOULD NOT be used with Format=Flowed
unless absolutely necessary (for example, non-US-ASCII (8-bit)
characters over a strictly 7-bit transport such as unextended SMTP).
In particular, a message SHOULD NOT be encoded in Quoted-Printable
for the sole purpose of protecting the trailing space on flowed lines
unless the body part is cryptographically signed or encrypted (see
<a href="#section-4.6">Section 4.6</a>).
The intent of Format=Flowed is to allow user agents to generate
flowed text which is non-obnoxious when viewed as pure, raw
Text/Plain (without any decoding); use of Quoted-Printable hinders
this and may cause Format=Flowed to be rejected by end users.
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. Interpreting Format=Flowed</span>
If the first character of a line is a quote mark (">"), the line is
considered to be quoted (see <a href="#section-4.5">section 4.5</a>). Logically, all quote
marks are counted and deleted, resulting in a line with a non-zero
quote depth, and content. (The agent is of course free to display the
content with quote marks or excerpt bars or anything else.)
Logically, this test for quoted lines is done before any other tests
(that is, before checking for space-stuffed and flowed).
<span class="grey">Gellens Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
If the first character of a line is a space, the line has been
space-stuffed (see <a href="#section-4.4">section 4.4</a>). Logically, this leading space is
deleted before examining the line further (that is, before checking
for flowed).
If the line ends in one or more spaces, the line is flowed.
Otherwise it is fixed. Trailing spaces are part of the line's
content, but the CRLF of a soft line break is not.
A series of one or more flowed lines followed by one fixed line is
considered a paragraph, and MAY be flowed (wrapped and unwrapped) as
appropriate on display and in the construction of new messages (see
<a href="#section-4.5">section 4.5</a>).
A line consisting of one or more spaces (after deleting a stuffed
space) is considered a flowed line.
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a>. Usenet Signature Convention</span>
There is a convention in Usenet news of using "-- " as the separator
line between the body and the signature of a message. When
generating a Format=Flowed message containing a Usenet-style
separator before the signature, the separator line is sent as-is.
This is a special case; an (optionally quoted) line consisting of
DASH DASH SP is not considered flowed.
<span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a>. Space-Stuffing</span>
In order to allow for unquoted lines which start with ">", and to
protect against systems which "From-munge" in-transit messages
(modifying any line which starts with "From " to ">From "),
Format=Flowed provides for space-stuffing.
Space-stuffing adds a single space to the start of any line which
needs protection when the message is generated. On reception, if the
first character of a line is a space, it is logically deleted. This
occurs after the test for a quoted line, and before the test for a
flowed line.
On generation, any unquoted lines which start with ">", and any lines
which start with a space or "From " SHOULD be space-stuffed. Other
lines MAY be space-stuffed as desired.
(Note that space-stuffing is similar to dot-stuffing as specified in
[<a href="#ref-SMTP" title=""Simple Mail Transfer Protocol"">SMTP</a>].)
<span class="grey">Gellens Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
If a space-stuffed message is received by an agent which handles
Format=Flowed, the space-stuffing is reversed and thus the message
appears unchanged. An agent which is not aware of Format=Flowed will
of course not undo any space-stuffing, thus Format=Flowed messages
may appear with a leading space on some lines (those which start with
a space, ">" which is not a quote indicator, or "From "). Since
lines which require space-stuffing rarely occur, and the aesthetic
consequences of unreversed space-stuffing are minimal, this is not
expected to be a significant problem.
<span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a>. Quoting</span>
In Format=Flowed, the canonical quote indicator (or quote mark) is
one or more close angle bracket (">") characters. Lines which start
with the quote indicator are considered quoted. The number of ">"
characters at the start of the line specifies the quote depth.
Flowed lines which are also quoted may require special handling on
display and when copied to new messages.
When creating quoted flowed lines, each such line starts with the
quote indicator.
Note that because of space-stuffing, the lines
>> Exit, Stage Left
and
>>Exit, Stage Left
are semantically identical; both have a quote-depth of two, and a
content of "Exit, Stage Left".
However, the line
> > Exit, Stage Left
is different. It has a quote-depth of one, and a content of
"> Exit, Stage Left".
When generating quoted flowed lines, an agent needs to pay attention
to changes in quote depth. A sequence of quoted lines of the same
quote depth SHOULD be encoded as a paragraph, with the last line
generated as fixed and prior lines generated as flowed.
If a receiving agent wishes to reformat flowed quoted lines (joining
and/or wrapping them) on display or when generating new messages, the
lines SHOULD be de-quoted, reformatted, and then re-quoted. To
de-quote, the number of close angle brackets in the quote indicator
at the start of each line is counted. Consecutive lines with the
same quoting depth are considered one paragraph and are reformatted
together. To re-quote after reformatting, a quote indicator
containing the same number of close angle brackets originally present
is prefixed to each line.
<span class="grey">Gellens Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
On reception, if a change in quoting depth occurs on a flowed line,
this is an improperly formatted message. The receiver SHOULD handle
this error by using the 'quote-depth-wins' rule, which is to ignore
the flowed indicator and treat the line as fixed. That is, the
change in quote depth ends the paragraph.
For example, consider the following sequence of lines (using '*' to
indicate a soft line break, i.e., SP CRLF, and '#' to indicate a hard
line break, i.e., CRLF):
> Thou villainous ill-breeding spongy dizzy-eyed*
> reeky elf-skinned pigeon-egg!* <--- problem ---<
>> Thou artless swag-bellied milk-livered*
>> dismal-dreaming idle-headed scut!#
>>> Thou errant folly-fallen spleeny reeling-ripe*
>>> unmuzzled ratsbane!#
>>>> Henceforth, the coding style is to be strictly*
>>>> enforced, including the use of only upper case.#
>>>>> I've noticed a lack of adherence to the coding*
>>>>> styles, of late.#
>>>>>> Any complaints?#
The second line ends in a soft line break, even though it is the last
line of the one-deep quote block. The question then arises as to how
this line should be interpreted, considering that the next line is
the first line of the two-deep quote block.
The example text above, when processed according to quote-depth wins,
results in the first two lines being considered as one quoted, flowed
section, with a quote depth of 1; the third and fourth lines become a
quoted, flowed section, with a quote depth of 2.
A generating agent SHOULD NOT create this situation; a receiving
agent SHOULD handle it using quote-depth wins.
<span class="h3"><a class="selflink" id="section-4.6" href="#section-4.6">4.6</a>. Digital Signatures and Encryption</span>
If a message is digitally signed or encrypted it is important that
cryptographic processing use the on-the-wire Format=Flowed format.
That is, during generation the message SHOULD be prepared for
transmission, including addition of soft line breaks, space-stuffing,
and [<a href="#ref-Quoted-Printable" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">Quoted-Printable</a>] encoding (to protect soft line breaks) before
being digitally signed or encrypted; similarly, on receipt the
message SHOULD have the signature verified or be decrypted before
[<a href="#ref-Quoted-Printable" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">Quoted-Printable</a>] decoding and removal of stuffed spaces, soft line
breaks and quote marks, and reflowing.
<span class="grey">Gellens Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
<span class="h3"><a class="selflink" id="section-4.7" href="#section-4.7">4.7</a>. Line Analysis Table</span>
Lines contained in a Text/Plain body part with Format=Flowed can be
analyzed by examining the start and end of the line. If the line
starts with the quote indicator, it is quoted. If the line ends with
one or more space characters, it is flowed. This is summarized by
the following table:
Starts Ends in
with One or Line
Quote More Spaces Type
------ ----------- ---------------
no no unquoted, fixed
yes no quoted, fixed
no yes unquoted, flowed
yes yes quoted, flowed
<span class="h3"><a class="selflink" id="section-4.8" href="#section-4.8">4.8</a>. Examples</span>
The following example contains three paragraphs:
`Take some more tea,' the March Hare said to Alice, very
earnestly.
`I've had nothing yet,' Alice replied in an offended tone, `so I
can't take more.'
`You mean you can't take LESS,' said the Hatter: `it's very easy
to take MORE than nothing.'
This could be encoded as follows (using '*' to indicate a soft line
break, that is, SP CRLF sequence, and '#' to indicate a hard line
break, that is, CRLF):
`Take some more tea,' the March Hare said to Alice, very*
earnestly.*
#
`I've had nothing yet,' Alice replied in an offended tone, `so*
I can't take more.'*
#
`You mean you can't take LESS,' said the Hatter: `it's very*
easy to take MORE than nothing.'#
<span class="grey">Gellens Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
To show an example of quoting, here we have the same exchange,
presented as a series of direct quotes:
>>>Take some more tea.#
>>I've had nothing yet, so I can't take more.#
>You mean you can't take LESS, it's very easy to take*
>MORE than nothing.#
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. ABNF</span>
The constructs used in Text/Plain; Format=Flowed body parts are
described using [<a href="#ref-ABNF" title=""Augmented BNF for Syntax Specifications: ABNF"">ABNF</a>], including the Core Rules:
paragraph = 1*flowed-line fixed-line
fixed-line = fixed / sig-sep
fixed = [quote] [stuffing] *text-char non-sp CRLF
flowed-line = flow-qt / flow-unqt
flow-qt = quote [stuffing] *text-char 1*SP CRLF
flow-unqt = [stuffing] *text-char 1*SP CRLF
non-sp = %x01-09 / %x0B / %x0C / %x0E-1F / %x21-7F
; any 7-bit US-ASCII character, excluding
; NUL, CR, LF, and SP
quote = 1*">"
sig-sep = [quote] "--" SP CRLF
stuffing = [SP] ; space-stuffed, added on generation if
; needed, deleted on reception
text-char = non-sp / SP
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Failure Modes</span>
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. Trailing White Space Corruption</span>
There are systems in existence which alter trailing whitespace on
messages which pass through them. Such systems may strip, or in
rarer cases, add trailing whitespace, in violation of <a href="./rfc821">RFC 821</a> [<a href="#ref-SMTP" title=""Simple Mail Transfer Protocol"">SMTP</a>]
<a href="#section-4.5.2">section 4.5.2</a>.
Stripping trailing whitespace has the effect of converting flowed
lines to fixed lines, which results in a message no worse than if
Format=Flowed had not been used.
Adding trailing whitespace to a Format=Flowed message may result in a
malformed display or reply.
Since most systems which add trailing white space do so to create a
line which fills an internal record format, the result is almost
always a line which contains an even number of characters (counting
the added trailing white space).
<span class="grey">Gellens Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
One possible avoidance, therefore, would be to define Format=Flowed
lines to use either one or two trailing space characters to indicate
a flowed line, such that the total line length is odd. However,
considering the scarcity of such systems today, it is not worth the
added complexity.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
This parameter introduces no security considerations beyond those
which apply to Text/Plain.
<a href="#section-4.6">Section 4.6</a> discusses the interaction between Format=Flowed and
digital signatures or encryption.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. IANA Considerations</span>
IANA is requested to add a reference to this specification in the
Text/Plain Media Type registration.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. Internationalization Considerations</span>
The line wrap and quoting specifications of Format=Flowed may not be
suitable for certain charsets, such as for Arabic and Hebrew
characters that read from right to left. Care should be taken in
applying format=flowed in these cases, as format=fixed combined with
quoted-printable encoding may be more suitable.
<span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. Acknowledgments</span>
This proposal evolved from a discussion of Chris Newman's
Text/Paragraph draft which took place on the IETF 822 mailing list.
Special thanks to Ian Bell, Steve Dorner, Brian Kelley, Dan Kohn,
Laurence Lundblade, and Dan Wing for their reviews, comments,
suggestions, and discussions.
<span class="h2"><a class="selflink" id="section-11" href="#section-11">11</a>. References</span>
[<a id="ref-ABNF">ABNF</a>] Crocker, D. and P. Overell, "Augmented BNF for
Syntax Specifications: ABNF", <a href="./rfc2234">RFC 2234</a>, November
1997.
[<a id="ref-KEYWORDS">KEYWORDS</a>] S. Bradner, "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RICH">RICH</a>] Resnick, P. and A. Walker, "The text/enriched MIME
Content-type", <a href="./rfc1896">RFC 1896</a>, February 1996.
<span class="grey">Gellens Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
[<a id="ref-MIME-IMT">MIME-IMT</a>] Freed, N. and N. Borenstein, "Multipurpose
Internet Mail Extensions (MIME) Part Two: Media
Types", <a href="./rfc2046">RFC 2046</a>, November 1996.
[<a id="ref-Quoted-Printable">Quoted-Printable</a>] Freed, N. and N. Borenstein, "Multipurpose
Internet Mail Extensions (MIME) Part One: Format
of Internet Message Bodies", <a href="./rfc2045">RFC 2045</a>, November
1996.
[<a id="ref-SMTP">SMTP</a>] Postel, J., "Simple Mail Transfer Protocol", STD
10, <a href="./rfc821">RFC 821</a>, August 1982.
[<a id="ref-HTML">HTML</a>] Berners-Lee, T. and D. Connolly, "Hypertext Markup
Language -- 2.0", <a href="./rfc1866">RFC 1866</a>, November 1995.
<span class="h2"><a class="selflink" id="section-12" href="#section-12">12</a>. Editor's Address</span>
Randall Gellens
QUALCOMM Incorporated
5775 Morehouse Dr.
San Diego, CA 92121-2779
USA
Phone: +1 619 651 5115
EMail: randy@qualcomm.com
<span class="grey">Gellens Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc2646">RFC 2646</a> The Text/Plain Format Parameter August 1999</span>
<span class="h2"><a class="selflink" id="section-13" href="#section-13">13</a>. Full Copyright Statement</span>
Copyright (C) The Internet Society (1999). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Gellens Standards Track [Page 14]
</pre>
|