rfc3676.txt 41KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124
  1. Network Working Group R. Gellens
  2. Request for Comments: 3676 Qualcomm
  3. Obsoletes: 2646 February 2004
  4. Category: Standards Track
  5. The Text/Plain Format and DelSp Parameters
  6. Status of this Memo
  7. This document specifies an Internet standards track protocol for the
  8. Internet community, and requests discussion and suggestions for
  9. improvements. Please refer to the current edition of the "Internet
  10. Official Protocol Standards" (STD 1) for the standardization state
  11. and status of this protocol. Distribution of this memo is unlimited.
  12. Copyright Notice
  13. Copyright (C) The Internet Society (2004). All Rights Reserved.
  14. Abstract
  15. This specification establishes two parameters (Format and DelSP) to
  16. be used with the Text/Plain media type. In the presence of these
  17. parameters, trailing whitespace is used to indicate flowed lines and
  18. a canonical quote indicator is used to indicate quoted lines. This
  19. results in an encoding which appears as normal Text/Plain in older
  20. implementations, since it is in fact normal Text/Plain, yet provides
  21. for superior wrapping/flowing, and quoting.
  22. This document supersedes the one specified in RFC 2646, "The
  23. Text/Plain Format Parameter", and adds the DelSp parameter to
  24. accommodate languages/coded character sets in which ASCII spaces are
  25. not used or appear rarely.
  26. Table of Contents
  27. 1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . 2
  28. 2. Conventions Used in this Document . . . . . . . . . . . . . . 2
  29. 3. The Problem . . . . . . . . . . . . . . . . . . . . . . . . . 3
  30. 3.1. Paragraph Text. . . . . . . . . . . . . . . . . . . . . 3
  31. 3.2. Embarrassing Line Wrap . . . . . . . . . . . . . . . . 3
  32. 3.3. New Media Types . . . . . . . . . . . . . . . . . . . . 4
  33. 4. The Format and DelSp Parameters . . . . . . . . . . . . . . . 5
  34. 4.1. Interpreting Format=Flowed. . . . . . . . . . . . . . . 6
  35. 4.2. Generating Format=Flowed . . . . . . . . . . . . . . . 7
  36. 4.3. Usenet Signature Convention . . . . . . . . . . . . . . 9
  37. 4.4. Space-Stuffing . . . . . . . . . . . . . . . . . . . . 9
  38. Gellens Standards Track [Page 1]
  39. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  40. 4.5. Quoting . . . . . . . . . . . . . . . . . . . . . . . . 9
  41. 4.6. Digital Signatures and Encryption . . . . . . . . . . . 11
  42. 4.7. Examples. . . . . . . . . . . . . . . . . . . . . . . . 12
  43. 5. Interoperability. . . . . . . . . . . . . . . . . . . . . . . 12
  44. 6. ABNF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
  45. 7. Failure Modes . . . . . . . . . . . . . . . . . . . . . . . . 14
  46. 7.1. Trailing White Space Corruption . . . . . . . . . . . . 14
  47. 8. Security Considerations . . . . . . . . . . . . . . . . . . . 15
  48. 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15
  49. 10. Internationalization Considerations . . . . . . . . . . . . . 15
  50. 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 15
  51. 12. Normative References. . . . . . . . . . . . . . . . . . . . . 16
  52. 13. Informative References. . . . . . . . . . . . . . . . . . . . 16
  53. Appendix A: Changes from RFC 2646 . . . . . . . . . . . . . . . . 18
  54. Author's Address. . . . . . . . . . . . . . . . . . . . . . . . . 19
  55. Full Copyright Statement. . . . . . . . . . . . . . . . . . . . . 20
  56. 1. Introduction
  57. Interoperability problems have been observed with erroneous labelling
  58. of paragraph text as Text/Plain, and with various forms of
  59. "embarrassing line wrap". (See Section 3.)
  60. Attempts to deploy new media types, such as Text/Enriched [Rich] and
  61. Text/HTML [HTML] have suffered from a lack of backwards compatibility
  62. and an often hostile user reaction at the receiving end.
  63. What is required is a format which is in all significant ways
  64. Text/Plain, and therefore is quite suitable for display as
  65. Text/Plain, and yet allows the sender to express to the receiver
  66. which lines are quoted and which lines are considered a logical
  67. paragraph, and thus eligible to be flowed (wrapped and joined) as
  68. appropriate.
  69. 2. Conventions Used in this Document
  70. The key words "REQUIRED", "MUST", "MUST NOT", "SHOULD", "SHOULD NOT",
  71. and "MAY" in this document are to be interpreted as described in "Key
  72. words for use in RFCs to Indicate Requirement Levels" [KEYWORDS].
  73. The term "paragraph" is used here to mean a series of lines which are
  74. logically to be treated as a unit for display purposes and eligible
  75. to be flowed (wrapped and joined) as appropriate to fit in the
  76. display window and when creating text for replies, forwarding, etc.
  77. Gellens Standards Track [Page 2]
  78. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  79. 3. The Problem
  80. The Text/Plain media type is the lowest common denominator of
  81. Internet email, with lines of no more than 998 characters (by
  82. convention usually no more than 78), and where the carriage-return
  83. and line-feed (CRLF) sequence represents a line break (see [MIME-IMT]
  84. and [MSG-FMT]).
  85. Text/Plain is usually displayed as preformatted text, often in a
  86. fixed font. That is, the characters start at the left margin of the
  87. display window, and advance to the right until a CRLF sequence is
  88. seen, at which point a new line is started, again at the left margin.
  89. When a line length exceeds the display window, some clients will wrap
  90. the line, while others invoke a horizontal scroll bar.
  91. Text which meets this description is defined by this memo as "fixed".
  92. Some interoperability problems have been observed with this format:
  93. 3.1. Paragraph Text
  94. Many modern programs use a proportional-spaced font, and use CRLF to
  95. represent paragraph breaks. Line breaks are "soft", occurring as
  96. needed on display. That is, characters are grouped into a paragraph
  97. until a CRLF sequence is seen, at which point a new paragraph is
  98. started. Each paragraph is displayed, starting at the left margin
  99. (or paragraph indent), and continuing to the right until a word is
  100. encountered which does not fit in the remaining display width. This
  101. word is displayed at the left margin of the next line. This
  102. continues until the paragraph ends (a CRLF is seen). Extra vertical
  103. space is left between paragraphs.
  104. Text which meets this description is defined by this memo as
  105. "flowed".
  106. Numerous software products erroneously label this format as
  107. Text/Plain, resulting in much user discomfort.
  108. 3.2. Embarrassing Line Wrap
  109. As Text/Plain messages are quoted in replies or forwarded messages,
  110. each line gradually increases in length, eventually being arbitrarily
  111. hard wrapped, resulting in "embarrassing line wrap". This produces
  112. text which is, at best, hard to read, and often confuses
  113. attributions.
  114. Gellens Standards Track [Page 3]
  115. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  116. Example:
  117. >>>>>>This is a comment from the first message to show a
  118. >quoting example.
  119. >>>>>This is a comment from the second message to show a
  120. >quoting example.
  121. >>>>This is a comment from the third message.
  122. >>>This is a comment from the fourth message.
  123. It can be confusing to assign attribution to lines 2 and 4 above.
  124. In addition, as devices with display widths smaller than 79 or 80
  125. characters become more popular, embarrassing line wrap has become
  126. even more prevalent, even with unquoted text.
  127. Example:
  128. This is paragraph text that is
  129. meant to be flowed across
  130. several lines.
  131. However, the sending mailer is
  132. converting it to fixed text at
  133. a width of 72
  134. characters, which causes it to
  135. look like this when shown on a
  136. PDA with only
  137. 30 character lines.
  138. 3.3. New Media Types
  139. Attempts to deploy new media types, such as Text/Enriched [Rich] and
  140. Text/HTML [HTML] have suffered from a lack of backwards compatibility
  141. and an often hostile user reaction at the receiving end.
  142. In particular, Text/Enriched requires that open angle brackets ("<")
  143. and hard line breaks be doubled, with resulting user unhappiness when
  144. viewed as Text/Plain. Text/HTML requires even more alteration of
  145. text, with a corresponding increase in user complaints.
  146. A proposal to define a new media type to explicitly represent the
  147. paragraph form suffered from a lack of interoperability with
  148. currently deployed software. Some programs treat unknown subtypes of
  149. TEXT as an attachment.
  150. Gellens Standards Track [Page 4]
  151. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  152. What is desired is a format which is in all significant ways
  153. Text/Plain, and therefore is quite suitable for display as
  154. Text/Plain, and yet allows the sender to express to the receiver
  155. which lines can be considered a logical paragraph, and thus flowed
  156. (wrapped and joined) as appropriate.
  157. 4. The Format and DelSp Parameters
  158. This specification defines two MIME parameters for use with
  159. Text/Plain:
  160. Name: Format
  161. Value: Fixed, Flowed
  162. Name: DelSp
  163. Value: Yes, No
  164. (Neither the parameter names nor values are case sensitive.)
  165. If Format is not specified, or if the value is not recognized, a
  166. value of Fixed is assumed. The semantics of the Fixed value are the
  167. usual associated with Text/Plain [MIME-IMT].
  168. A Format value of Flowed indicates that the definition of flowed text
  169. (as specified in this memo) was used on generation, and MAY be used
  170. on reception.
  171. Note that because Format is a parameter of the Text/Plain content-
  172. type, any content-transfer-encoding used is irrelevant to the
  173. processing of flowed text.
  174. If DelSp is not specified, or if its value is not recognized, a value
  175. of No is assumed. The use of DelSp without a Format value of Flowed
  176. is undefined. When creating messages, DelSp SHOULD NOT be specified
  177. in Text content types other than Text/Plain with Format = Flowed.
  178. When receiving messages, DelSp SHOULD be ignored if used in a Text
  179. content type other than Text/Plain with Format = Flowed.
  180. This section discusses flowed text; section 6 provides a formal
  181. definition.
  182. Section 5 discusses interoperability.
  183. Note that this memo describes an on-the-wire format. It does not
  184. address formats for local file storage.
  185. Gellens Standards Track [Page 5]
  186. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  187. 4.1. Interpreting Format=Flowed
  188. If the first character of a line is a quote mark (">"), the line is
  189. considered to be quoted (see Section 4.5). Logically, all quote
  190. marks are counted and deleted, resulting in a line with a non-zero
  191. quote depth, and content. (The agent is of course free to display
  192. the content with quote marks or excerpt bars or anything else.)
  193. Logically, this test for quoted lines is done before any other tests
  194. (that is, before checking for space-stuffed and flowed).
  195. If the first character of a line is a space, the line has been
  196. space-stuffed (see Section 4.4). Logically, this leading space is
  197. deleted before examining the line further (that is, before checking
  198. for flowed).
  199. If the line ends in a space, the line is flowed. Otherwise it is
  200. fixed. The exception to this rule is a signature separator line,
  201. described in Section 4.3. Such lines end in a space but are neither
  202. flowed nor fixed.
  203. If the line is flowed and DelSp is "yes", the trailing space
  204. immediately prior to the line's CRLF is logically deleted. If the
  205. DelSp parameter is "no" (or not specified, or set to an unrecognized
  206. value), the trailing space is not deleted.
  207. Any remaining trailing spaces are part of the line's content, but the
  208. CRLF of a soft line break is not.
  209. A series of one or more flowed lines followed by one fixed line is
  210. considered a paragraph, and MAY be flowed (wrapped and unwrapped) as
  211. appropriate on display and in the construction of new messages (see
  212. Section 4.5).
  213. An interpreting agent SHOULD allow for three exceptions to the rule
  214. that paragraphs end with a fixed line. These exceptions are
  215. improperly constructed messages: a flowed line SHOULD be considered
  216. to end the paragraph if it is followed by a line of a different quote
  217. depth (see 4.5) or by a signature separator (see 4.3); the end of the
  218. body also ends the paragraph.
  219. A line consisting of one or more spaces (after deleting a space
  220. acting as stuffing) is considered a flowed line.
  221. An empty line (just a CRLF) is a fixed line.
  222. Note that, for Unicode text, [Annex-14] provides guidance for
  223. choosing at which characters to wrap a line.
  224. Gellens Standards Track [Page 6]
  225. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  226. 4.2. Generating Format=Flowed
  227. When generating Format=Flowed text, lines SHOULD be 78 characters or
  228. shorter, including any trailing white space and also including any
  229. space added as part of stuffing (see Section 4.4). As suggested
  230. values, any paragraph longer than 78 characters in total length could
  231. be wrapped using lines of 72 or fewer characters. While the specific
  232. line length used is a matter of aesthetics and preference, longer
  233. lines are more likely to require rewrapping and to encounter
  234. difficulties with older mailers. (It has been suggested that 66
  235. character lines are the most readable.)
  236. The restriction to 78 or fewer characters between CRLFs on the wire
  237. is to conform to [MSG-FMT].
  238. (In addition to conformance to [MSG-FMT], there is a historical need
  239. that all lines, even when displayed by a non-flowed-aware program,
  240. will fit in a standard 79- or 80-column screen without having to be
  241. wrapped. The limit is 78, not 79 or 80, because while 79 or 80 fit
  242. on a line, the last column is often reserved for a line-wrap
  243. indicator.)
  244. When creating flowed text, the generating agent wraps, that is,
  245. inserts 'soft' line breaks as needed. Soft line breaks are added at
  246. natural wrapping points, such as between words. A soft line break is
  247. a SP CRLF sequence.
  248. There are two techniques for inserting soft line breaks. The older
  249. technique, established by RFC 2646, creates a soft line break by
  250. inserting a CRLF after the occurrence of a space. With this
  251. technique, soft line breaks are only possible where spaces already
  252. occur. When this technique is used, the DelSp parameter SHOULD be
  253. used; if used it MUST be set to "no".
  254. The newer technique, suitable for use even with languages/coded
  255. character sets in which the ASCII space character is rare or not
  256. used, creates a soft line break by inserting a SP CRLF sequence.
  257. When this technique is used, the DelSp parameter MUST be used and
  258. MUST be set to "yes". Note that because of space-stuffing (see
  259. Section 4.4), when this technique is used and a soft line break is
  260. inserted at a point where a SP already exists (such as between
  261. words), if the SP CRLF sequence is added immediately before the SP,
  262. the pre-existing SP becomes leading and thus requires stuffing. It
  263. is RECOMMENDED that agents avoid this by inserting the SP CRLF
  264. sequence following the existing SP.
  265. Generating agents MAY use either method within each Text/Plain body
  266. part.
  267. Gellens Standards Track [Page 7]
  268. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  269. Regardless of which technique is used, a generating agent SHOULD NOT
  270. insert a space in an unnatural location, such as into a word (a
  271. sequence of printable characters, not containing spaces, in a
  272. language/coded character set in which spaces are common). If faced
  273. with such a word which exceeds 78 characters (but less than 998
  274. characters, the [SMTP] limit on line length), the agent SHOULD send
  275. the word as is and exceed the 78-character limit on line length.
  276. A generating agent SHOULD:
  277. o Ensure all lines (fixed and flowed) are 78 characters or fewer in
  278. length, counting any trailing space as well as a space added as
  279. stuffing, but not counting the CRLF, unless a word by itself
  280. exceeds 78 characters.
  281. o Trim spaces before user-inserted hard line breaks.
  282. A generating agent MUST:
  283. o Space-stuff lines which start with a space, "From ", or ">".
  284. In order to create messages which do not require space-stuffing, and
  285. are thus more aesthetically pleasing when viewed as Format=Fixed, a
  286. generating agent MAY avoid wrapping immediately before ">", "From ",
  287. or space.
  288. (See Sections 4.4 and 4.5 for more information on space-stuffing and
  289. quoting, respectively.)
  290. A Format=Flowed message consists of zero or more paragraphs, each
  291. containing one or more flowed lines followed by one fixed line. The
  292. usual case is a series of flowed text lines with blank (empty) fixed
  293. lines between them.
  294. Any number of fixed lines can appear between paragraphs.
  295. When placing soft line breaks in a paragraph, generating agents MUST
  296. NOT place them in a way that causes any line of the paragraph to be a
  297. signature separator line, because paragraphs cannot contain signature
  298. separator lines (see Sections 4.3 and 6).
  299. [Quoted-Printable] encoding SHOULD NOT be used with Format=Flowed
  300. unless absolutely necessary (for example, non-US-ASCII (8-bit)
  301. characters over a strictly 7-bit transport such as unextended
  302. [SMTP]). In particular, a message SHOULD NOT be encoded in Quoted-
  303. Printable for the sole purpose of protecting the trailing space on
  304. flowed lines unless the body part is cryptographically signed or
  305. encrypted (see Section 4.6).
  306. Gellens Standards Track [Page 8]
  307. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  308. The intent of Format=Flowed is to allow user agents to generate
  309. flowed text which is non-obnoxious when viewed as pure, raw
  310. Text/Plain (without any decoding); use of Quoted-Printable hinders
  311. this and may cause Format=Flowed to be rejected by end users.
  312. 4.3. Usenet Signature Convention
  313. There is a long-standing convention in Usenet news which also
  314. commonly appears in Internet mail of using "-- " as the separator
  315. line between the body and the signature of a message. When
  316. generating a Format=Flowed message containing a Usenet-style
  317. separator before the signature, the separator line is sent as-is.
  318. This is a special case; an (optionally quoted or quoted and stuffed)
  319. line consisting of DASH DASH SP is neither fixed nor flowed.
  320. Generating agents MUST NOT end a paragraph with such a signature
  321. line.
  322. A receiving agent needs to test for a signature line both before the
  323. test for a quoted line (see Section 4.5) and also after logically
  324. counting and deleting quote marks and stuffing (see Section 4.4) from
  325. a quoted line.
  326. 4.4. Space-Stuffing
  327. In order to allow for unquoted lines which start with ">", and to
  328. protect against systems which "From-munge" in-transit messages
  329. (modifying any line which starts with "From " to ">From "),
  330. Format=Flowed provides for space-stuffing.
  331. Space-stuffing adds a single space to the start of any line which
  332. needs protection when the message is generated. On reception, if the
  333. first character of a line is a space, it is logically deleted. This
  334. occurs after the test for a quoted line (which logically counts and
  335. deletes any quote marks), and before the test for a flowed line.
  336. On generation, any unquoted lines which start with ">", and any lines
  337. which start with a space or "From " MUST be space-stuffed. Other
  338. lines MAY be space-stuffed as desired.
  339. (Note that space-stuffing is conceptually similar to dot-stuffing as
  340. specified in [SMTP].)
  341. 4.5. Quoting
  342. In Format=Flowed, the canonical quote indicator (or quote mark) is
  343. one or more close angle bracket (">") characters. Lines which start
  344. with the quote indicator are considered quoted. The number of ">"
  345. Gellens Standards Track [Page 9]
  346. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  347. characters at the start of the line specifies the quote depth.
  348. Flowed lines which are also quoted may require special handling on
  349. display and when copied to new messages.
  350. When creating quoted flowed lines, each such line starts with the
  351. quote indicator.
  352. Note that because of space-stuffing, the lines
  353. >> Exit, Stage Left
  354. and
  355. >>Exit, Stage Left
  356. are semantically identical; both have a quote-depth of two, and a
  357. content of "Exit, Stage Left".
  358. However, the line
  359. > > Exit, Stage Left
  360. is different. It has a quote-depth of one, and a content of
  361. "> Exit, Stage Left".
  362. When generating quoted flowed lines, an agent needs to pay attention
  363. to changes in quote depth. All lines of a paragraph MUST be
  364. unquoted, or else they MUST all be quoted and have the same quote
  365. depth. Therefore, whenever there is a change in quote depth, or a
  366. change from quoted to unquoted, or change from unquoted to quoted,
  367. the line immediately preceding the change MUST NOT be a flowed line.
  368. If a receiving agent wishes to reformat flowed quoted lines (joining
  369. and/or wrapping them) on display or when generating new messages, the
  370. lines SHOULD be de-quoted, reformatted, and then re-quoted. To de-
  371. quote, the number of close angle brackets in the quote indicator at
  372. the start of each line is counted. To re-quote after reformatting, a
  373. quote indicator containing the same number of close angle brackets
  374. originally present are prefixed to each line.
  375. On reception, if a change in quote depth occurs on a flowed line,
  376. this is an improperly formatted message. The receiver SHOULD handle
  377. this error by using the 'quote-depth-wins' rule, which is to consider
  378. the paragraph to end with the flowed line immediately preceding the
  379. change in quote depth.
  380. In other words, whenever two adjacent lines have different quote
  381. depths, senders MUST ensure that the earlier line is not flowed (does
  382. not end in a space), and receivers finding a flowed line there SHOULD
  383. treat it as the last line of a paragraph.
  384. For example, consider the following sequence of lines (using '*' to
  385. indicate a soft line break, i.e., SP CRLF, and '#' to indicate a hard
  386. line break, i.e., CRLF):
  387. Gellens Standards Track [Page 10]
  388. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  389. > Thou villainous ill-breeding spongy dizzy-eyed*
  390. > reeky elf-skinned pigeon-egg!* <--- problem ---<
  391. >> Thou artless swag-bellied milk-livered*
  392. >> dismal-dreaming idle-headed scut!#
  393. >>> Thou errant folly-fallen spleeny reeling-ripe*
  394. >>> unmuzzled ratsbane!#
  395. >>>> Henceforth, the coding style is to be strictly*
  396. >>>> enforced, including the use of only upper case.#
  397. >>>>> I've noticed a lack of adherence to the coding*
  398. >>>>> styles, of late.#
  399. >>>>>> Any complaints?#
  400. The second line ends in a soft line break, even though it is the last
  401. line of the one-deep quote block. The question then arises as to how
  402. this line is to be interpreted, considering that the next line is the
  403. first line of the two-deep quote block.
  404. The example text above, when processed according to quote-depth wins,
  405. results in the first two lines being considered as one quoted, flowed
  406. section, with a quote depth of 1; the third and fourth lines become a
  407. quoted, flowed section, with a quote depth of 2.
  408. A generating agent MUST NOT create this situation; a receiving agent
  409. SHOULD handle it by giving preference to the quote depth.
  410. 4.6. Digital Signatures and Encryption
  411. If a message is digitally signed or encrypted it is important that
  412. cryptographic processing use the same text for signature verification
  413. and/or decryption as was used for signature generation and/or
  414. encryption. Since the use of format=flowed allows text to be altered
  415. (by adding or removing line breaks and trailing spaces) between
  416. composition and transmission, and between reception and display,
  417. interoperability problems or security vulnerabilities may arise if
  418. originator and recipient do not both use the on-the-wire format for
  419. cryptographic processing.
  420. The implications of the interaction between format=flowed and any
  421. specific cryptographic process depend on the details of the
  422. cryptographic processing and should be understood before using
  423. format=flowed in conjunction with signed and/or encrypted messages.
  424. Note that [OpenPGP] specifies (in Section 7.1) that "any trailing
  425. whitespace (spaces, and tabs, 0x09) at the end of any line is ignored
  426. when the cleartext signature is calculated."
  427. Gellens Standards Track [Page 11]
  428. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  429. Thus it would be possible to add, in transit, a format=flowed header
  430. to a regular, format=fixed vanilla PGP (not [OpenPGP-MIME]) signed
  431. message and add arbitrary trailing space characters without this
  432. addition being detected. This would change the rendering of the
  433. article by a client which supported format=flowed.
  434. Therefore, the use of [OpenPGP] with format=flowed messages is
  435. strongly discouraged. [OpenPGP-MIME] is recommended instead.
  436. 4.7. Examples
  437. The following example contains three paragraphs:
  438. `Take some more tea,' the March Hare said to Alice, very
  439. earnestly.
  440. `I've had nothing yet,' Alice replied in an offended tone, `so I
  441. can't take more.'
  442. `You mean you can't take LESS,' said the Hatter: `it's very easy
  443. to take MORE than nothing.'
  444. This could be encoded as follows (using '*' to indicate a soft line
  445. break, that is, SP CRLF sequence, and '#' to indicate a hard line
  446. break, that is, CRLF):
  447. `Take some more tea,' the March Hare said to Alice, very*
  448. earnestly.#
  449. #
  450. `I've had nothing yet,' Alice replied in an offended tone, `so*
  451. I can't take more.'#
  452. #
  453. `You mean you can't take LESS,' said the Hatter: `it's very*
  454. easy to take MORE than nothing.'#
  455. To show an example of quoting, here we have the same exchange,
  456. presented as a series of direct quotes:
  457. >>>Take some more tea.#
  458. >>I've had nothing yet, so I can't take more.#
  459. >You mean you can't take LESS, it's very easy to take*
  460. >MORE than nothing.#
  461. 5. Interoperability
  462. Because flowed lines are all-but-indistinguishable from fixed lines,
  463. software which does not recognize Format=Flowed treats flowed lines
  464. as normal Text/Plain (which is what they are). Thus, Format=Flowed
  465. Gellens Standards Track [Page 12]
  466. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  467. interoperates with older clients, although flowed lines will have
  468. trailing white space inserted.
  469. If a space-stuffed message is received by an agent which handles
  470. Format=Flowed, the space-stuffing is reversed and thus the message
  471. appears unchanged. An agent which is not aware of Format=Flowed will
  472. of course not undo any space-stuffing; thus Format=Flowed messages
  473. may appear with a leading space on some lines (those which start with
  474. a space, ">" which is not a quote indicator, or "From "). Since
  475. lines which require space-stuffing rarely occur, and the aesthetic
  476. consequences of unreversed space-stuffing are minimal, this is not
  477. expected to be a significant problem.
  478. If some lines begin with one or more spaces, the generating agent MAY
  479. space-stuff all lines, to maintain the relative indentation of the
  480. lines when viewed by clients which are not aware of Format=Flowed.
  481. Messages generated with DelSp=yes and received by clients which are
  482. aware of Format=Flowed but are not aware of the DelSp parameter will
  483. have an extra space remaining after removal of soft line breaks.
  484. Thus, when generating text in languages/coded character sets in which
  485. spaces are common, the generating agent MAY always use the DelSp=no
  486. method.
  487. Hand-aligned text, such as ASCII tables or art, source code, etc.,
  488. SHOULD be sent as fixed, not flowed lines.
  489. 6. ABNF
  490. The constructs used in Text/Plain; Format=Flowed body parts are
  491. described using Augmented Backus-Naur Form [ABNF], including the core
  492. rules defined in Appendix A.
  493. Note that the SP (space) and ">" characters are encoded according to
  494. the charset parameter.
  495. flowed-body = *( paragraph / fixed-line / sig-sep )
  496. paragraph = 1*flowed-line fixed-line
  497. ; all lines in paragraph MUST be unquoted or
  498. ; have same quote depth
  499. flowed-line = ( flowed-line-qt / flowed-line-unqt ) flow CRLF
  500. flowed-line-qt = quote ( ( stuffing stuffed-flowed ) /
  501. unstuffed-flowed )
  502. flowed-line-unqt = ( stuffing stuffed-flowed ) / unstuffed-flowed
  503. stuffed-flowed = *text-char
  504. unstuffed-flowed = non-sp-quote *text-char
  505. fixed-line = fixed-line-qt / fixed-line-unqt
  506. fixed-line-qt = quote ( ( stuffing stuffed-fixed ) /
  507. Gellens Standards Track [Page 13]
  508. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  509. unstuffed-fixed ) CRLF
  510. fixed-line-unqt = ( stuffed-fixed / unstuffed-fixed ) CRLF
  511. stuffed-fixed = *text-char non-sp
  512. unstuffed-fixed = non-sp-quote [ *text-char non-sp ]
  513. sig-sep = [ quote [stuffing] ] "--" SP CRLF
  514. quote-mark = ">"
  515. quote = 1*quote-mark
  516. stuffing = SP ; space-stuffed, added on generation if
  517. ; needed, deleted on reception
  518. flow = SP ; space before CRLF indicates flowed line,
  519. ; if DelSp=yes, space was added on generation
  520. ; and is deleted on reception
  521. non-sp-quote = < any character except NUL, CR, LF, SP, quote-mark >
  522. non-sp = non-sp-quote / quote-mark
  523. text-char = non-sp / SP
  524. That is, a Format=Flowed message body consists of any number of
  525. paragraphs and/or fixed lines and/or signature separator lines;
  526. paragraphs need at least one flowed line and are terminated by a
  527. fixed line; the fixed line terminating the paragraph is part of the
  528. paragraph. (There are some exceptions to this described in the
  529. text.)
  530. Without at least one flowed line, there is a series of fixed lines,
  531. each independent. There is no paragraph.
  532. With at least one flowed line, there is a paragraph, and the received
  533. lines can be reformed and flowed to fit the display window size.
  534. This can only be done if the lines are part of a logical grouping,
  535. the paragraph.
  536. Note that the definitions of flowed-line and sig-sep are potentially
  537. ambiguous: a signature separator line matches both, but is treated as
  538. a signature separator line and not a flowed line.
  539. 7. Failure Modes
  540. 7.1. Trailing White Space Corruption
  541. There are systems in existence which alter trailing whitespace on
  542. messages which pass through them. Such systems may strip, or in
  543. rarer cases, add trailing whitespace, in violation of RFC 2821 [SMTP]
  544. Section 4.5.2.
  545. Stripping trailing whitespace has the effect of converting flowed
  546. lines to fixed lines, which results in a message no worse than if
  547. Format=Flowed had not been used.
  548. Gellens Standards Track [Page 14]
  549. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  550. Adding trailing whitespace to a Format=Flowed message may result in a
  551. malformed display or reply.
  552. Since most systems which add trailing white space do so to create a
  553. line which fills an internal record format, the result is almost
  554. always a line which contains an even number of characters (counting
  555. the added trailing white space).
  556. One possible avoidance, therefore, would be to define Format=Flowed
  557. lines to use either one or two trailing space characters to indicate
  558. a flowed line, such that the total line length is odd. However,
  559. considering the scarcity of such systems today, it is not worth the
  560. added complexity.
  561. 8. Security Considerations
  562. Any security considerations which apply to Text/Plain also apply to
  563. Text/Plain with Format=Flowed.
  564. Section 4.6 discusses the interaction between Format=Flowed and
  565. digital signatures or encryption.
  566. 9. IANA Considerations
  567. IANA has added a reference to this specification in the Text/Plain
  568. Media Type registration.
  569. 10. Internationalization Considerations
  570. The line wrap and quoting specifications of Format=Flowed may not be
  571. suitable for certain charsets, such as for Arabic and Hebrew
  572. characters that read from right to left. Care needs to be taken in
  573. applying format=flowed in these cases, as format=fixed combined with
  574. [quoted-printable] encoding may be more suitable.
  575. The DelSp parameter was added specifically to permit Format=Flowed to
  576. be used with languages/coded character sets in which the ASCII space
  577. character is rarely used, or not used at all.
  578. 11. Acknowledgments
  579. The DelSp parameter was developed during a series of discussions
  580. among a number of people, including Harald Alvestrand, Grant Baillie,
  581. Ian Bell, Steve Dorner, Patrik Faltstrom, Eric Fischer, Ned Freed,
  582. Alexey Melnikov, John Myers, and Pete Resnick.
  583. Gellens Standards Track [Page 15]
  584. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  585. Corrections and clarifications to RFC 2646 and early versions of this
  586. document were pointed out by several people, including Adam Costello,
  587. Jutta Degener, Tony Hansen, Simon Josefsson, Dan Kohn, Ragho
  588. Mahalingam, Keith Moore, Greg Troxel, and Dan Wing.
  589. I'm told that NeXT's mail application used a very similar mechanism
  590. (without support for non-Western languages) in 1992.
  591. 12. Normative References
  592. [ABNF] Crocker, D., Ed. and P. Overell, "Augmented BNF
  593. for Syntax Specifications: ABNF", RFC 2234,
  594. November 1997.
  595. [KEYWORDS] Bradner, S., "Key words for use in RFCs to
  596. Indicate Requirement Levels", BCP 14, RFC 2119,
  597. March 1997.
  598. [MIME-IMT] Freed, N. and N. Borenstein, "Multipurpose
  599. Internet Mail Extensions (MIME) Part Two: Media
  600. Types", RFC 2046, November 1996.
  601. [Quoted-Printable] Freed, N. and N. Borenstein, "Multipurpose
  602. Internet Mail Extensions (MIME) Part One: Format
  603. of Internet Message Bodies", RFC 2045, November
  604. 1996.
  605. 13. Informative References
  606. [Annex-14] Unicode Standard Annex #14, "Line Breaking
  607. Properties"
  608. <URL:http://www.unicode.org/unicode/reports/tr14/>
  609. [MSG-FMT] Resnick, P., Ed., "Internet Message Format", RFC
  610. 2822, April 2001.
  611. [OpenPGP] Callas, J., Donnerhacke, L., Finney, H. and R.
  612. Thayer, "OpenPGP Message Format", RFC 2440,
  613. November 1998.
  614. [OpenPGP-MIME] Elkins, M., "MIME Security with Pretty Good
  615. Privacy (PGP)", RFC 2015, October 1996.
  616. Elkins, M., Del Torto, D., Levien, R. and J.
  617. Roessler, "MIME Security with OpenPGP", RFC 3156,
  618. August 2001.
  619. Gellens Standards Track [Page 16]
  620. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  621. [Rich] Resnick, P. and A. Walker, "The text/enriched MIME
  622. Content-type", RFC 1896, February 1996.
  623. [SMTP] Klensin, J., Ed., "Simple Mail Transfer Protocol",
  624. RFC 2821, April 2001.
  625. Gellens Standards Track [Page 17]
  626. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  627. Appendix A: Changes from RFC 2646
  628. Substantive:
  629. o Added DelSp parameter to handle languages and coded character sets
  630. in which space is less common or not used.
  631. o Updated text on generating and interpreting to accommodate the
  632. DelSp parameter.
  633. o Changed the limits of 79 or 80 to be 78 in conformance with RFC
  634. 2822.
  635. o Added text on generating to clarify that the 78-character limit
  636. includes trailing white space and stuffing.
  637. o Changed sig-sep in ABNF to allow stuffing.
  638. o Changed fixed-line to allow empty lines in ABNF.
  639. o Added explanatory text following ABNF.
  640. o Moved text from Abstract to new Introduction; rewrote Abstract.
  641. o Moved interoperability text to new section, and updated.
  642. o Clarified Security Considerations.
  643. o Text on digital signatures now discusses that OpenPGP ignores
  644. trailing white space.
  645. o Mention Unicode Annex 14.
  646. o Added mention of quoting to Abstract and Introduction.
  647. o Deleted line analysis table.
  648. o Added recommendations for OpenPGP and OpenPGP-MIME.
  649. o Rewrote ABNF rules to remove most ambiguity and note remaining
  650. case.
  651. o Added note that c-t-e is irrelevant to flowed text processing.
  652. o Added text indicating that end of data terminates a paragraph.
  653. o Moved sig-sep out of fixed-line ABNF.
  654. o Changed some SHOULDs to MUSTs (space-stuffing, quoted paragraphs).
  655. o Added note to ABNF that space and ">" are encoded according to
  656. charset.
  657. o Mentioned exceptions in section on interpreting.
  658. o Clarified and made consistent treatment of signature separator
  659. lines.
  660. Editorial:
  661. o Added mention of NeXT's mail application to Acknowledgments.
  662. o Updated Acknowledgments.
  663. o Updated [SMTP] reference to 2821.
  664. o Added Notices.
  665. o Split References into Normative and Informative.
  666. o Improved text wording in some areas.
  667. o Standardize on "quote depth", not "quoting depth".
  668. o Moved section on interpreting before section on generating.
  669. o Reworded non-normative "should"s.
  670. o Noted meaning of "paragraph".
  671. Gellens Standards Track [Page 18]
  672. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  673. The DelSp parameter was added specifically to permit Format=Flowed to
  674. be used with languages/coded character sets in which the ASCII space
  675. character is rarely used, or not used at all. The DelSp mechanism
  676. was selected despite having been initially rejected as too much of a
  677. kludge, because among the many different techniques proposed, it
  678. allows for maximum interoperability among clients which support
  679. neither this specification nor RFC 2646, those which do support RFC
  680. 2646 but not this specification, and those that do support this
  681. specification; this set is multiplied by those that handle
  682. languages/coded character sets in which spaces are common, and in
  683. which they are uncommon or not used.
  684. Author's Address
  685. Randall Gellens
  686. QUALCOMM Incorporated
  687. 5775 Morehouse Drive
  688. San Diego, CA 92121
  689. USA
  690. Phone: +1 858 651 5115
  691. EMail: randy@qualcomm.com
  692. Gellens Standards Track [Page 19]
  693. RFC 3676 Text/Plain Format and DelSp Parameters February 2004
  694. Full Copyright Statement
  695. Copyright (C) The Internet Society (2004). This document is subject
  696. to the rights, licenses and restrictions contained in BCP 78 and
  697. except as set forth therein, the authors retain all their rights.
  698. This document and the information contained herein are provided on an
  699. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE
  700. REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE
  701. INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR
  702. IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
  703. THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  704. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  705. Intellectual Property
  706. The IETF takes no position regarding the validity or scope of any
  707. Intellectual Property Rights or other rights that might be claimed
  708. to pertain to the implementation or use of the technology
  709. described in this document or the extent to which any license
  710. under such rights might or might not be available; nor does it
  711. represent that it has made any independent effort to identify any
  712. such rights. Information on the procedures with respect to
  713. rights in RFC documents can be found in BCP 78 and BCP 79.
  714. Copies of IPR disclosures made to the IETF Secretariat and any
  715. assurances of licenses to be made available, or the result of an
  716. attempt made to obtain a general license or permission for the use
  717. of such proprietary rights by implementers or users of this
  718. specification can be obtained from the IETF on-line IPR repository
  719. at http://www.ietf.org/ipr.
  720. The IETF invites any interested party to bring to its attention
  721. any copyrights, patents or patent applications, or other
  722. proprietary rights that may cover technology that may be required
  723. to implement this standard. Please address the information to the
  724. IETF at ietf-ipr@ietf.org.
  725. Acknowledgement
  726. Funding for the RFC Editor function is currently provided by the
  727. Internet Society.
  728. Gellens Standards Track [Page 20]