rack-mail_exception 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. data/.document +5 -0
  2. data/.gitignore +22 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +38 -0
  5. data/Rakefile +56 -0
  6. data/VERSION +1 -0
  7. data/lib/rack/mail_exception.rb +103 -0
  8. data/test/helper.rb +13 -0
  9. data/test/test_rack_mail_exception.rb +93 -0
  10. data/vendor/mail/.bundle/config +2 -0
  11. data/vendor/mail/CHANGELOG.rdoc +370 -0
  12. data/vendor/mail/Dependencies.txt +3 -0
  13. data/vendor/mail/Gemfile +17 -0
  14. data/vendor/mail/README.rdoc +572 -0
  15. data/vendor/mail/ROADMAP +92 -0
  16. data/vendor/mail/Rakefile +41 -0
  17. data/vendor/mail/TODO.rdoc +9 -0
  18. data/vendor/mail/lib/mail.rb +76 -0
  19. data/vendor/mail/lib/mail/attachments_list.rb +99 -0
  20. data/vendor/mail/lib/mail/body.rb +287 -0
  21. data/vendor/mail/lib/mail/configuration.rb +67 -0
  22. data/vendor/mail/lib/mail/core_extensions/blank.rb +26 -0
  23. data/vendor/mail/lib/mail/core_extensions/nil.rb +11 -0
  24. data/vendor/mail/lib/mail/core_extensions/string.rb +27 -0
  25. data/vendor/mail/lib/mail/elements.rb +14 -0
  26. data/vendor/mail/lib/mail/elements/address.rb +306 -0
  27. data/vendor/mail/lib/mail/elements/address_list.rb +74 -0
  28. data/vendor/mail/lib/mail/elements/content_disposition_element.rb +30 -0
  29. data/vendor/mail/lib/mail/elements/content_location_element.rb +25 -0
  30. data/vendor/mail/lib/mail/elements/content_transfer_encoding_element.rb +24 -0
  31. data/vendor/mail/lib/mail/elements/content_type_element.rb +35 -0
  32. data/vendor/mail/lib/mail/elements/date_time_element.rb +26 -0
  33. data/vendor/mail/lib/mail/elements/envelope_from_element.rb +34 -0
  34. data/vendor/mail/lib/mail/elements/message_ids_element.rb +29 -0
  35. data/vendor/mail/lib/mail/elements/mime_version_element.rb +26 -0
  36. data/vendor/mail/lib/mail/elements/phrase_list.rb +21 -0
  37. data/vendor/mail/lib/mail/elements/received_element.rb +30 -0
  38. data/vendor/mail/lib/mail/encodings.rb +258 -0
  39. data/vendor/mail/lib/mail/encodings/7bit.rb +31 -0
  40. data/vendor/mail/lib/mail/encodings/8bit.rb +31 -0
  41. data/vendor/mail/lib/mail/encodings/base64.rb +33 -0
  42. data/vendor/mail/lib/mail/encodings/binary.rb +31 -0
  43. data/vendor/mail/lib/mail/encodings/quoted_printable.rb +38 -0
  44. data/vendor/mail/lib/mail/encodings/transfer_encoding.rb +58 -0
  45. data/vendor/mail/lib/mail/envelope.rb +35 -0
  46. data/vendor/mail/lib/mail/field.rb +223 -0
  47. data/vendor/mail/lib/mail/field_list.rb +33 -0
  48. data/vendor/mail/lib/mail/fields.rb +35 -0
  49. data/vendor/mail/lib/mail/fields/bcc_field.rb +56 -0
  50. data/vendor/mail/lib/mail/fields/cc_field.rb +55 -0
  51. data/vendor/mail/lib/mail/fields/comments_field.rb +41 -0
  52. data/vendor/mail/lib/mail/fields/common/address_container.rb +16 -0
  53. data/vendor/mail/lib/mail/fields/common/common_address.rb +125 -0
  54. data/vendor/mail/lib/mail/fields/common/common_date.rb +42 -0
  55. data/vendor/mail/lib/mail/fields/common/common_field.rb +50 -0
  56. data/vendor/mail/lib/mail/fields/common/common_message_id.rb +43 -0
  57. data/vendor/mail/lib/mail/fields/common/parameter_hash.rb +52 -0
  58. data/vendor/mail/lib/mail/fields/content_description_field.rb +19 -0
  59. data/vendor/mail/lib/mail/fields/content_disposition_field.rb +69 -0
  60. data/vendor/mail/lib/mail/fields/content_id_field.rb +63 -0
  61. data/vendor/mail/lib/mail/fields/content_location_field.rb +42 -0
  62. data/vendor/mail/lib/mail/fields/content_transfer_encoding_field.rb +50 -0
  63. data/vendor/mail/lib/mail/fields/content_type_field.rb +185 -0
  64. data/vendor/mail/lib/mail/fields/date_field.rb +55 -0
  65. data/vendor/mail/lib/mail/fields/from_field.rb +55 -0
  66. data/vendor/mail/lib/mail/fields/in_reply_to_field.rb +55 -0
  67. data/vendor/mail/lib/mail/fields/keywords_field.rb +44 -0
  68. data/vendor/mail/lib/mail/fields/message_id_field.rb +83 -0
  69. data/vendor/mail/lib/mail/fields/mime_version_field.rb +53 -0
  70. data/vendor/mail/lib/mail/fields/optional_field.rb +13 -0
  71. data/vendor/mail/lib/mail/fields/received_field.rb +67 -0
  72. data/vendor/mail/lib/mail/fields/references_field.rb +55 -0
  73. data/vendor/mail/lib/mail/fields/reply_to_field.rb +55 -0
  74. data/vendor/mail/lib/mail/fields/resent_bcc_field.rb +55 -0
  75. data/vendor/mail/lib/mail/fields/resent_cc_field.rb +55 -0
  76. data/vendor/mail/lib/mail/fields/resent_date_field.rb +35 -0
  77. data/vendor/mail/lib/mail/fields/resent_from_field.rb +55 -0
  78. data/vendor/mail/lib/mail/fields/resent_message_id_field.rb +34 -0
  79. data/vendor/mail/lib/mail/fields/resent_sender_field.rb +62 -0
  80. data/vendor/mail/lib/mail/fields/resent_to_field.rb +55 -0
  81. data/vendor/mail/lib/mail/fields/return_path_field.rb +64 -0
  82. data/vendor/mail/lib/mail/fields/sender_field.rb +67 -0
  83. data/vendor/mail/lib/mail/fields/structured_field.rb +51 -0
  84. data/vendor/mail/lib/mail/fields/subject_field.rb +16 -0
  85. data/vendor/mail/lib/mail/fields/to_field.rb +55 -0
  86. data/vendor/mail/lib/mail/fields/unstructured_field.rb +166 -0
  87. data/vendor/mail/lib/mail/header.rb +262 -0
  88. data/vendor/mail/lib/mail/mail.rb +234 -0
  89. data/vendor/mail/lib/mail/message.rb +1867 -0
  90. data/vendor/mail/lib/mail/network.rb +9 -0
  91. data/vendor/mail/lib/mail/network/delivery_methods/file_delivery.rb +40 -0
  92. data/vendor/mail/lib/mail/network/delivery_methods/sendmail.rb +62 -0
  93. data/vendor/mail/lib/mail/network/delivery_methods/smtp.rb +110 -0
  94. data/vendor/mail/lib/mail/network/delivery_methods/test_mailer.rb +40 -0
  95. data/vendor/mail/lib/mail/network/retriever_methods/imap.rb +18 -0
  96. data/vendor/mail/lib/mail/network/retriever_methods/pop3.rb +149 -0
  97. data/vendor/mail/lib/mail/parsers/address_lists.rb +64 -0
  98. data/vendor/mail/lib/mail/parsers/address_lists.treetop +19 -0
  99. data/vendor/mail/lib/mail/parsers/content_disposition.rb +387 -0
  100. data/vendor/mail/lib/mail/parsers/content_disposition.treetop +46 -0
  101. data/vendor/mail/lib/mail/parsers/content_location.rb +139 -0
  102. data/vendor/mail/lib/mail/parsers/content_location.treetop +20 -0
  103. data/vendor/mail/lib/mail/parsers/content_transfer_encoding.rb +162 -0
  104. data/vendor/mail/lib/mail/parsers/content_transfer_encoding.treetop +20 -0
  105. data/vendor/mail/lib/mail/parsers/content_type.rb +539 -0
  106. data/vendor/mail/lib/mail/parsers/content_type.treetop +58 -0
  107. data/vendor/mail/lib/mail/parsers/date_time.rb +114 -0
  108. data/vendor/mail/lib/mail/parsers/date_time.treetop +11 -0
  109. data/vendor/mail/lib/mail/parsers/envelope_from.rb +194 -0
  110. data/vendor/mail/lib/mail/parsers/envelope_from.treetop +32 -0
  111. data/vendor/mail/lib/mail/parsers/message_ids.rb +45 -0
  112. data/vendor/mail/lib/mail/parsers/message_ids.treetop +15 -0
  113. data/vendor/mail/lib/mail/parsers/mime_version.rb +144 -0
  114. data/vendor/mail/lib/mail/parsers/mime_version.treetop +19 -0
  115. data/vendor/mail/lib/mail/parsers/phrase_lists.rb +45 -0
  116. data/vendor/mail/lib/mail/parsers/phrase_lists.treetop +15 -0
  117. data/vendor/mail/lib/mail/parsers/received.rb +71 -0
  118. data/vendor/mail/lib/mail/parsers/received.treetop +11 -0
  119. data/vendor/mail/lib/mail/parsers/rfc2045.rb +464 -0
  120. data/vendor/mail/lib/mail/parsers/rfc2045.treetop +36 -0
  121. data/vendor/mail/lib/mail/parsers/rfc2822.rb +5318 -0
  122. data/vendor/mail/lib/mail/parsers/rfc2822.treetop +410 -0
  123. data/vendor/mail/lib/mail/parsers/rfc2822_obsolete.rb +3757 -0
  124. data/vendor/mail/lib/mail/parsers/rfc2822_obsolete.treetop +241 -0
  125. data/vendor/mail/lib/mail/part.rb +102 -0
  126. data/vendor/mail/lib/mail/parts_list.rb +34 -0
  127. data/vendor/mail/lib/mail/patterns.rb +30 -0
  128. data/vendor/mail/lib/mail/utilities.rb +181 -0
  129. data/vendor/mail/lib/mail/version.rb +10 -0
  130. data/vendor/mail/lib/mail/version_specific/ruby_1_8.rb +97 -0
  131. data/vendor/mail/lib/mail/version_specific/ruby_1_9.rb +87 -0
  132. data/vendor/mail/lib/tasks/corpus.rake +125 -0
  133. data/vendor/mail/lib/tasks/treetop.rake +10 -0
  134. data/vendor/mail/mail.gemspec +20 -0
  135. data/vendor/mail/reference/US ASCII Table.txt +130 -0
  136. data/vendor/mail/reference/rfc1035 Domain Implementation and Specification.txt +3083 -0
  137. data/vendor/mail/reference/rfc1049 Content-Type Header Field for Internet Messages.txt +451 -0
  138. data/vendor/mail/reference/rfc1344 Implications of MIME for Internet Mail Gateways.txt +586 -0
  139. data/vendor/mail/reference/rfc1345 Character Mnemonics & Character Sets.txt +5761 -0
  140. data/vendor/mail/reference/rfc1524 A User Agent Configuration Mechanism For Multimedia Mail Format Information.txt +675 -0
  141. data/vendor/mail/reference/rfc1652 SMTP Service Extension for 8bit-MIMEtransport.txt +339 -0
  142. data/vendor/mail/reference/rfc1892 Multipart Report .txt +227 -0
  143. data/vendor/mail/reference/rfc1893 Mail System Status Codes.txt +843 -0
  144. data/vendor/mail/reference/rfc2045 Multipurpose Internet Mail Extensions (1).txt +1739 -0
  145. data/vendor/mail/reference/rfc2046 Multipurpose Internet Mail Extensions (2).txt +2467 -0
  146. data/vendor/mail/reference/rfc2047 Multipurpose Internet Mail Extensions (3).txt +843 -0
  147. data/vendor/mail/reference/rfc2048 Multipurpose Internet Mail Extensions (4).txt +1180 -0
  148. data/vendor/mail/reference/rfc2049 Multipurpose Internet Mail Extensions (5).txt +1347 -0
  149. data/vendor/mail/reference/rfc2111 Content-ID and Message-ID URLs.txt +283 -0
  150. data/vendor/mail/reference/rfc2183 Content-Disposition Header Field.txt +675 -0
  151. data/vendor/mail/reference/rfc2231 MIME Parameter Value and Encoded Word Extensions.txt +563 -0
  152. data/vendor/mail/reference/rfc2387 MIME Multipart-Related Content-type.txt +563 -0
  153. data/vendor/mail/reference/rfc2821 Simple Mail Transfer Protocol.txt +3711 -0
  154. data/vendor/mail/reference/rfc2822 Internet Message Format.txt +2859 -0
  155. data/vendor/mail/reference/rfc3462 Reporting of Mail System Administrative Messages.txt +396 -0
  156. data/vendor/mail/reference/rfc3696 Checking and Transformation of Names.txt +898 -0
  157. data/vendor/mail/reference/rfc4155 The application-mbox Media Type.txt +502 -0
  158. data/vendor/mail/reference/rfc4234 Augmented BNF for Syntax Specifications: ABNF.txt +899 -0
  159. data/vendor/mail/reference/rfc822 Standard for the Format of ARPA Internet Text Messages.txt +2900 -0
  160. data/vendor/mail/spec/environment.rb +15 -0
  161. data/vendor/mail/spec/features/making_a_new_message.feature +14 -0
  162. data/vendor/mail/spec/features/steps/env.rb +6 -0
  163. data/vendor/mail/spec/features/steps/making_a_new_message_steps.rb +11 -0
  164. data/vendor/mail/spec/fixtures/attachments/basic_email.eml +31 -0
  165. data/vendor/mail/spec/fixtures/attachments/test.gif +0 -0
  166. data/vendor/mail/spec/fixtures/attachments/test.jpg +0 -0
  167. data/vendor/mail/spec/fixtures/attachments/test.pdf +0 -0
  168. data/vendor/mail/spec/fixtures/attachments/test.png +0 -0
  169. data/vendor/mail/spec/fixtures/attachments/test.tiff +0 -0
  170. data/vendor/mail/spec/fixtures/attachments/test.zip +0 -0
  171. data/vendor/mail/spec/fixtures/attachments//343/201/246/343/201/231/343/201/250.txt +2 -0
  172. data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_content_disposition.eml +29 -0
  173. data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_content_location.eml +32 -0
  174. data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_message_rfc822.eml +92 -0
  175. data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_only_email.eml +17 -0
  176. data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_pdf.eml +70 -0
  177. data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_with_encoded_name.eml +47 -0
  178. data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_with_quoted_filename.eml +60 -0
  179. data/vendor/mail/spec/fixtures/emails/error_emails/cant_parse_from.eml +33 -0
  180. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_7-bit.eml +231 -0
  181. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_empty.eml +33 -0
  182. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_plain.eml +148 -0
  183. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_qp_with_space.eml +53 -0
  184. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_spam.eml +44 -0
  185. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_text-html.eml +50 -0
  186. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_with_8bits.eml +770 -0
  187. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_with_semi_colon.eml +269 -0
  188. data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml +79 -0
  189. data/vendor/mail/spec/fixtures/emails/error_emails/empty_group_lists.eml +162 -0
  190. data/vendor/mail/spec/fixtures/emails/error_emails/header_fields_with_empty_values.eml +33 -0
  191. data/vendor/mail/spec/fixtures/emails/error_emails/missing_body.eml +16 -0
  192. data/vendor/mail/spec/fixtures/emails/error_emails/missing_content_disposition.eml +43 -0
  193. data/vendor/mail/spec/fixtures/emails/error_emails/multiple_content_types.eml +25 -0
  194. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email11.eml +34 -0
  195. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email12.eml +32 -0
  196. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email2.eml +114 -0
  197. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email4.eml +59 -0
  198. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email7.eml +66 -0
  199. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_encoded_stack_level_too_deep.eml +53 -0
  200. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_illegal_boundary.eml +58 -0
  201. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_mimepart_without_content_type.eml +94 -0
  202. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_multipart_mixed_quoted_boundary.eml +50 -0
  203. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_nested_attachment.eml +100 -0
  204. data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_quoted_illegal_boundary.eml +58 -0
  205. data/vendor/mail/spec/fixtures/emails/mime_emails/sig_only_email.eml +29 -0
  206. data/vendor/mail/spec/fixtures/emails/mime_emails/two_from_in_message.eml +42 -0
  207. data/vendor/mail/spec/fixtures/emails/multi_charset/japanese.eml +9 -0
  208. data/vendor/mail/spec/fixtures/emails/multi_charset/japanese_attachment.eml +27 -0
  209. data/vendor/mail/spec/fixtures/emails/multi_charset/japanese_attachment_long_name.eml +44 -0
  210. data/vendor/mail/spec/fixtures/emails/multipart_report_emails/multi_address_bounce1.eml +179 -0
  211. data/vendor/mail/spec/fixtures/emails/multipart_report_emails/multi_address_bounce2.eml +179 -0
  212. data/vendor/mail/spec/fixtures/emails/multipart_report_emails/report_422.eml +98 -0
  213. data/vendor/mail/spec/fixtures/emails/multipart_report_emails/report_530.eml +97 -0
  214. data/vendor/mail/spec/fixtures/emails/plain_emails/basic_email.eml +31 -0
  215. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email.eml +14 -0
  216. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email10.eml +20 -0
  217. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email5.eml +19 -0
  218. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email6.eml +20 -0
  219. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email8.eml +47 -0
  220. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_bad_time.eml +62 -0
  221. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_double_at_in_header.eml +14 -0
  222. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_incorrect_header.eml +28 -0
  223. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_multiple_from.eml +30 -0
  224. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_quoted_with_0d0a.eml +14 -0
  225. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_reply.eml +32 -0
  226. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_simple.eml +11 -0
  227. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_string_in_date_field.eml +17 -0
  228. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_trailing_dot.eml +21 -0
  229. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_with_bad_date.eml +48 -0
  230. data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_with_partially_quoted_subject.eml +14 -0
  231. data/vendor/mail/spec/fixtures/emails/rfc2822/example01.eml +8 -0
  232. data/vendor/mail/spec/fixtures/emails/rfc2822/example02.eml +9 -0
  233. data/vendor/mail/spec/fixtures/emails/rfc2822/example03.eml +7 -0
  234. data/vendor/mail/spec/fixtures/emails/rfc2822/example04.eml +7 -0
  235. data/vendor/mail/spec/fixtures/emails/rfc2822/example05.eml +8 -0
  236. data/vendor/mail/spec/fixtures/emails/rfc2822/example06.eml +10 -0
  237. data/vendor/mail/spec/fixtures/emails/rfc2822/example07.eml +9 -0
  238. data/vendor/mail/spec/fixtures/emails/rfc2822/example08.eml +12 -0
  239. data/vendor/mail/spec/fixtures/emails/rfc2822/example09.eml +15 -0
  240. data/vendor/mail/spec/fixtures/emails/rfc2822/example10.eml +15 -0
  241. data/vendor/mail/spec/fixtures/emails/rfc2822/example11.eml +6 -0
  242. data/vendor/mail/spec/fixtures/emails/rfc2822/example12.eml +8 -0
  243. data/vendor/mail/spec/fixtures/emails/rfc2822/example13.eml +10 -0
  244. data/vendor/mail/spec/fixtures/emails/sample_output_multipart +0 -0
  245. data/vendor/mail/spec/mail/attachments_list_spec.rb +214 -0
  246. data/vendor/mail/spec/mail/body_spec.rb +385 -0
  247. data/vendor/mail/spec/mail/configuration_spec.rb +19 -0
  248. data/vendor/mail/spec/mail/core_extensions/string_spec.rb +62 -0
  249. data/vendor/mail/spec/mail/core_extensions_spec.rb +99 -0
  250. data/vendor/mail/spec/mail/elements/address_list_spec.rb +109 -0
  251. data/vendor/mail/spec/mail/elements/address_spec.rb +609 -0
  252. data/vendor/mail/spec/mail/elements/date_time_element_spec.rb +20 -0
  253. data/vendor/mail/spec/mail/elements/envelope_from_element_spec.rb +31 -0
  254. data/vendor/mail/spec/mail/elements/message_ids_element_spec.rb +43 -0
  255. data/vendor/mail/spec/mail/elements/phrase_list_spec.rb +22 -0
  256. data/vendor/mail/spec/mail/elements/received_element_spec.rb +34 -0
  257. data/vendor/mail/spec/mail/encoding_spec.rb +189 -0
  258. data/vendor/mail/spec/mail/encodings/base64_spec.rb +25 -0
  259. data/vendor/mail/spec/mail/encodings/quoted_printable_spec.rb +25 -0
  260. data/vendor/mail/spec/mail/encodings_spec.rb +664 -0
  261. data/vendor/mail/spec/mail/example_emails_spec.rb +303 -0
  262. data/vendor/mail/spec/mail/field_list_spec.rb +33 -0
  263. data/vendor/mail/spec/mail/field_spec.rb +198 -0
  264. data/vendor/mail/spec/mail/fields/bcc_field_spec.rb +89 -0
  265. data/vendor/mail/spec/mail/fields/cc_field_spec.rb +79 -0
  266. data/vendor/mail/spec/mail/fields/comments_field_spec.rb +25 -0
  267. data/vendor/mail/spec/mail/fields/common/address_container_spec.rb +18 -0
  268. data/vendor/mail/spec/mail/fields/common/common_address_spec.rb +132 -0
  269. data/vendor/mail/spec/mail/fields/common/common_date_spec.rb +25 -0
  270. data/vendor/mail/spec/mail/fields/common/common_field_spec.rb +69 -0
  271. data/vendor/mail/spec/mail/fields/common/common_message_id_spec.rb +30 -0
  272. data/vendor/mail/spec/mail/fields/common/parameter_hash_spec.rb +56 -0
  273. data/vendor/mail/spec/mail/fields/content_description_field_spec.rb +39 -0
  274. data/vendor/mail/spec/mail/fields/content_disposition_field_spec.rb +55 -0
  275. data/vendor/mail/spec/mail/fields/content_id_field_spec.rb +117 -0
  276. data/vendor/mail/spec/mail/fields/content_location_field_spec.rb +46 -0
  277. data/vendor/mail/spec/mail/fields/content_transfer_encoding_field_spec.rb +113 -0
  278. data/vendor/mail/spec/mail/fields/content_type_field_spec.rb +678 -0
  279. data/vendor/mail/spec/mail/fields/date_field_spec.rb +73 -0
  280. data/vendor/mail/spec/mail/fields/envelope_spec.rb +48 -0
  281. data/vendor/mail/spec/mail/fields/from_field_spec.rb +89 -0
  282. data/vendor/mail/spec/mail/fields/in_reply_to_field_spec.rb +62 -0
  283. data/vendor/mail/spec/mail/fields/keywords_field_spec.rb +66 -0
  284. data/vendor/mail/spec/mail/fields/message_id_field_spec.rb +147 -0
  285. data/vendor/mail/spec/mail/fields/mime_version_field_spec.rb +166 -0
  286. data/vendor/mail/spec/mail/fields/received_field_spec.rb +44 -0
  287. data/vendor/mail/spec/mail/fields/references_field_spec.rb +35 -0
  288. data/vendor/mail/spec/mail/fields/reply_to_field_spec.rb +67 -0
  289. data/vendor/mail/spec/mail/fields/resent_bcc_field_spec.rb +66 -0
  290. data/vendor/mail/spec/mail/fields/resent_cc_field_spec.rb +66 -0
  291. data/vendor/mail/spec/mail/fields/resent_date_field_spec.rb +39 -0
  292. data/vendor/mail/spec/mail/fields/resent_from_field_spec.rb +66 -0
  293. data/vendor/mail/spec/mail/fields/resent_message_id_field_spec.rb +24 -0
  294. data/vendor/mail/spec/mail/fields/resent_sender_field_spec.rb +58 -0
  295. data/vendor/mail/spec/mail/fields/resent_to_field_spec.rb +66 -0
  296. data/vendor/mail/spec/mail/fields/return_path_field_spec.rb +52 -0
  297. data/vendor/mail/spec/mail/fields/sender_field_spec.rb +58 -0
  298. data/vendor/mail/spec/mail/fields/structured_field_spec.rb +72 -0
  299. data/vendor/mail/spec/mail/fields/to_field_spec.rb +92 -0
  300. data/vendor/mail/spec/mail/fields/unstructured_field_spec.rb +134 -0
  301. data/vendor/mail/spec/mail/header_spec.rb +578 -0
  302. data/vendor/mail/spec/mail/mail_spec.rb +34 -0
  303. data/vendor/mail/spec/mail/message_spec.rb +1409 -0
  304. data/vendor/mail/spec/mail/mime_messages_spec.rb +435 -0
  305. data/vendor/mail/spec/mail/multipart_report_spec.rb +112 -0
  306. data/vendor/mail/spec/mail/network/delivery_methods/file_delivery_spec.rb +79 -0
  307. data/vendor/mail/spec/mail/network/delivery_methods/sendmail_spec.rb +125 -0
  308. data/vendor/mail/spec/mail/network/delivery_methods/smtp_spec.rb +133 -0
  309. data/vendor/mail/spec/mail/network/delivery_methods/test_mailer_spec.rb +57 -0
  310. data/vendor/mail/spec/mail/network/retriever_methods/pop3_spec.rb +180 -0
  311. data/vendor/mail/spec/mail/network_spec.rb +359 -0
  312. data/vendor/mail/spec/mail/parsers/address_lists_parser_spec.rb +15 -0
  313. data/vendor/mail/spec/mail/parsers/content_transfer_encoding_parser_spec.rb +72 -0
  314. data/vendor/mail/spec/mail/part_spec.rb +129 -0
  315. data/vendor/mail/spec/mail/parts_list_spec.rb +12 -0
  316. data/vendor/mail/spec/mail/round_tripping_spec.rb +44 -0
  317. data/vendor/mail/spec/mail/utilities_spec.rb +327 -0
  318. data/vendor/mail/spec/mail/version_specific/escape_paren_1_8_spec.rb +32 -0
  319. data/vendor/mail/spec/matchers/break_down_to.rb +35 -0
  320. data/vendor/mail/spec/spec_helper.rb +163 -0
  321. metadata +442 -0
@@ -0,0 +1,2467 @@
1
+
2
+
3
+
4
+
5
+
6
+ Network Working Group N. Freed
7
+ Request for Comments: 2046 Innosoft
8
+ Obsoletes: 1521, 1522, 1590 N. Borenstein
9
+ Category: Standards Track First Virtual
10
+ November 1996
11
+
12
+
13
+ Multipurpose Internet Mail Extensions
14
+ (MIME) Part Two:
15
+ Media Types
16
+
17
+ Status of this Memo
18
+
19
+ This document specifies an Internet standards track protocol for the
20
+ Internet community, and requests discussion and suggestions for
21
+ improvements. Please refer to the current edition of the "Internet
22
+ Official Protocol Standards" (STD 1) for the standardization state
23
+ and status of this protocol. Distribution of this memo is unlimited.
24
+
25
+ Abstract
26
+
27
+ STD 11, RFC 822 defines a message representation protocol specifying
28
+ considerable detail about US-ASCII message headers, but which leaves
29
+ the message content, or message body, as flat US-ASCII text. This
30
+ set of documents, collectively called the Multipurpose Internet Mail
31
+ Extensions, or MIME, redefines the format of messages to allow for
32
+
33
+ (1) textual message bodies in character sets other than
34
+ US-ASCII,
35
+
36
+ (2) an extensible set of different formats for non-textual
37
+ message bodies,
38
+
39
+ (3) multi-part message bodies, and
40
+
41
+ (4) textual header information in character sets other than
42
+ US-ASCII.
43
+
44
+ These documents are based on earlier work documented in RFC 934, STD
45
+ 11, and RFC 1049, but extends and revises them. Because RFC 822 said
46
+ so little about message bodies, these documents are largely
47
+ orthogonal to (rather than a revision of) RFC 822.
48
+
49
+ The initial document in this set, RFC 2045, specifies the various
50
+ headers used to describe the structure of MIME messages. This second
51
+ document defines the general structure of the MIME media typing
52
+ system and defines an initial set of media types. The third document,
53
+ RFC 2047, describes extensions to RFC 822 to allow non-US-ASCII text
54
+
55
+
56
+
57
+ Freed & Borenstein Standards Track [Page 1]
58
+
59
+ RFC 2046 Media Types November 1996
60
+
61
+
62
+ data in Internet mail header fields. The fourth document, RFC 2048,
63
+ specifies various IANA registration procedures for MIME-related
64
+ facilities. The fifth and final document, RFC 2049, describes MIME
65
+ conformance criteria as well as providing some illustrative examples
66
+ of MIME message formats, acknowledgements, and the bibliography.
67
+
68
+ These documents are revisions of RFCs 1521 and 1522, which themselves
69
+ were revisions of RFCs 1341 and 1342. An appendix in RFC 2049
70
+ describes differences and changes from previous versions.
71
+
72
+ Table of Contents
73
+
74
+ 1. Introduction ......................................... 3
75
+ 2. Definition of a Top-Level Media Type ................. 4
76
+ 3. Overview Of The Initial Top-Level Media Types ........ 4
77
+ 4. Discrete Media Type Values ........................... 6
78
+ 4.1 Text Media Type ..................................... 6
79
+ 4.1.1 Representation of Line Breaks ..................... 7
80
+ 4.1.2 Charset Parameter ................................. 7
81
+ 4.1.3 Plain Subtype ..................................... 11
82
+ 4.1.4 Unrecognized Subtypes ............................. 11
83
+ 4.2 Image Media Type .................................... 11
84
+ 4.3 Audio Media Type .................................... 11
85
+ 4.4 Video Media Type .................................... 12
86
+ 4.5 Application Media Type .............................. 12
87
+ 4.5.1 Octet-Stream Subtype .............................. 13
88
+ 4.5.2 PostScript Subtype ................................ 14
89
+ 4.5.3 Other Application Subtypes ........................ 17
90
+ 5. Composite Media Type Values .......................... 17
91
+ 5.1 Multipart Media Type ................................ 17
92
+ 5.1.1 Common Syntax ..................................... 19
93
+ 5.1.2 Handling Nested Messages and Multiparts ........... 24
94
+ 5.1.3 Mixed Subtype ..................................... 24
95
+ 5.1.4 Alternative Subtype ............................... 24
96
+ 5.1.5 Digest Subtype .................................... 26
97
+ 5.1.6 Parallel Subtype .................................. 27
98
+ 5.1.7 Other Multipart Subtypes .......................... 28
99
+ 5.2 Message Media Type .................................. 28
100
+ 5.2.1 RFC822 Subtype .................................... 28
101
+ 5.2.2 Partial Subtype ................................... 29
102
+ 5.2.2.1 Message Fragmentation and Reassembly ............ 30
103
+ 5.2.2.2 Fragmentation and Reassembly Example ............ 31
104
+ 5.2.3 External-Body Subtype ............................. 33
105
+ 5.2.4 Other Message Subtypes ............................ 40
106
+ 6. Experimental Media Type Values ....................... 40
107
+ 7. Summary .............................................. 41
108
+ 8. Security Considerations .............................. 41
109
+ 9. Authors' Addresses ................................... 42
110
+
111
+
112
+
113
+ Freed & Borenstein Standards Track [Page 2]
114
+
115
+ RFC 2046 Media Types November 1996
116
+
117
+
118
+ A. Collected Grammar .................................... 43
119
+
120
+ 1. Introduction
121
+
122
+ The first document in this set, RFC 2045, defines a number of header
123
+ fields, including Content-Type. The Content-Type field is used to
124
+ specify the nature of the data in the body of a MIME entity, by
125
+ giving media type and subtype identifiers, and by providing auxiliary
126
+ information that may be required for certain media types. After the
127
+ type and subtype names, the remainder of the header field is simply a
128
+ set of parameters, specified in an attribute/value notation. The
129
+ ordering of parameters is not significant.
130
+
131
+ In general, the top-level media type is used to declare the general
132
+ type of data, while the subtype specifies a specific format for that
133
+ type of data. Thus, a media type of "image/xyz" is enough to tell a
134
+ user agent that the data is an image, even if the user agent has no
135
+ knowledge of the specific image format "xyz". Such information can
136
+ be used, for example, to decide whether or not to show a user the raw
137
+ data from an unrecognized subtype -- such an action might be
138
+ reasonable for unrecognized subtypes of "text", but not for
139
+ unrecognized subtypes of "image" or "audio". For this reason,
140
+ registered subtypes of "text", "image", "audio", and "video" should
141
+ not contain embedded information that is really of a different type.
142
+ Such compound formats should be represented using the "multipart" or
143
+ "application" types.
144
+
145
+ Parameters are modifiers of the media subtype, and as such do not
146
+ fundamentally affect the nature of the content. The set of
147
+ meaningful parameters depends on the media type and subtype. Most
148
+ parameters are associated with a single specific subtype. However, a
149
+ given top-level media type may define parameters which are applicable
150
+ to any subtype of that type. Parameters may be required by their
151
+ defining media type or subtype or they may be optional. MIME
152
+ implementations must also ignore any parameters whose names they do
153
+ not recognize.
154
+
155
+ MIME's Content-Type header field and media type mechanism has been
156
+ carefully designed to be extensible, and it is expected that the set
157
+ of media type/subtype pairs and their associated parameters will grow
158
+ significantly over time. Several other MIME facilities, such as
159
+ transfer encodings and "message/external-body" access types, are
160
+ likely to have new values defined over time. In order to ensure that
161
+ the set of such values is developed in an orderly, well-specified,
162
+ and public manner, MIME sets up a registration process which uses the
163
+ Internet Assigned Numbers Authority (IANA) as a central registry for
164
+ MIME's various areas of extensibility. The registration process for
165
+ these areas is described in a companion document, RFC 2048.
166
+
167
+
168
+
169
+ Freed & Borenstein Standards Track [Page 3]
170
+
171
+ RFC 2046 Media Types November 1996
172
+
173
+
174
+ The initial seven standard top-level media type are defined and
175
+ described in the remainder of this document.
176
+
177
+ 2. Definition of a Top-Level Media Type
178
+
179
+ The definition of a top-level media type consists of:
180
+
181
+ (1) a name and a description of the type, including
182
+ criteria for whether a particular type would qualify
183
+ under that type,
184
+
185
+ (2) the names and definitions of parameters, if any, which
186
+ are defined for all subtypes of that type (including
187
+ whether such parameters are required or optional),
188
+
189
+ (3) how a user agent and/or gateway should handle unknown
190
+ subtypes of this type,
191
+
192
+ (4) general considerations on gatewaying entities of this
193
+ top-level type, if any, and
194
+
195
+ (5) any restrictions on content-transfer-encodings for
196
+ entities of this top-level type.
197
+
198
+ 3. Overview Of The Initial Top-Level Media Types
199
+
200
+ The five discrete top-level media types are:
201
+
202
+ (1) text -- textual information. The subtype "plain" in
203
+ particular indicates plain text containing no
204
+ formatting commands or directives of any sort. Plain
205
+ text is intended to be displayed "as-is". No special
206
+ software is required to get the full meaning of the
207
+ text, aside from support for the indicated character
208
+ set. Other subtypes are to be used for enriched text in
209
+ forms where application software may enhance the
210
+ appearance of the text, but such software must not be
211
+ required in order to get the general idea of the
212
+ content. Possible subtypes of "text" thus include any
213
+ word processor format that can be read without
214
+ resorting to software that understands the format. In
215
+ particular, formats that employ embeddded binary
216
+ formatting information are not considered directly
217
+ readable. A very simple and portable subtype,
218
+ "richtext", was defined in RFC 1341, with a further
219
+ revision in RFC 1896 under the name "enriched".
220
+
221
+
222
+
223
+
224
+
225
+ Freed & Borenstein Standards Track [Page 4]
226
+
227
+ RFC 2046 Media Types November 1996
228
+
229
+
230
+ (2) image -- image data. "Image" requires a display device
231
+ (such as a graphical display, a graphics printer, or a
232
+ FAX machine) to view the information. An initial
233
+ subtype is defined for the widely-used image format
234
+ JPEG. . subtypes are defined for two widely-used image
235
+ formats, jpeg and gif.
236
+
237
+ (3) audio -- audio data. "Audio" requires an audio output
238
+ device (such as a speaker or a telephone) to "display"
239
+ the contents. An initial subtype "basic" is defined in
240
+ this document.
241
+
242
+ (4) video -- video data. "Video" requires the capability
243
+ to display moving images, typically including
244
+ specialized hardware and software. An initial subtype
245
+ "mpeg" is defined in this document.
246
+
247
+ (5) application -- some other kind of data, typically
248
+ either uninterpreted binary data or information to be
249
+ processed by an application. The subtype "octet-
250
+ stream" is to be used in the case of uninterpreted
251
+ binary data, in which case the simplest recommended
252
+ action is to offer to write the information into a file
253
+ for the user. The "PostScript" subtype is also defined
254
+ for the transport of PostScript material. Other
255
+ expected uses for "application" include spreadsheets,
256
+ data for mail-based scheduling systems, and languages
257
+ for "active" (computational) messaging, and word
258
+ processing formats that are not directly readable.
259
+ Note that security considerations may exist for some
260
+ types of application data, most notably
261
+ "application/PostScript" and any form of active
262
+ messaging. These issues are discussed later in this
263
+ document.
264
+
265
+ The two composite top-level media types are:
266
+
267
+ (1) multipart -- data consisting of multiple entities of
268
+ independent data types. Four subtypes are initially
269
+ defined, including the basic "mixed" subtype specifying
270
+ a generic mixed set of parts, "alternative" for
271
+ representing the same data in multiple formats,
272
+ "parallel" for parts intended to be viewed
273
+ simultaneously, and "digest" for multipart entities in
274
+ which each part has a default type of "message/rfc822".
275
+
276
+
277
+
278
+
279
+
280
+
281
+ Freed & Borenstein Standards Track [Page 5]
282
+
283
+ RFC 2046 Media Types November 1996
284
+
285
+
286
+ (2) message -- an encapsulated message. A body of media
287
+ type "message" is itself all or a portion of some kind
288
+ of message object. Such objects may or may not in turn
289
+ contain other entities. The "rfc822" subtype is used
290
+ when the encapsulated content is itself an RFC 822
291
+ message. The "partial" subtype is defined for partial
292
+ RFC 822 messages, to permit the fragmented transmission
293
+ of bodies that are thought to be too large to be passed
294
+ through transport facilities in one piece. Another
295
+ subtype, "external-body", is defined for specifying
296
+ large bodies by reference to an external data source.
297
+
298
+ It should be noted that the list of media type values given here may
299
+ be augmented in time, via the mechanisms described above, and that
300
+ the set of subtypes is expected to grow substantially.
301
+
302
+ 4. Discrete Media Type Values
303
+
304
+ Five of the seven initial media type values refer to discrete bodies.
305
+ The content of these types must be handled by non-MIME mechanisms;
306
+ they are opaque to MIME processors.
307
+
308
+ 4.1. Text Media Type
309
+
310
+ The "text" media type is intended for sending material which is
311
+ principally textual in form. A "charset" parameter may be used to
312
+ indicate the character set of the body text for "text" subtypes,
313
+ notably including the subtype "text/plain", which is a generic
314
+ subtype for plain text. Plain text does not provide for or allow
315
+ formatting commands, font attribute specifications, processing
316
+ instructions, interpretation directives, or content markup. Plain
317
+ text is seen simply as a linear sequence of characters, possibly
318
+ interrupted by line breaks or page breaks. Plain text may allow the
319
+ stacking of several characters in the same position in the text.
320
+ Plain text in scripts like Arabic and Hebrew may also include
321
+ facilitites that allow the arbitrary mixing of text segments with
322
+ opposite writing directions.
323
+
324
+ Beyond plain text, there are many formats for representing what might
325
+ be known as "rich text". An interesting characteristic of many such
326
+ representations is that they are to some extent readable even without
327
+ the software that interprets them. It is useful, then, to
328
+ distinguish them, at the highest level, from such unreadable data as
329
+ images, audio, or text represented in an unreadable form. In the
330
+ absence of appropriate interpretation software, it is reasonable to
331
+ show subtypes of "text" to the user, while it is not reasonable to do
332
+ so with most nontextual data. Such formatted textual data should be
333
+ represented using subtypes of "text".
334
+
335
+
336
+
337
+ Freed & Borenstein Standards Track [Page 6]
338
+
339
+ RFC 2046 Media Types November 1996
340
+
341
+
342
+ 4.1.1. Representation of Line Breaks
343
+
344
+ The canonical form of any MIME "text" subtype MUST always represent a
345
+ line break as a CRLF sequence. Similarly, any occurrence of CRLF in
346
+ MIME "text" MUST represent a line break. Use of CR and LF outside of
347
+ line break sequences is also forbidden.
348
+
349
+ This rule applies regardless of format or character set or sets
350
+ involved.
351
+
352
+ NOTE: The proper interpretation of line breaks when a body is
353
+ displayed depends on the media type. In particular, while it is
354
+ appropriate to treat a line break as a transition to a new line when
355
+ displaying a "text/plain" body, this treatment is actually incorrect
356
+ for other subtypes of "text" like "text/enriched" [RFC-1896].
357
+ Similarly, whether or not line breaks should be added during display
358
+ operations is also a function of the media type. It should not be
359
+ necessary to add any line breaks to display "text/plain" correctly,
360
+ whereas proper display of "text/enriched" requires the appropriate
361
+ addition of line breaks.
362
+
363
+ NOTE: Some protocols defines a maximum line length. E.g. SMTP [RFC-
364
+ 821] allows a maximum of 998 octets before the next CRLF sequence.
365
+ To be transported by such protocols, data which includes too long
366
+ segments without CRLF sequences must be encoded with a suitable
367
+ content-transfer-encoding.
368
+
369
+ 4.1.2. Charset Parameter
370
+
371
+ A critical parameter that may be specified in the Content-Type field
372
+ for "text/plain" data is the character set. This is specified with a
373
+ "charset" parameter, as in:
374
+
375
+ Content-type: text/plain; charset=iso-8859-1
376
+
377
+ Unlike some other parameter values, the values of the charset
378
+ parameter are NOT case sensitive. The default character set, which
379
+ must be assumed in the absence of a charset parameter, is US-ASCII.
380
+
381
+ The specification for any future subtypes of "text" must specify
382
+ whether or not they will also utilize a "charset" parameter, and may
383
+ possibly restrict its values as well. For other subtypes of "text"
384
+ than "text/plain", the semantics of the "charset" parameter should be
385
+ defined to be identical to those specified here for "text/plain",
386
+ i.e., the body consists entirely of characters in the given charset.
387
+ In particular, definers of future "text" subtypes should pay close
388
+ attention to the implications of multioctet character sets for their
389
+ subtype definitions.
390
+
391
+
392
+
393
+ Freed & Borenstein Standards Track [Page 7]
394
+
395
+ RFC 2046 Media Types November 1996
396
+
397
+
398
+ The charset parameter for subtypes of "text" gives a name of a
399
+ character set, as "character set" is defined in RFC 2045. The rules
400
+ regarding line breaks detailed in the previous section must also be
401
+ observed -- a character set whose definition does not conform to
402
+ these rules cannot be used in a MIME "text" subtype.
403
+
404
+ An initial list of predefined character set names can be found at the
405
+ end of this section. Additional character sets may be registered
406
+ with IANA.
407
+
408
+ Other media types than subtypes of "text" might choose to employ the
409
+ charset parameter as defined here, but with the CRLF/line break
410
+ restriction removed. Therefore, all character sets that conform to
411
+ the general definition of "character set" in RFC 2045 can be
412
+ registered for MIME use.
413
+
414
+ Note that if the specified character set includes 8-bit characters
415
+ and such characters are used in the body, a Content-Transfer-Encoding
416
+ header field and a corresponding encoding on the data are required in
417
+ order to transmit the body via some mail transfer protocols, such as
418
+ SMTP [RFC-821].
419
+
420
+ The default character set, US-ASCII, has been the subject of some
421
+ confusion and ambiguity in the past. Not only were there some
422
+ ambiguities in the definition, there have been wide variations in
423
+ practice. In order to eliminate such ambiguity and variations in the
424
+ future, it is strongly recommended that new user agents explicitly
425
+ specify a character set as a media type parameter in the Content-Type
426
+ header field. "US-ASCII" does not indicate an arbitrary 7-bit
427
+ character set, but specifies that all octets in the body must be
428
+ interpreted as characters according to the US-ASCII character set.
429
+ National and application-oriented versions of ISO 646 [ISO-646] are
430
+ usually NOT identical to US-ASCII, and in that case their use in
431
+ Internet mail is explicitly discouraged. The omission of the ISO 646
432
+ character set from this document is deliberate in this regard. The
433
+ character set name of "US-ASCII" explicitly refers to the character
434
+ set defined in ANSI X3.4-1986 [US- ASCII]. The new international
435
+ reference version (IRV) of the 1991 edition of ISO 646 is identical
436
+ to US-ASCII. The character set name "ASCII" is reserved and must not
437
+ be used for any purpose.
438
+
439
+ NOTE: RFC 821 explicitly specifies "ASCII", and references an earlier
440
+ version of the American Standard. Insofar as one of the purposes of
441
+ specifying a media type and character set is to permit the receiver
442
+ to unambiguously determine how the sender intended the coded message
443
+ to be interpreted, assuming anything other than "strict ASCII" as the
444
+ default would risk unintentional and incompatible changes to the
445
+ semantics of messages now being transmitted. This also implies that
446
+
447
+
448
+
449
+ Freed & Borenstein Standards Track [Page 8]
450
+
451
+ RFC 2046 Media Types November 1996
452
+
453
+
454
+ messages containing characters coded according to other versions of
455
+ ISO 646 than US-ASCII and the 1991 IRV, or using code-switching
456
+ procedures (e.g., those of ISO 2022), as well as 8bit or multiple
457
+ octet character encodings MUST use an appropriate character set
458
+ specification to be consistent with MIME.
459
+
460
+ The complete US-ASCII character set is listed in ANSI X3.4- 1986.
461
+ Note that the control characters including DEL (0-31, 127) have no
462
+ defined meaning in apart from the combination CRLF (US-ASCII values
463
+ 13 and 10) indicating a new line. Two of the characters have de
464
+ facto meanings in wide use: FF (12) often means "start subsequent
465
+ text on the beginning of a new page"; and TAB or HT (9) often (though
466
+ not always) means "move the cursor to the next available column after
467
+ the current position where the column number is a multiple of 8
468
+ (counting the first column as column 0)." Aside from these
469
+ conventions, any use of the control characters or DEL in a body must
470
+ either occur
471
+
472
+ (1) because a subtype of text other than "plain"
473
+ specifically assigns some additional meaning, or
474
+
475
+ (2) within the context of a private agreement between the
476
+ sender and recipient. Such private agreements are
477
+ discouraged and should be replaced by the other
478
+ capabilities of this document.
479
+
480
+ NOTE: An enormous proliferation of character sets exist beyond US-
481
+ ASCII. A large number of partially or totally overlapping character
482
+ sets is NOT a good thing. A SINGLE character set that can be used
483
+ universally for representing all of the world's languages in Internet
484
+ mail would be preferrable. Unfortunately, existing practice in
485
+ several communities seems to point to the continued use of multiple
486
+ character sets in the near future. A small number of standard
487
+ character sets are, therefore, defined for Internet use in this
488
+ document.
489
+
490
+ The defined charset values are:
491
+
492
+ (1) US-ASCII -- as defined in ANSI X3.4-1986 [US-ASCII].
493
+
494
+ (2) ISO-8859-X -- where "X" is to be replaced, as
495
+ necessary, for the parts of ISO-8859 [ISO-8859]. Note
496
+ that the ISO 646 character sets have deliberately been
497
+ omitted in favor of their 8859 replacements, which are
498
+ the designated character sets for Internet mail. As of
499
+ the publication of this document, the legitimate values
500
+ for "X" are the digits 1 through 10.
501
+
502
+
503
+
504
+
505
+ Freed & Borenstein Standards Track [Page 9]
506
+
507
+ RFC 2046 Media Types November 1996
508
+
509
+
510
+ Characters in the range 128-159 has no assigned meaning in ISO-8859-
511
+ X. Characters with values below 128 in ISO-8859-X have the same
512
+ assigned meaning as they do in US-ASCII.
513
+
514
+ Part 6 of ISO 8859 (Latin/Arabic alphabet) and part 8 (Latin/Hebrew
515
+ alphabet) includes both characters for which the normal writing
516
+ direction is right to left and characters for which it is left to
517
+ right, but do not define a canonical ordering method for representing
518
+ bi-directional text. The charset values "ISO-8859-6" and "ISO-8859-
519
+ 8", however, specify that the visual method is used [RFC-1556].
520
+
521
+ All of these character sets are used as pure 7bit or 8bit sets
522
+ without any shift or escape functions. The meaning of shift and
523
+ escape sequences in these character sets is not defined.
524
+
525
+ The character sets specified above are the ones that were relatively
526
+ uncontroversial during the drafting of MIME. This document does not
527
+ endorse the use of any particular character set other than US-ASCII,
528
+ and recognizes that the future evolution of world character sets
529
+ remains unclear.
530
+
531
+ Note that the character set used, if anything other than US- ASCII,
532
+ must always be explicitly specified in the Content-Type field.
533
+
534
+ No character set name other than those defined above may be used in
535
+ Internet mail without the publication of a formal specification and
536
+ its registration with IANA, or by private agreement, in which case
537
+ the character set name must begin with "X-".
538
+
539
+ Implementors are discouraged from defining new character sets unless
540
+ absolutely necessary.
541
+
542
+ The "charset" parameter has been defined primarily for the purpose of
543
+ textual data, and is described in this section for that reason.
544
+ However, it is conceivable that non-textual data might also wish to
545
+ specify a charset value for some purpose, in which case the same
546
+ syntax and values should be used.
547
+
548
+ In general, composition software should always use the "lowest common
549
+ denominator" character set possible. For example, if a body contains
550
+ only US-ASCII characters, it SHOULD be marked as being in the US-
551
+ ASCII character set, not ISO-8859-1, which, like all the ISO-8859
552
+ family of character sets, is a superset of US-ASCII. More generally,
553
+ if a widely-used character set is a subset of another character set,
554
+ and a body contains only characters in the widely-used subset, it
555
+ should be labelled as being in that subset. This will increase the
556
+ chances that the recipient will be able to view the resulting entity
557
+ correctly.
558
+
559
+
560
+
561
+ Freed & Borenstein Standards Track [Page 10]
562
+
563
+ RFC 2046 Media Types November 1996
564
+
565
+
566
+ 4.1.3. Plain Subtype
567
+
568
+ The simplest and most important subtype of "text" is "plain". This
569
+ indicates plain text that does not contain any formatting commands or
570
+ directives. Plain text is intended to be displayed "as-is", that is,
571
+ no interpretation of embedded formatting commands, font attribute
572
+ specifications, processing instructions, interpretation directives,
573
+ or content markup should be necessary for proper display. The
574
+ default media type of "text/plain; charset=us-ascii" for Internet
575
+ mail describes existing Internet practice. That is, it is the type
576
+ of body defined by RFC 822.
577
+
578
+ No other "text" subtype is defined by this document.
579
+
580
+ 4.1.4. Unrecognized Subtypes
581
+
582
+ Unrecognized subtypes of "text" should be treated as subtype "plain"
583
+ as long as the MIME implementation knows how to handle the charset.
584
+ Unrecognized subtypes which also specify an unrecognized charset
585
+ should be treated as "application/octet- stream".
586
+
587
+ 4.2. Image Media Type
588
+
589
+ A media type of "image" indicates that the body contains an image.
590
+ The subtype names the specific image format. These names are not
591
+ case sensitive. An initial subtype is "jpeg" for the JPEG format
592
+ using JFIF encoding [JPEG].
593
+
594
+ The list of "image" subtypes given here is neither exclusive nor
595
+ exhaustive, and is expected to grow as more types are registered with
596
+ IANA, as described in RFC 2048.
597
+
598
+ Unrecognized subtypes of "image" should at a miniumum be treated as
599
+ "application/octet-stream". Implementations may optionally elect to
600
+ pass subtypes of "image" that they do not specifically recognize to a
601
+ secure and robust general-purpose image viewing application, if such
602
+ an application is available.
603
+
604
+ NOTE: Using of a generic-purpose image viewing application this way
605
+ inherits the security problems of the most dangerous type supported
606
+ by the application.
607
+
608
+ 4.3. Audio Media Type
609
+
610
+ A media type of "audio" indicates that the body contains audio data.
611
+ Although there is not yet a consensus on an "ideal" audio format for
612
+ use with computers, there is a pressing need for a format capable of
613
+ providing interoperable behavior.
614
+
615
+
616
+
617
+ Freed & Borenstein Standards Track [Page 11]
618
+
619
+ RFC 2046 Media Types November 1996
620
+
621
+
622
+ The initial subtype of "basic" is specified to meet this requirement
623
+ by providing an absolutely minimal lowest common denominator audio
624
+ format. It is expected that richer formats for higher quality and/or
625
+ lower bandwidth audio will be defined by a later document.
626
+
627
+ The content of the "audio/basic" subtype is single channel audio
628
+ encoded using 8bit ISDN mu-law [PCM] at a sample rate of 8000 Hz.
629
+
630
+ Unrecognized subtypes of "audio" should at a miniumum be treated as
631
+ "application/octet-stream". Implementations may optionally elect to
632
+ pass subtypes of "audio" that they do not specifically recognize to a
633
+ robust general-purpose audio playing application, if such an
634
+ application is available.
635
+
636
+ 4.4. Video Media Type
637
+
638
+ A media type of "video" indicates that the body contains a time-
639
+ varying-picture image, possibly with color and coordinated sound.
640
+ The term 'video' is used in its most generic sense, rather than with
641
+ reference to any particular technology or format, and is not meant to
642
+ preclude subtypes such as animated drawings encoded compactly. The
643
+ subtype "mpeg" refers to video coded according to the MPEG standard
644
+ [MPEG].
645
+
646
+ Note that although in general this document strongly discourages the
647
+ mixing of multiple media in a single body, it is recognized that many
648
+ so-called video formats include a representation for synchronized
649
+ audio, and this is explicitly permitted for subtypes of "video".
650
+
651
+ Unrecognized subtypes of "video" should at a minumum be treated as
652
+ "application/octet-stream". Implementations may optionally elect to
653
+ pass subtypes of "video" that they do not specifically recognize to a
654
+ robust general-purpose video display application, if such an
655
+ application is available.
656
+
657
+ 4.5. Application Media Type
658
+
659
+ The "application" media type is to be used for discrete data which do
660
+ not fit in any of the other categories, and particularly for data to
661
+ be processed by some type of application program. This is
662
+ information which must be processed by an application before it is
663
+ viewable or usable by a user. Expected uses for the "application"
664
+ media type include file transfer, spreadsheets, data for mail-based
665
+ scheduling systems, and languages for "active" (computational)
666
+ material. (The latter, in particular, can pose security problems
667
+ which must be understood by implementors, and are considered in
668
+ detail in the discussion of the "application/PostScript" media type.)
669
+
670
+
671
+
672
+
673
+ Freed & Borenstein Standards Track [Page 12]
674
+
675
+ RFC 2046 Media Types November 1996
676
+
677
+
678
+ For example, a meeting scheduler might define a standard
679
+ representation for information about proposed meeting dates. An
680
+ intelligent user agent would use this information to conduct a dialog
681
+ with the user, and might then send additional material based on that
682
+ dialog. More generally, there have been several "active" messaging
683
+ languages developed in which programs in a suitably specialized
684
+ language are transported to a remote location and automatically run
685
+ in the recipient's environment.
686
+
687
+ Such applications may be defined as subtypes of the "application"
688
+ media type. This document defines two subtypes:
689
+
690
+ octet-stream, and PostScript.
691
+
692
+ The subtype of "application" will often be either the name or include
693
+ part of the name of the application for which the data are intended.
694
+ This does not mean, however, that any application program name may be
695
+ used freely as a subtype of "application".
696
+
697
+ 4.5.1. Octet-Stream Subtype
698
+
699
+ The "octet-stream" subtype is used to indicate that a body contains
700
+ arbitrary binary data. The set of currently defined parameters is:
701
+
702
+ (1) TYPE -- the general type or category of binary data.
703
+ This is intended as information for the human recipient
704
+ rather than for any automatic processing.
705
+
706
+ (2) PADDING -- the number of bits of padding that were
707
+ appended to the bit-stream comprising the actual
708
+ contents to produce the enclosed 8bit byte-oriented
709
+ data. This is useful for enclosing a bit-stream in a
710
+ body when the total number of bits is not a multiple of
711
+ 8.
712
+
713
+ Both of these parameters are optional.
714
+
715
+ An additional parameter, "CONVERSIONS", was defined in RFC 1341 but
716
+ has since been removed. RFC 1341 also defined the use of a "NAME"
717
+ parameter which gave a suggested file name to be used if the data
718
+ were to be written to a file. This has been deprecated in
719
+ anticipation of a separate Content-Disposition header field, to be
720
+ defined in a subsequent RFC.
721
+
722
+ The recommended action for an implementation that receives an
723
+ "application/octet-stream" entity is to simply offer to put the data
724
+ in a file, with any Content-Transfer-Encoding undone, or perhaps to
725
+ use it as input to a user-specified process.
726
+
727
+
728
+
729
+ Freed & Borenstein Standards Track [Page 13]
730
+
731
+ RFC 2046 Media Types November 1996
732
+
733
+
734
+ To reduce the danger of transmitting rogue programs, it is strongly
735
+ recommended that implementations NOT implement a path-search
736
+ mechanism whereby an arbitrary program named in the Content-Type
737
+ parameter (e.g., an "interpreter=" parameter) is found and executed
738
+ using the message body as input.
739
+
740
+ 4.5.2. PostScript Subtype
741
+
742
+ A media type of "application/postscript" indicates a PostScript
743
+ program. Currently two variants of the PostScript language are
744
+ allowed; the original level 1 variant is described in [POSTSCRIPT]
745
+ and the more recent level 2 variant is described in [POSTSCRIPT2].
746
+
747
+ PostScript is a registered trademark of Adobe Systems, Inc. Use of
748
+ the MIME media type "application/postscript" implies recognition of
749
+ that trademark and all the rights it entails.
750
+
751
+ The PostScript language definition provides facilities for internal
752
+ labelling of the specific language features a given program uses.
753
+ This labelling, called the PostScript document structuring
754
+ conventions, or DSC, is very general and provides substantially more
755
+ information than just the language level. The use of document
756
+ structuring conventions, while not required, is strongly recommended
757
+ as an aid to interoperability. Documents which lack proper
758
+ structuring conventions cannot be tested to see whether or not they
759
+ will work in a given environment. As such, some systems may assume
760
+ the worst and refuse to process unstructured documents.
761
+
762
+ The execution of general-purpose PostScript interpreters entails
763
+ serious security risks, and implementors are discouraged from simply
764
+ sending PostScript bodies to "off- the-shelf" interpreters. While it
765
+ is usually safe to send PostScript to a printer, where the potential
766
+ for harm is greatly constrained by typical printer environments,
767
+ implementors should consider all of the following before they add
768
+ interactive display of PostScript bodies to their MIME readers.
769
+
770
+ The remainder of this section outlines some, though probably not all,
771
+ of the possible problems with the transport of PostScript entities.
772
+
773
+ (1) Dangerous operations in the PostScript language
774
+ include, but may not be limited to, the PostScript
775
+ operators "deletefile", "renamefile", "filenameforall",
776
+ and "file". "File" is only dangerous when applied to
777
+ something other than standard input or output.
778
+ Implementations may also define additional nonstandard
779
+ file operators; these may also pose a threat to
780
+ security. "Filenameforall", the wildcard file search
781
+ operator, may appear at first glance to be harmless.
782
+
783
+
784
+
785
+ Freed & Borenstein Standards Track [Page 14]
786
+
787
+ RFC 2046 Media Types November 1996
788
+
789
+
790
+ Note, however, that this operator has the potential to
791
+ reveal information about what files the recipient has
792
+ access to, and this information may itself be
793
+ sensitive. Message senders should avoid the use of
794
+ potentially dangerous file operators, since these
795
+ operators are quite likely to be unavailable in secure
796
+ PostScript implementations. Message receiving and
797
+ displaying software should either completely disable
798
+ all potentially dangerous file operators or take
799
+ special care not to delegate any special authority to
800
+ their operation. These operators should be viewed as
801
+ being done by an outside agency when interpreting
802
+ PostScript documents. Such disabling and/or checking
803
+ should be done completely outside of the reach of the
804
+ PostScript language itself; care should be taken to
805
+ insure that no method exists for re-enabling full-
806
+ function versions of these operators.
807
+
808
+ (2) The PostScript language provides facilities for exiting
809
+ the normal interpreter, or server, loop. Changes made
810
+ in this "outer" environment are customarily retained
811
+ across documents, and may in some cases be retained
812
+ semipermanently in nonvolatile memory. The operators
813
+ associated with exiting the interpreter loop have the
814
+ potential to interfere with subsequent document
815
+ processing. As such, their unrestrained use
816
+ constitutes a threat of service denial. PostScript
817
+ operators that exit the interpreter loop include, but
818
+ may not be limited to, the exitserver and startjob
819
+ operators. Message sending software should not
820
+ generate PostScript that depends on exiting the
821
+ interpreter loop to operate, since the ability to exit
822
+ will probably be unavailable in secure PostScript
823
+ implementations. Message receiving and displaying
824
+ software should completely disable the ability to make
825
+ retained changes to the PostScript environment by
826
+ eliminating or disabling the "startjob" and
827
+ "exitserver" operations. If these operations cannot be
828
+ eliminated or completely disabled the password
829
+ associated with them should at least be set to a hard-
830
+ to-guess value.
831
+
832
+ (3) PostScript provides operators for setting system-wide
833
+ and device-specific parameters. These parameter
834
+ settings may be retained across jobs and may
835
+ potentially pose a threat to the correct operation of
836
+ the interpreter. The PostScript operators that set
837
+ system and device parameters include, but may not be
838
+
839
+
840
+
841
+ Freed & Borenstein Standards Track [Page 15]
842
+
843
+ RFC 2046 Media Types November 1996
844
+
845
+
846
+ limited to, the "setsystemparams" and "setdevparams"
847
+ operators. Message sending software should not
848
+ generate PostScript that depends on the setting of
849
+ system or device parameters to operate correctly. The
850
+ ability to set these parameters will probably be
851
+ unavailable in secure PostScript implementations.
852
+ Message receiving and displaying software should
853
+ disable the ability to change system and device
854
+ parameters. If these operators cannot be completely
855
+ disabled the password associated with them should at
856
+ least be set to a hard-to-guess value.
857
+
858
+ (4) Some PostScript implementations provide nonstandard
859
+ facilities for the direct loading and execution of
860
+ machine code. Such facilities are quite obviously open
861
+ to substantial abuse. Message sending software should
862
+ not make use of such features. Besides being totally
863
+ hardware-specific, they are also likely to be
864
+ unavailable in secure implementations of PostScript.
865
+ Message receiving and displaying software should not
866
+ allow such operators to be used if they exist.
867
+
868
+ (5) PostScript is an extensible language, and many, if not
869
+ most, implementations of it provide a number of their
870
+ own extensions. This document does not deal with such
871
+ extensions explicitly since they constitute an unknown
872
+ factor. Message sending software should not make use
873
+ of nonstandard extensions; they are likely to be
874
+ missing from some implementations. Message receiving
875
+ and displaying software should make sure that any
876
+ nonstandard PostScript operators are secure and don't
877
+ present any kind of threat.
878
+
879
+ (6) It is possible to write PostScript that consumes huge
880
+ amounts of various system resources. It is also
881
+ possible to write PostScript programs that loop
882
+ indefinitely. Both types of programs have the
883
+ potential to cause damage if sent to unsuspecting
884
+ recipients. Message-sending software should avoid the
885
+ construction and dissemination of such programs, which
886
+ is antisocial. Message receiving and displaying
887
+ software should provide appropriate mechanisms to abort
888
+ processing after a reasonable amount of time has
889
+ elapsed. In addition, PostScript interpreters should be
890
+ limited to the consumption of only a reasonable amount
891
+ of any given system resource.
892
+
893
+
894
+
895
+
896
+
897
+ Freed & Borenstein Standards Track [Page 16]
898
+
899
+ RFC 2046 Media Types November 1996
900
+
901
+
902
+ (7) It is possible to include raw binary information inside
903
+ PostScript in various forms. This is not recommended
904
+ for use in Internet mail, both because it is not
905
+ supported by all PostScript interpreters and because it
906
+ significantly complicates the use of a MIME Content-
907
+ Transfer-Encoding. (Without such binary, PostScript
908
+ may typically be viewed as line-oriented data. The
909
+ treatment of CRLF sequences becomes extremely
910
+ problematic if binary and line-oriented data are mixed
911
+ in a single Postscript data stream.)
912
+
913
+ (8) Finally, bugs may exist in some PostScript interpreters
914
+ which could possibly be exploited to gain unauthorized
915
+ access to a recipient's system. Apart from noting this
916
+ possibility, there is no specific action to take to
917
+ prevent this, apart from the timely correction of such
918
+ bugs if any are found.
919
+
920
+ 4.5.3. Other Application Subtypes
921
+
922
+ It is expected that many other subtypes of "application" will be
923
+ defined in the future. MIME implementations must at a minimum treat
924
+ any unrecognized subtypes as being equivalent to "application/octet-
925
+ stream".
926
+
927
+ 5. Composite Media Type Values
928
+
929
+ The remaining two of the seven initial Content-Type values refer to
930
+ composite entities. Composite entities are handled using MIME
931
+ mechanisms -- a MIME processor typically handles the body directly.
932
+
933
+ 5.1. Multipart Media Type
934
+
935
+ In the case of multipart entities, in which one or more different
936
+ sets of data are combined in a single body, a "multipart" media type
937
+ field must appear in the entity's header. The body must then contain
938
+ one or more body parts, each preceded by a boundary delimiter line,
939
+ and the last one followed by a closing boundary delimiter line.
940
+ After its boundary delimiter line, each body part then consists of a
941
+ header area, a blank line, and a body area. Thus a body part is
942
+ similar to an RFC 822 message in syntax, but different in meaning.
943
+
944
+ A body part is an entity and hence is NOT to be interpreted as
945
+ actually being an RFC 822 message. To begin with, NO header fields
946
+ are actually required in body parts. A body part that starts with a
947
+ blank line, therefore, is allowed and is a body part for which all
948
+ default values are to be assumed. In such a case, the absence of a
949
+ Content-Type header usually indicates that the corresponding body has
950
+
951
+
952
+
953
+ Freed & Borenstein Standards Track [Page 17]
954
+
955
+ RFC 2046 Media Types November 1996
956
+
957
+
958
+ a content-type of "text/plain; charset=US-ASCII".
959
+
960
+ The only header fields that have defined meaning for body parts are
961
+ those the names of which begin with "Content-". All other header
962
+ fields may be ignored in body parts. Although they should generally
963
+ be retained if at all possible, they may be discarded by gateways if
964
+ necessary. Such other fields are permitted to appear in body parts
965
+ but must not be depended on. "X-" fields may be created for
966
+ experimental or private purposes, with the recognition that the
967
+ information they contain may be lost at some gateways.
968
+
969
+ NOTE: The distinction between an RFC 822 message and a body part is
970
+ subtle, but important. A gateway between Internet and X.400 mail,
971
+ for example, must be able to tell the difference between a body part
972
+ that contains an image and a body part that contains an encapsulated
973
+ message, the body of which is a JPEG image. In order to represent
974
+ the latter, the body part must have "Content-Type: message/rfc822",
975
+ and its body (after the blank line) must be the encapsulated message,
976
+ with its own "Content-Type: image/jpeg" header field. The use of
977
+ similar syntax facilitates the conversion of messages to body parts,
978
+ and vice versa, but the distinction between the two must be
979
+ understood by implementors. (For the special case in which parts
980
+ actually are messages, a "digest" subtype is also defined.)
981
+
982
+ As stated previously, each body part is preceded by a boundary
983
+ delimiter line that contains the boundary delimiter. The boundary
984
+ delimiter MUST NOT appear inside any of the encapsulated parts, on a
985
+ line by itself or as the prefix of any line. This implies that it is
986
+ crucial that the composing agent be able to choose and specify a
987
+ unique boundary parameter value that does not contain the boundary
988
+ parameter value of an enclosing multipart as a prefix.
989
+
990
+ All present and future subtypes of the "multipart" type must use an
991
+ identical syntax. Subtypes may differ in their semantics, and may
992
+ impose additional restrictions on syntax, but must conform to the
993
+ required syntax for the "multipart" type. This requirement ensures
994
+ that all conformant user agents will at least be able to recognize
995
+ and separate the parts of any multipart entity, even those of an
996
+ unrecognized subtype.
997
+
998
+ As stated in the definition of the Content-Transfer-Encoding field
999
+ [RFC 2045], no encoding other than "7bit", "8bit", or "binary" is
1000
+ permitted for entities of type "multipart". The "multipart" boundary
1001
+ delimiters and header fields are always represented as 7bit US-ASCII
1002
+ in any case (though the header fields may encode non-US-ASCII header
1003
+ text as per RFC 2047) and data within the body parts can be encoded
1004
+ on a part-by-part basis, with Content-Transfer-Encoding fields for
1005
+ each appropriate body part.
1006
+
1007
+
1008
+
1009
+ Freed & Borenstein Standards Track [Page 18]
1010
+
1011
+ RFC 2046 Media Types November 1996
1012
+
1013
+
1014
+ 5.1.1. Common Syntax
1015
+
1016
+ This section defines a common syntax for subtypes of "multipart".
1017
+ All subtypes of "multipart" must use this syntax. A simple example
1018
+ of a multipart message also appears in this section. An example of a
1019
+ more complex multipart message is given in RFC 2049.
1020
+
1021
+ The Content-Type field for multipart entities requires one parameter,
1022
+ "boundary". The boundary delimiter line is then defined as a line
1023
+ consisting entirely of two hyphen characters ("-", decimal value 45)
1024
+ followed by the boundary parameter value from the Content-Type header
1025
+ field, optional linear whitespace, and a terminating CRLF.
1026
+
1027
+ NOTE: The hyphens are for rough compatibility with the earlier RFC
1028
+ 934 method of message encapsulation, and for ease of searching for
1029
+ the boundaries in some implementations. However, it should be noted
1030
+ that multipart messages are NOT completely compatible with RFC 934
1031
+ encapsulations; in particular, they do not obey RFC 934 quoting
1032
+ conventions for embedded lines that begin with hyphens. This
1033
+ mechanism was chosen over the RFC 934 mechanism because the latter
1034
+ causes lines to grow with each level of quoting. The combination of
1035
+ this growth with the fact that SMTP implementations sometimes wrap
1036
+ long lines made the RFC 934 mechanism unsuitable for use in the event
1037
+ that deeply-nested multipart structuring is ever desired.
1038
+
1039
+ WARNING TO IMPLEMENTORS: The grammar for parameters on the Content-
1040
+ type field is such that it is often necessary to enclose the boundary
1041
+ parameter values in quotes on the Content-type line. This is not
1042
+ always necessary, but never hurts. Implementors should be sure to
1043
+ study the grammar carefully in order to avoid producing invalid
1044
+ Content-type fields. Thus, a typical "multipart" Content-Type header
1045
+ field might look like this:
1046
+
1047
+ Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p
1048
+
1049
+ But the following is not valid:
1050
+
1051
+ Content-Type: multipart/mixed; boundary=gc0pJq0M:08jU534c0p
1052
+
1053
+ (because of the colon) and must instead be represented as
1054
+
1055
+ Content-Type: multipart/mixed; boundary="gc0pJq0M:08jU534c0p"
1056
+
1057
+ This Content-Type value indicates that the content consists of one or
1058
+ more parts, each with a structure that is syntactically identical to
1059
+ an RFC 822 message, except that the header area is allowed to be
1060
+ completely empty, and that the parts are each preceded by the line
1061
+
1062
+
1063
+
1064
+
1065
+ Freed & Borenstein Standards Track [Page 19]
1066
+
1067
+ RFC 2046 Media Types November 1996
1068
+
1069
+
1070
+ --gc0pJq0M:08jU534c0p
1071
+
1072
+ The boundary delimiter MUST occur at the beginning of a line, i.e.,
1073
+ following a CRLF, and the initial CRLF is considered to be attached
1074
+ to the boundary delimiter line rather than part of the preceding
1075
+ part. The boundary may be followed by zero or more characters of
1076
+ linear whitespace. It is then terminated by either another CRLF and
1077
+ the header fields for the next part, or by two CRLFs, in which case
1078
+ there are no header fields for the next part. If no Content-Type
1079
+ field is present it is assumed to be "message/rfc822" in a
1080
+ "multipart/digest" and "text/plain" otherwise.
1081
+
1082
+ NOTE: The CRLF preceding the boundary delimiter line is conceptually
1083
+ attached to the boundary so that it is possible to have a part that
1084
+ does not end with a CRLF (line break). Body parts that must be
1085
+ considered to end with line breaks, therefore, must have two CRLFs
1086
+ preceding the boundary delimiter line, the first of which is part of
1087
+ the preceding body part, and the second of which is part of the
1088
+ encapsulation boundary.
1089
+
1090
+ Boundary delimiters must not appear within the encapsulated material,
1091
+ and must be no longer than 70 characters, not counting the two
1092
+ leading hyphens.
1093
+
1094
+ The boundary delimiter line following the last body part is a
1095
+ distinguished delimiter that indicates that no further body parts
1096
+ will follow. Such a delimiter line is identical to the previous
1097
+ delimiter lines, with the addition of two more hyphens after the
1098
+ boundary parameter value.
1099
+
1100
+ --gc0pJq0M:08jU534c0p--
1101
+
1102
+ NOTE TO IMPLEMENTORS: Boundary string comparisons must compare the
1103
+ boundary value with the beginning of each candidate line. An exact
1104
+ match of the entire candidate line is not required; it is sufficient
1105
+ that the boundary appear in its entirety following the CRLF.
1106
+
1107
+ There appears to be room for additional information prior to the
1108
+ first boundary delimiter line and following the final boundary
1109
+ delimiter line. These areas should generally be left blank, and
1110
+ implementations must ignore anything that appears before the first
1111
+ boundary delimiter line or after the last one.
1112
+
1113
+ NOTE: These "preamble" and "epilogue" areas are generally not used
1114
+ because of the lack of proper typing of these parts and the lack of
1115
+ clear semantics for handling these areas at gateways, particularly
1116
+ X.400 gateways. However, rather than leaving the preamble area
1117
+ blank, many MIME implementations have found this to be a convenient
1118
+
1119
+
1120
+
1121
+ Freed & Borenstein Standards Track [Page 20]
1122
+
1123
+ RFC 2046 Media Types November 1996
1124
+
1125
+
1126
+ place to insert an explanatory note for recipients who read the
1127
+ message with pre-MIME software, since such notes will be ignored by
1128
+ MIME-compliant software.
1129
+
1130
+ NOTE: Because boundary delimiters must not appear in the body parts
1131
+ being encapsulated, a user agent must exercise care to choose a
1132
+ unique boundary parameter value. The boundary parameter value in the
1133
+ example above could have been the result of an algorithm designed to
1134
+ produce boundary delimiters with a very low probability of already
1135
+ existing in the data to be encapsulated without having to prescan the
1136
+ data. Alternate algorithms might result in more "readable" boundary
1137
+ delimiters for a recipient with an old user agent, but would require
1138
+ more attention to the possibility that the boundary delimiter might
1139
+ appear at the beginning of some line in the encapsulated part. The
1140
+ simplest boundary delimiter line possible is something like "---",
1141
+ with a closing boundary delimiter line of "-----".
1142
+
1143
+ As a very simple example, the following multipart message has two
1144
+ parts, both of them plain text, one of them explicitly typed and one
1145
+ of them implicitly typed:
1146
+
1147
+ From: Nathaniel Borenstein <nsb@bellcore.com>
1148
+ To: Ned Freed <ned@innosoft.com>
1149
+ Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)
1150
+ Subject: Sample message
1151
+ MIME-Version: 1.0
1152
+ Content-type: multipart/mixed; boundary="simple boundary"
1153
+
1154
+ This is the preamble. It is to be ignored, though it
1155
+ is a handy place for composition agents to include an
1156
+ explanatory note to non-MIME conformant readers.
1157
+
1158
+ --simple boundary
1159
+
1160
+ This is implicitly typed plain US-ASCII text.
1161
+ It does NOT end with a linebreak.
1162
+ --simple boundary
1163
+ Content-type: text/plain; charset=us-ascii
1164
+
1165
+ This is explicitly typed plain US-ASCII text.
1166
+ It DOES end with a linebreak.
1167
+
1168
+ --simple boundary--
1169
+
1170
+ This is the epilogue. It is also to be ignored.
1171
+
1172
+
1173
+
1174
+
1175
+
1176
+
1177
+ Freed & Borenstein Standards Track [Page 21]
1178
+
1179
+ RFC 2046 Media Types November 1996
1180
+
1181
+
1182
+ The use of a media type of "multipart" in a body part within another
1183
+ "multipart" entity is explicitly allowed. In such cases, for obvious
1184
+ reasons, care must be taken to ensure that each nested "multipart"
1185
+ entity uses a different boundary delimiter. See RFC 2049 for an
1186
+ example of nested "multipart" entities.
1187
+
1188
+ The use of the "multipart" media type with only a single body part
1189
+ may be useful in certain contexts, and is explicitly permitted.
1190
+
1191
+ NOTE: Experience has shown that a "multipart" media type with a
1192
+ single body part is useful for sending non-text media types. It has
1193
+ the advantage of providing the preamble as a place to include
1194
+ decoding instructions. In addition, a number of SMTP gateways move
1195
+ or remove the MIME headers, and a clever MIME decoder can take a good
1196
+ guess at multipart boundaries even in the absence of the Content-Type
1197
+ header and thereby successfully decode the message.
1198
+
1199
+ The only mandatory global parameter for the "multipart" media type is
1200
+ the boundary parameter, which consists of 1 to 70 characters from a
1201
+ set of characters known to be very robust through mail gateways, and
1202
+ NOT ending with white space. (If a boundary delimiter line appears to
1203
+ end with white space, the white space must be presumed to have been
1204
+ added by a gateway, and must be deleted.) It is formally specified
1205
+ by the following BNF:
1206
+
1207
+ boundary := 0*69<bchars> bcharsnospace
1208
+
1209
+ bchars := bcharsnospace / " "
1210
+
1211
+ bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" /
1212
+ "+" / "_" / "," / "-" / "." /
1213
+ "/" / ":" / "=" / "?"
1214
+
1215
+ Overall, the body of a "multipart" entity may be specified as
1216
+ follows:
1217
+
1218
+ dash-boundary := "--" boundary
1219
+ ; boundary taken from the value of
1220
+ ; boundary parameter of the
1221
+ ; Content-Type field.
1222
+
1223
+ multipart-body := [preamble CRLF]
1224
+ dash-boundary transport-padding CRLF
1225
+ body-part *encapsulation
1226
+ close-delimiter transport-padding
1227
+ [CRLF epilogue]
1228
+
1229
+
1230
+
1231
+
1232
+
1233
+ Freed & Borenstein Standards Track [Page 22]
1234
+
1235
+ RFC 2046 Media Types November 1996
1236
+
1237
+
1238
+ transport-padding := *LWSP-char
1239
+ ; Composers MUST NOT generate
1240
+ ; non-zero length transport
1241
+ ; padding, but receivers MUST
1242
+ ; be able to handle padding
1243
+ ; added by message transports.
1244
+
1245
+ encapsulation := delimiter transport-padding
1246
+ CRLF body-part
1247
+
1248
+ delimiter := CRLF dash-boundary
1249
+
1250
+ close-delimiter := delimiter "--"
1251
+
1252
+ preamble := discard-text
1253
+
1254
+ epilogue := discard-text
1255
+
1256
+ discard-text := *(*text CRLF) *text
1257
+ ; May be ignored or discarded.
1258
+
1259
+ body-part := MIME-part-headers [CRLF *OCTET]
1260
+ ; Lines in a body-part must not start
1261
+ ; with the specified dash-boundary and
1262
+ ; the delimiter must not appear anywhere
1263
+ ; in the body part. Note that the
1264
+ ; semantics of a body-part differ from
1265
+ ; the semantics of a message, as
1266
+ ; described in the text.
1267
+
1268
+ OCTET := <any 0-255 octet value>
1269
+
1270
+ IMPORTANT: The free insertion of linear-white-space and RFC 822
1271
+ comments between the elements shown in this BNF is NOT allowed since
1272
+ this BNF does not specify a structured header field.
1273
+
1274
+ NOTE: In certain transport enclaves, RFC 822 restrictions such as
1275
+ the one that limits bodies to printable US-ASCII characters may not
1276
+ be in force. (That is, the transport domains may exist that resemble
1277
+ standard Internet mail transport as specified in RFC 821 and assumed
1278
+ by RFC 822, but without certain restrictions.) The relaxation of
1279
+ these restrictions should be construed as locally extending the
1280
+ definition of bodies, for example to include octets outside of the
1281
+ US-ASCII range, as long as these extensions are supported by the
1282
+ transport and adequately documented in the Content- Transfer-Encoding
1283
+ header field. However, in no event are headers (either message
1284
+ headers or body part headers) allowed to contain anything other than
1285
+ US-ASCII characters.
1286
+
1287
+
1288
+
1289
+ Freed & Borenstein Standards Track [Page 23]
1290
+
1291
+ RFC 2046 Media Types November 1996
1292
+
1293
+
1294
+ NOTE: Conspicuously missing from the "multipart" type is a notion of
1295
+ structured, related body parts. It is recommended that those wishing
1296
+ to provide more structured or integrated multipart messaging
1297
+ facilities should define subtypes of multipart that are syntactically
1298
+ identical but define relationships between the various parts. For
1299
+ example, subtypes of multipart could be defined that include a
1300
+ distinguished part which in turn is used to specify the relationships
1301
+ between the other parts, probably referring to them by their
1302
+ Content-ID field. Old implementations will not recognize the new
1303
+ subtype if this approach is used, but will treat it as
1304
+ multipart/mixed and will thus be able to show the user the parts that
1305
+ are recognized.
1306
+
1307
+ 5.1.2. Handling Nested Messages and Multiparts
1308
+
1309
+ The "message/rfc822" subtype defined in a subsequent section of this
1310
+ document has no terminating condition other than running out of data.
1311
+ Similarly, an improperly truncated "multipart" entity may not have
1312
+ any terminating boundary marker, and can turn up operationally due to
1313
+ mail system malfunctions.
1314
+
1315
+ It is essential that such entities be handled correctly when they are
1316
+ themselves imbedded inside of another "multipart" structure. MIME
1317
+ implementations are therefore required to recognize outer level
1318
+ boundary markers at ANY level of inner nesting. It is not sufficient
1319
+ to only check for the next expected marker or other terminating
1320
+ condition.
1321
+
1322
+ 5.1.3. Mixed Subtype
1323
+
1324
+ The "mixed" subtype of "multipart" is intended for use when the body
1325
+ parts are independent and need to be bundled in a particular order.
1326
+ Any "multipart" subtypes that an implementation does not recognize
1327
+ must be treated as being of subtype "mixed".
1328
+
1329
+ 5.1.4. Alternative Subtype
1330
+
1331
+ The "multipart/alternative" type is syntactically identical to
1332
+ "multipart/mixed", but the semantics are different. In particular,
1333
+ each of the body parts is an "alternative" version of the same
1334
+ information.
1335
+
1336
+ Systems should recognize that the content of the various parts are
1337
+ interchangeable. Systems should choose the "best" type based on the
1338
+ local environment and references, in some cases even through user
1339
+ interaction. As with "multipart/mixed", the order of body parts is
1340
+ significant. In this case, the alternatives appear in an order of
1341
+ increasing faithfulness to the original content. In general, the
1342
+
1343
+
1344
+
1345
+ Freed & Borenstein Standards Track [Page 24]
1346
+
1347
+ RFC 2046 Media Types November 1996
1348
+
1349
+
1350
+ best choice is the LAST part of a type supported by the recipient
1351
+ system's local environment.
1352
+
1353
+ "Multipart/alternative" may be used, for example, to send a message
1354
+ in a fancy text format in such a way that it can easily be displayed
1355
+ anywhere:
1356
+
1357
+ From: Nathaniel Borenstein <nsb@bellcore.com>
1358
+ To: Ned Freed <ned@innosoft.com>
1359
+ Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST)
1360
+ Subject: Formatted text mail
1361
+ MIME-Version: 1.0
1362
+ Content-Type: multipart/alternative; boundary=boundary42
1363
+
1364
+ --boundary42
1365
+ Content-Type: text/plain; charset=us-ascii
1366
+
1367
+ ... plain text version of message goes here ...
1368
+
1369
+ --boundary42
1370
+ Content-Type: text/enriched
1371
+
1372
+ ... RFC 1896 text/enriched version of same message
1373
+ goes here ...
1374
+
1375
+ --boundary42
1376
+ Content-Type: application/x-whatever
1377
+
1378
+ ... fanciest version of same message goes here ...
1379
+
1380
+ --boundary42--
1381
+
1382
+ In this example, users whose mail systems understood the
1383
+ "application/x-whatever" format would see only the fancy version,
1384
+ while other users would see only the enriched or plain text version,
1385
+ depending on the capabilities of their system.
1386
+
1387
+ In general, user agents that compose "multipart/alternative" entities
1388
+ must place the body parts in increasing order of preference, that is,
1389
+ with the preferred format last. For fancy text, the sending user
1390
+ agent should put the plainest format first and the richest format
1391
+ last. Receiving user agents should pick and display the last format
1392
+ they are capable of displaying. In the case where one of the
1393
+ alternatives is itself of type "multipart" and contains unrecognized
1394
+ sub-parts, the user agent may choose either to show that alternative,
1395
+ an earlier alternative, or both.
1396
+
1397
+
1398
+
1399
+
1400
+
1401
+ Freed & Borenstein Standards Track [Page 25]
1402
+
1403
+ RFC 2046 Media Types November 1996
1404
+
1405
+
1406
+ NOTE: From an implementor's perspective, it might seem more sensible
1407
+ to reverse this ordering, and have the plainest alternative last.
1408
+ However, placing the plainest alternative first is the friendliest
1409
+ possible option when "multipart/alternative" entities are viewed
1410
+ using a non-MIME-conformant viewer. While this approach does impose
1411
+ some burden on conformant MIME viewers, interoperability with older
1412
+ mail readers was deemed to be more important in this case.
1413
+
1414
+ It may be the case that some user agents, if they can recognize more
1415
+ than one of the formats, will prefer to offer the user the choice of
1416
+ which format to view. This makes sense, for example, if a message
1417
+ includes both a nicely- formatted image version and an easily-edited
1418
+ text version. What is most critical, however, is that the user not
1419
+ automatically be shown multiple versions of the same data. Either
1420
+ the user should be shown the last recognized version or should be
1421
+ given the choice.
1422
+
1423
+ THE SEMANTICS OF CONTENT-ID IN MULTIPART/ALTERNATIVE: Each part of a
1424
+ "multipart/alternative" entity represents the same data, but the
1425
+ mappings between the two are not necessarily without information
1426
+ loss. For example, information is lost when translating ODA to
1427
+ PostScript or plain text. It is recommended that each part should
1428
+ have a different Content-ID value in the case where the information
1429
+ content of the two parts is not identical. And when the information
1430
+ content is identical -- for example, where several parts of type
1431
+ "message/external-body" specify alternate ways to access the
1432
+ identical data -- the same Content-ID field value should be used, to
1433
+ optimize any caching mechanisms that might be present on the
1434
+ recipient's end. However, the Content-ID values used by the parts
1435
+ should NOT be the same Content-ID value that describes the
1436
+ "multipart/alternative" as a whole, if there is any such Content-ID
1437
+ field. That is, one Content-ID value will refer to the
1438
+ "multipart/alternative" entity, while one or more other Content-ID
1439
+ values will refer to the parts inside it.
1440
+
1441
+ 5.1.5. Digest Subtype
1442
+
1443
+ This document defines a "digest" subtype of the "multipart" Content-
1444
+ Type. This type is syntactically identical to "multipart/mixed", but
1445
+ the semantics are different. In particular, in a digest, the default
1446
+ Content-Type value for a body part is changed from "text/plain" to
1447
+ "message/rfc822". This is done to allow a more readable digest
1448
+ format that is largely compatible (except for the quoting convention)
1449
+ with RFC 934.
1450
+
1451
+ Note: Though it is possible to specify a Content-Type value for a
1452
+ body part in a digest which is other than "message/rfc822", such as a
1453
+ "text/plain" part containing a description of the material in the
1454
+
1455
+
1456
+
1457
+ Freed & Borenstein Standards Track [Page 26]
1458
+
1459
+ RFC 2046 Media Types November 1996
1460
+
1461
+
1462
+ digest, actually doing so is undesireble. The "multipart/digest"
1463
+ Content-Type is intended to be used to send collections of messages.
1464
+ If a "text/plain" part is needed, it should be included as a seperate
1465
+ part of a "multipart/mixed" message.
1466
+
1467
+ A digest in this format might, then, look something like this:
1468
+
1469
+ From: Moderator-Address
1470
+ To: Recipient-List
1471
+ Date: Mon, 22 Mar 1994 13:34:51 +0000
1472
+ Subject: Internet Digest, volume 42
1473
+ MIME-Version: 1.0
1474
+ Content-Type: multipart/mixed;
1475
+ boundary="---- main boundary ----"
1476
+
1477
+ ------ main boundary ----
1478
+
1479
+ ...Introductory text or table of contents...
1480
+
1481
+ ------ main boundary ----
1482
+ Content-Type: multipart/digest;
1483
+ boundary="---- next message ----"
1484
+
1485
+ ------ next message ----
1486
+
1487
+ From: someone-else
1488
+ Date: Fri, 26 Mar 1993 11:13:32 +0200
1489
+ Subject: my opinion
1490
+
1491
+ ...body goes here ...
1492
+
1493
+ ------ next message ----
1494
+
1495
+ From: someone-else-again
1496
+ Date: Fri, 26 Mar 1993 10:07:13 -0500
1497
+ Subject: my different opinion
1498
+
1499
+ ... another body goes here ...
1500
+
1501
+ ------ next message ------
1502
+
1503
+ ------ main boundary ------
1504
+
1505
+ 5.1.6. Parallel Subtype
1506
+
1507
+ This document defines a "parallel" subtype of the "multipart"
1508
+ Content-Type. This type is syntactically identical to
1509
+ "multipart/mixed", but the semantics are different. In particular,
1510
+
1511
+
1512
+
1513
+ Freed & Borenstein Standards Track [Page 27]
1514
+
1515
+ RFC 2046 Media Types November 1996
1516
+
1517
+
1518
+ in a parallel entity, the order of body parts is not significant.
1519
+
1520
+ A common presentation of this type is to display all of the parts
1521
+ simultaneously on hardware and software that are capable of doing so.
1522
+ However, composing agents should be aware that many mail readers will
1523
+ lack this capability and will show the parts serially in any event.
1524
+
1525
+ 5.1.7. Other Multipart Subtypes
1526
+
1527
+ Other "multipart" subtypes are expected in the future. MIME
1528
+ implementations must in general treat unrecognized subtypes of
1529
+ "multipart" as being equivalent to "multipart/mixed".
1530
+
1531
+ 5.2. Message Media Type
1532
+
1533
+ It is frequently desirable, in sending mail, to encapsulate another
1534
+ mail message. A special media type, "message", is defined to
1535
+ facilitate this. In particular, the "rfc822" subtype of "message" is
1536
+ used to encapsulate RFC 822 messages.
1537
+
1538
+ NOTE: It has been suggested that subtypes of "message" might be
1539
+ defined for forwarded or rejected messages. However, forwarded and
1540
+ rejected messages can be handled as multipart messages in which the
1541
+ first part contains any control or descriptive information, and a
1542
+ second part, of type "message/rfc822", is the forwarded or rejected
1543
+ message. Composing rejection and forwarding messages in this manner
1544
+ will preserve the type information on the original message and allow
1545
+ it to be correctly presented to the recipient, and hence is strongly
1546
+ encouraged.
1547
+
1548
+ Subtypes of "message" often impose restrictions on what encodings are
1549
+ allowed. These restrictions are described in conjunction with each
1550
+ specific subtype.
1551
+
1552
+ Mail gateways, relays, and other mail handling agents are commonly
1553
+ known to alter the top-level header of an RFC 822 message. In
1554
+ particular, they frequently add, remove, or reorder header fields.
1555
+ These operations are explicitly forbidden for the encapsulated
1556
+ headers embedded in the bodies of messages of type "message."
1557
+
1558
+ 5.2.1. RFC822 Subtype
1559
+
1560
+ A media type of "message/rfc822" indicates that the body contains an
1561
+ encapsulated message, with the syntax of an RFC 822 message.
1562
+ However, unlike top-level RFC 822 messages, the restriction that each
1563
+ "message/rfc822" body must include a "From", "Date", and at least one
1564
+ destination header is removed and replaced with the requirement that
1565
+ at least one of "From", "Subject", or "Date" must be present.
1566
+
1567
+
1568
+
1569
+ Freed & Borenstein Standards Track [Page 28]
1570
+
1571
+ RFC 2046 Media Types November 1996
1572
+
1573
+
1574
+ It should be noted that, despite the use of the numbers "822", a
1575
+ "message/rfc822" entity isn't restricted to material in strict
1576
+ conformance to RFC822, nor are the semantics of "message/rfc822"
1577
+ objects restricted to the semantics defined in RFC822. More
1578
+ specifically, a "message/rfc822" message could well be a News article
1579
+ or a MIME message.
1580
+
1581
+ No encoding other than "7bit", "8bit", or "binary" is permitted for
1582
+ the body of a "message/rfc822" entity. The message header fields are
1583
+ always US-ASCII in any case, and data within the body can still be
1584
+ encoded, in which case the Content-Transfer-Encoding header field in
1585
+ the encapsulated message will reflect this. Non-US-ASCII text in the
1586
+ headers of an encapsulated message can be specified using the
1587
+ mechanisms described in RFC 2047.
1588
+
1589
+ 5.2.2. Partial Subtype
1590
+
1591
+ The "partial" subtype is defined to allow large entities to be
1592
+ delivered as several separate pieces of mail and automatically
1593
+ reassembled by a receiving user agent. (The concept is similar to IP
1594
+ fragmentation and reassembly in the basic Internet Protocols.) This
1595
+ mechanism can be used when intermediate transport agents limit the
1596
+ size of individual messages that can be sent. The media type
1597
+ "message/partial" thus indicates that the body contains a fragment of
1598
+ a larger entity.
1599
+
1600
+ Because data of type "message" may never be encoded in base64 or
1601
+ quoted-printable, a problem might arise if "message/partial" entities
1602
+ are constructed in an environment that supports binary or 8bit
1603
+ transport. The problem is that the binary data would be split into
1604
+ multiple "message/partial" messages, each of them requiring binary
1605
+ transport. If such messages were encountered at a gateway into a
1606
+ 7bit transport environment, there would be no way to properly encode
1607
+ them for the 7bit world, aside from waiting for all of the fragments,
1608
+ reassembling the inner message, and then encoding the reassembled
1609
+ data in base64 or quoted-printable. Since it is possible that
1610
+ different fragments might go through different gateways, even this is
1611
+ not an acceptable solution. For this reason, it is specified that
1612
+ entities of type "message/partial" must always have a content-
1613
+ transfer-encoding of 7bit (the default). In particular, even in
1614
+ environments that support binary or 8bit transport, the use of a
1615
+ content- transfer-encoding of "8bit" or "binary" is explicitly
1616
+ prohibited for MIME entities of type "message/partial". This in turn
1617
+ implies that the inner message must not use "8bit" or "binary"
1618
+ encoding.
1619
+
1620
+
1621
+
1622
+
1623
+
1624
+
1625
+ Freed & Borenstein Standards Track [Page 29]
1626
+
1627
+ RFC 2046 Media Types November 1996
1628
+
1629
+
1630
+ Because some message transfer agents may choose to automatically
1631
+ fragment large messages, and because such agents may use very
1632
+ different fragmentation thresholds, it is possible that the pieces of
1633
+ a partial message, upon reassembly, may prove themselves to comprise
1634
+ a partial message. This is explicitly permitted.
1635
+
1636
+ Three parameters must be specified in the Content-Type field of type
1637
+ "message/partial": The first, "id", is a unique identifier, as close
1638
+ to a world-unique identifier as possible, to be used to match the
1639
+ fragments together. (In general, the identifier is essentially a
1640
+ message-id; if placed in double quotes, it can be ANY message-id, in
1641
+ accordance with the BNF for "parameter" given in RFC 2045.) The
1642
+ second, "number", an integer, is the fragment number, which indicates
1643
+ where this fragment fits into the sequence of fragments. The third,
1644
+ "total", another integer, is the total number of fragments. This
1645
+ third subfield is required on the final fragment, and is optional
1646
+ (though encouraged) on the earlier fragments. Note also that these
1647
+ parameters may be given in any order.
1648
+
1649
+ Thus, the second piece of a 3-piece message may have either of the
1650
+ following header fields:
1651
+
1652
+ Content-Type: Message/Partial; number=2; total=3;
1653
+ id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
1654
+
1655
+ Content-Type: Message/Partial;
1656
+ id="oc=jpbe0M2Yt4s@thumper.bellcore.com";
1657
+ number=2
1658
+
1659
+ But the third piece MUST specify the total number of fragments:
1660
+
1661
+ Content-Type: Message/Partial; number=3; total=3;
1662
+ id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
1663
+
1664
+ Note that fragment numbering begins with 1, not 0.
1665
+
1666
+ When the fragments of an entity broken up in this manner are put
1667
+ together, the result is always a complete MIME entity, which may have
1668
+ its own Content-Type header field, and thus may contain any other
1669
+ data type.
1670
+
1671
+ 5.2.2.1. Message Fragmentation and Reassembly
1672
+
1673
+ The semantics of a reassembled partial message must be those of the
1674
+ "inner" message, rather than of a message containing the inner
1675
+ message. This makes it possible, for example, to send a large audio
1676
+ message as several partial messages, and still have it appear to the
1677
+ recipient as a simple audio message rather than as an encapsulated
1678
+
1679
+
1680
+
1681
+ Freed & Borenstein Standards Track [Page 30]
1682
+
1683
+ RFC 2046 Media Types November 1996
1684
+
1685
+
1686
+ message containing an audio message. That is, the encapsulation of
1687
+ the message is considered to be "transparent".
1688
+
1689
+ When generating and reassembling the pieces of a "message/partial"
1690
+ message, the headers of the encapsulated message must be merged with
1691
+ the headers of the enclosing entities. In this process the following
1692
+ rules must be observed:
1693
+
1694
+ (1) Fragmentation agents must split messages at line
1695
+ boundaries only. This restriction is imposed because
1696
+ splits at points other than the ends of lines in turn
1697
+ depends on message transports being able to preserve
1698
+ the semantics of messages that don't end with a CRLF
1699
+ sequence. Many transports are incapable of preserving
1700
+ such semantics.
1701
+
1702
+ (2) All of the header fields from the initial enclosing
1703
+ message, except those that start with "Content-" and
1704
+ the specific header fields "Subject", "Message-ID",
1705
+ "Encrypted", and "MIME-Version", must be copied, in
1706
+ order, to the new message.
1707
+
1708
+ (3) The header fields in the enclosed message which start
1709
+ with "Content-", plus the "Subject", "Message-ID",
1710
+ "Encrypted", and "MIME-Version" fields, must be
1711
+ appended, in order, to the header fields of the new
1712
+ message. Any header fields in the enclosed message
1713
+ which do not start with "Content-" (except for the
1714
+ "Subject", "Message-ID", "Encrypted", and "MIME-
1715
+ Version" fields) will be ignored and dropped.
1716
+
1717
+ (4) All of the header fields from the second and any
1718
+ subsequent enclosing messages are discarded by the
1719
+ reassembly process.
1720
+
1721
+ 5.2.2.2. Fragmentation and Reassembly Example
1722
+
1723
+ If an audio message is broken into two pieces, the first piece might
1724
+ look something like this:
1725
+
1726
+ X-Weird-Header-1: Foo
1727
+ From: Bill@host.com
1728
+ To: joe@otherhost.com
1729
+ Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST)
1730
+ Subject: Audio mail (part 1 of 2)
1731
+ Message-ID: <id1@host.com>
1732
+ MIME-Version: 1.0
1733
+ Content-type: message/partial; id="ABC@host.com";
1734
+
1735
+
1736
+
1737
+ Freed & Borenstein Standards Track [Page 31]
1738
+
1739
+ RFC 2046 Media Types November 1996
1740
+
1741
+
1742
+ number=1; total=2
1743
+
1744
+ X-Weird-Header-1: Bar
1745
+ X-Weird-Header-2: Hello
1746
+ Message-ID: <anotherid@foo.com>
1747
+ Subject: Audio mail
1748
+ MIME-Version: 1.0
1749
+ Content-type: audio/basic
1750
+ Content-transfer-encoding: base64
1751
+
1752
+ ... first half of encoded audio data goes here ...
1753
+
1754
+ and the second half might look something like this:
1755
+
1756
+ From: Bill@host.com
1757
+ To: joe@otherhost.com
1758
+ Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST)
1759
+ Subject: Audio mail (part 2 of 2)
1760
+ MIME-Version: 1.0
1761
+ Message-ID: <id2@host.com>
1762
+ Content-type: message/partial;
1763
+ id="ABC@host.com"; number=2; total=2
1764
+
1765
+ ... second half of encoded audio data goes here ...
1766
+
1767
+ Then, when the fragmented message is reassembled, the resulting
1768
+ message to be displayed to the user should look something like this:
1769
+
1770
+ X-Weird-Header-1: Foo
1771
+ From: Bill@host.com
1772
+ To: joe@otherhost.com
1773
+ Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST)
1774
+ Subject: Audio mail
1775
+ Message-ID: <anotherid@foo.com>
1776
+ MIME-Version: 1.0
1777
+ Content-type: audio/basic
1778
+ Content-transfer-encoding: base64
1779
+
1780
+ ... first half of encoded audio data goes here ...
1781
+ ... second half of encoded audio data goes here ...
1782
+
1783
+ The inclusion of a "References" field in the headers of the second
1784
+ and subsequent pieces of a fragmented message that references the
1785
+ Message-Id on the previous piece may be of benefit to mail readers
1786
+ that understand and track references. However, the generation of
1787
+ such "References" fields is entirely optional.
1788
+
1789
+
1790
+
1791
+
1792
+
1793
+ Freed & Borenstein Standards Track [Page 32]
1794
+
1795
+ RFC 2046 Media Types November 1996
1796
+
1797
+
1798
+ Finally, it should be noted that the "Encrypted" header field has
1799
+ been made obsolete by Privacy Enhanced Messaging (PEM) [RFC-1421,
1800
+ RFC-1422, RFC-1423, RFC-1424], but the rules above are nevertheless
1801
+ believed to describe the correct way to treat it if it is encountered
1802
+ in the context of conversion to and from "message/partial" fragments.
1803
+
1804
+ 5.2.3. External-Body Subtype
1805
+
1806
+ The external-body subtype indicates that the actual body data are not
1807
+ included, but merely referenced. In this case, the parameters
1808
+ describe a mechanism for accessing the external data.
1809
+
1810
+ When a MIME entity is of type "message/external-body", it consists of
1811
+ a header, two consecutive CRLFs, and the message header for the
1812
+ encapsulated message. If another pair of consecutive CRLFs appears,
1813
+ this of course ends the message header for the encapsulated message.
1814
+ However, since the encapsulated message's body is itself external, it
1815
+ does NOT appear in the area that follows. For example, consider the
1816
+ following message:
1817
+
1818
+ Content-type: message/external-body;
1819
+ access-type=local-file;
1820
+ name="/u/nsb/Me.jpeg"
1821
+
1822
+ Content-type: image/jpeg
1823
+ Content-ID: <id42@guppylake.bellcore.com>
1824
+ Content-Transfer-Encoding: binary
1825
+
1826
+ THIS IS NOT REALLY THE BODY!
1827
+
1828
+ The area at the end, which might be called the "phantom body", is
1829
+ ignored for most external-body messages. However, it may be used to
1830
+ contain auxiliary information for some such messages, as indeed it is
1831
+ when the access-type is "mail- server". The only access-type defined
1832
+ in this document that uses the phantom body is "mail-server", but
1833
+ other access-types may be defined in the future in other
1834
+ specifications that use this area.
1835
+
1836
+ The encapsulated headers in ALL "message/external-body" entities MUST
1837
+ include a Content-ID header field to give a unique identifier by
1838
+ which to reference the data. This identifier may be used for caching
1839
+ mechanisms, and for recognizing the receipt of the data when the
1840
+ access-type is "mail-server".
1841
+
1842
+ Note that, as specified here, the tokens that describe external-body
1843
+ data, such as file names and mail server commands, are required to be
1844
+ in the US-ASCII character set.
1845
+
1846
+
1847
+
1848
+
1849
+ Freed & Borenstein Standards Track [Page 33]
1850
+
1851
+ RFC 2046 Media Types November 1996
1852
+
1853
+
1854
+ If this proves problematic in practice, a new mechanism may be
1855
+ required as a future extension to MIME, either as newly defined
1856
+ access-types for "message/external-body" or by some other mechanism.
1857
+
1858
+ As with "message/partial", MIME entities of type "message/external-
1859
+ body" MUST have a content-transfer-encoding of 7bit (the default).
1860
+ In particular, even in environments that support binary or 8bit
1861
+ transport, the use of a content- transfer-encoding of "8bit" or
1862
+ "binary" is explicitly prohibited for entities of type
1863
+ "message/external-body".
1864
+
1865
+ 5.2.3.1. General External-Body Parameters
1866
+
1867
+ The parameters that may be used with any "message/external- body"
1868
+ are:
1869
+
1870
+ (1) ACCESS-TYPE -- A word indicating the supported access
1871
+ mechanism by which the file or data may be obtained.
1872
+ This word is not case sensitive. Values include, but
1873
+ are not limited to, "FTP", "ANON-FTP", "TFTP", "LOCAL-
1874
+ FILE", and "MAIL-SERVER". Future values, except for
1875
+ experimental values beginning with "X-", must be
1876
+ registered with IANA, as described in RFC 2048.
1877
+ This parameter is unconditionally mandatory and MUST be
1878
+ present on EVERY "message/external-body".
1879
+
1880
+ (2) EXPIRATION -- The date (in the RFC 822 "date-time"
1881
+ syntax, as extended by RFC 1123 to permit 4 digits in
1882
+ the year field) after which the existence of the
1883
+ external data is not guaranteed. This parameter may be
1884
+ used with ANY access-type and is ALWAYS optional.
1885
+
1886
+ (3) SIZE -- The size (in octets) of the data. The intent
1887
+ of this parameter is to help the recipient decide
1888
+ whether or not to expend the necessary resources to
1889
+ retrieve the external data. Note that this describes
1890
+ the size of the data in its canonical form, that is,
1891
+ before any Content-Transfer-Encoding has been applied
1892
+ or after the data have been decoded. This parameter
1893
+ may be used with ANY access-type and is ALWAYS
1894
+ optional.
1895
+
1896
+ (4) PERMISSION -- A case-insensitive field that indicates
1897
+ whether or not it is expected that clients might also
1898
+ attempt to overwrite the data. By default, or if
1899
+ permission is "read", the assumption is that they are
1900
+ not, and that if the data is retrieved once, it is
1901
+ never needed again. If PERMISSION is "read-write",
1902
+
1903
+
1904
+
1905
+ Freed & Borenstein Standards Track [Page 34]
1906
+
1907
+ RFC 2046 Media Types November 1996
1908
+
1909
+
1910
+ this assumption is invalid, and any local copy must be
1911
+ considered no more than a cache. "Read" and "Read-
1912
+ write" are the only defined values of permission. This
1913
+ parameter may be used with ANY access-type and is
1914
+ ALWAYS optional.
1915
+
1916
+ The precise semantics of the access-types defined here are described
1917
+ in the sections that follow.
1918
+
1919
+ 5.2.3.2. The 'ftp' and 'tftp' Access-Types
1920
+
1921
+ An access-type of FTP or TFTP indicates that the message body is
1922
+ accessible as a file using the FTP [RFC-959] or TFTP [RFC- 783]
1923
+ protocols, respectively. For these access-types, the following
1924
+ additional parameters are mandatory:
1925
+
1926
+ (1) NAME -- The name of the file that contains the actual
1927
+ body data.
1928
+
1929
+ (2) SITE -- A machine from which the file may be obtained,
1930
+ using the given protocol. This must be a fully
1931
+ qualified domain name, not a nickname.
1932
+
1933
+ (3) Before any data are retrieved, using FTP, the user will
1934
+ generally need to be asked to provide a login id and a
1935
+ password for the machine named by the site parameter.
1936
+ For security reasons, such an id and password are not
1937
+ specified as content-type parameters, but must be
1938
+ obtained from the user.
1939
+
1940
+ In addition, the following parameters are optional:
1941
+
1942
+ (1) DIRECTORY -- A directory from which the data named by
1943
+ NAME should be retrieved.
1944
+
1945
+ (2) MODE -- A case-insensitive string indicating the mode
1946
+ to be used when retrieving the information. The valid
1947
+ values for access-type "TFTP" are "NETASCII", "OCTET",
1948
+ and "MAIL", as specified by the TFTP protocol [RFC-
1949
+ 783]. The valid values for access-type "FTP" are
1950
+ "ASCII", "EBCDIC", "IMAGE", and "LOCALn" where "n" is a
1951
+ decimal integer, typically 8. These correspond to the
1952
+ representation types "A" "E" "I" and "L n" as specified
1953
+ by the FTP protocol [RFC-959]. Note that "BINARY" and
1954
+ "TENEX" are not valid values for MODE and that "OCTET"
1955
+ or "IMAGE" or "LOCAL8" should be used instead. IF MODE
1956
+ is not specified, the default value is "NETASCII" for
1957
+ TFTP and "ASCII" otherwise.
1958
+
1959
+
1960
+
1961
+ Freed & Borenstein Standards Track [Page 35]
1962
+
1963
+ RFC 2046 Media Types November 1996
1964
+
1965
+
1966
+ 5.2.3.3. The 'anon-ftp' Access-Type
1967
+
1968
+ The "anon-ftp" access-type is identical to the "ftp" access type,
1969
+ except that the user need not be asked to provide a name and password
1970
+ for the specified site. Instead, the ftp protocol will be used with
1971
+ login "anonymous" and a password that corresponds to the user's mail
1972
+ address.
1973
+
1974
+ 5.2.3.4. The 'local-file' Access-Type
1975
+
1976
+ An access-type of "local-file" indicates that the actual body is
1977
+ accessible as a file on the local machine. Two additional parameters
1978
+ are defined for this access type:
1979
+
1980
+ (1) NAME -- The name of the file that contains the actual
1981
+ body data. This parameter is mandatory for the
1982
+ "local-file" access-type.
1983
+
1984
+ (2) SITE -- A domain specifier for a machine or set of
1985
+ machines that are known to have access to the data
1986
+ file. This optional parameter is used to describe the
1987
+ locality of reference for the data, that is, the site
1988
+ or sites at which the file is expected to be visible.
1989
+ Asterisks may be used for wildcard matching to a part
1990
+ of a domain name, such as "*.bellcore.com", to indicate
1991
+ a set of machines on which the data should be directly
1992
+ visible, while a single asterisk may be used to
1993
+ indicate a file that is expected to be universally
1994
+ available, e.g., via a global file system.
1995
+
1996
+ 5.2.3.5. The 'mail-server' Access-Type
1997
+
1998
+ The "mail-server" access-type indicates that the actual body is
1999
+ available from a mail server. Two additional parameters are defined
2000
+ for this access-type:
2001
+
2002
+ (1) SERVER -- The addr-spec of the mail server from which
2003
+ the actual body data can be obtained. This parameter
2004
+ is mandatory for the "mail-server" access-type.
2005
+
2006
+ (2) SUBJECT -- The subject that is to be used in the mail
2007
+ that is sent to obtain the data. Note that keying mail
2008
+ servers on Subject lines is NOT recommended, but such
2009
+ mail servers are known to exist. This is an optional
2010
+ parameter.
2011
+
2012
+
2013
+
2014
+
2015
+
2016
+
2017
+ Freed & Borenstein Standards Track [Page 36]
2018
+
2019
+ RFC 2046 Media Types November 1996
2020
+
2021
+
2022
+ Because mail servers accept a variety of syntaxes, some of which is
2023
+ multiline, the full command to be sent to a mail server is not
2024
+ included as a parameter in the content-type header field. Instead,
2025
+ it is provided as the "phantom body" when the media type is
2026
+ "message/external-body" and the access-type is mail-server.
2027
+
2028
+ Note that MIME does not define a mail server syntax. Rather, it
2029
+ allows the inclusion of arbitrary mail server commands in the phantom
2030
+ body. Implementations must include the phantom body in the body of
2031
+ the message it sends to the mail server address to retrieve the
2032
+ relevant data.
2033
+
2034
+ Unlike other access-types, mail-server access is asynchronous and
2035
+ will happen at an unpredictable time in the future. For this reason,
2036
+ it is important that there be a mechanism by which the returned data
2037
+ can be matched up with the original "message/external-body" entity.
2038
+ MIME mail servers must use the same Content-ID field on the returned
2039
+ message that was used in the original "message/external-body"
2040
+ entities, to facilitate such matching.
2041
+
2042
+ 5.2.3.6. External-Body Security Issues
2043
+
2044
+ "Message/external-body" entities give rise to two important security
2045
+ issues:
2046
+
2047
+ (1) Accessing data via a "message/external-body" reference
2048
+ effectively results in the message recipient performing
2049
+ an operation that was specified by the message
2050
+ originator. It is therefore possible for the message
2051
+ originator to trick a recipient into doing something
2052
+ they would not have done otherwise. For example, an
2053
+ originator could specify a action that attempts
2054
+ retrieval of material that the recipient is not
2055
+ authorized to obtain, causing the recipient to
2056
+ unwittingly violate some security policy. For this
2057
+ reason, user agents capable of resolving external
2058
+ references must always take steps to describe the
2059
+ action they are to take to the recipient and ask for
2060
+ explicit permisssion prior to performing it.
2061
+
2062
+ The 'mail-server' access-type is particularly
2063
+ vulnerable, in that it causes the recipient to send a
2064
+ new message whose contents are specified by the
2065
+ original message's originator. Given the potential for
2066
+ abuse, any such request messages that are constructed
2067
+ should contain a clear indication that they were
2068
+ generated automatically (e.g. in a Comments: header
2069
+ field) in an attempt to resolve a MIME
2070
+
2071
+
2072
+
2073
+ Freed & Borenstein Standards Track [Page 37]
2074
+
2075
+ RFC 2046 Media Types November 1996
2076
+
2077
+
2078
+ "message/external-body" reference.
2079
+
2080
+ (2) MIME will sometimes be used in environments that
2081
+ provide some guarantee of message integrity and
2082
+ authenticity. If present, such guarantees may apply
2083
+ only to the actual direct content of messages -- they
2084
+ may or may not apply to data accessed through MIME's
2085
+ "message/external-body" mechanism. In particular, it
2086
+ may be possible to subvert certain access mechanisms
2087
+ even when the messaging system itself is secure.
2088
+
2089
+ It should be noted that this problem exists either with
2090
+ or without the availabilty of MIME mechanisms. A
2091
+ casual reference to an FTP site containing a document
2092
+ in the text of a secure message brings up similar
2093
+ issues -- the only difference is that MIME provides for
2094
+ automatic retrieval of such material, and users may
2095
+ place unwarranted trust is such automatic retrieval
2096
+ mechanisms.
2097
+
2098
+ 5.2.3.7. Examples and Further Explanations
2099
+
2100
+ When the external-body mechanism is used in conjunction with the
2101
+ "multipart/alternative" media type it extends the functionality of
2102
+ "multipart/alternative" to include the case where the same entity is
2103
+ provided in the same format but via different accces mechanisms.
2104
+ When this is done the originator of the message must order the parts
2105
+ first in terms of preferred formats and then by preferred access
2106
+ mechanisms. The recipient's viewer should then evaluate the list
2107
+ both in terms of format and access mechanisms.
2108
+
2109
+ With the emerging possibility of very wide-area file systems, it
2110
+ becomes very hard to know in advance the set of machines where a file
2111
+ will and will not be accessible directly from the file system.
2112
+ Therefore it may make sense to provide both a file name, to be tried
2113
+ directly, and the name of one or more sites from which the file is
2114
+ known to be accessible. An implementation can try to retrieve remote
2115
+ files using FTP or any other protocol, using anonymous file retrieval
2116
+ or prompting the user for the necessary name and password. If an
2117
+ external body is accessible via multiple mechanisms, the sender may
2118
+ include multiple entities of type "message/external-body" within the
2119
+ body parts of an enclosing "multipart/alternative" entity.
2120
+
2121
+ However, the external-body mechanism is not intended to be limited to
2122
+ file retrieval, as shown by the mail-server access-type. Beyond
2123
+ this, one can imagine, for example, using a video server for external
2124
+ references to video clips.
2125
+
2126
+
2127
+
2128
+
2129
+ Freed & Borenstein Standards Track [Page 38]
2130
+
2131
+ RFC 2046 Media Types November 1996
2132
+
2133
+
2134
+ The embedded message header fields which appear in the body of the
2135
+ "message/external-body" data must be used to declare the media type
2136
+ of the external body if it is anything other than plain US-ASCII
2137
+ text, since the external body does not have a header section to
2138
+ declare its type. Similarly, any Content-transfer-encoding other
2139
+ than "7bit" must also be declared here. Thus a complete
2140
+ "message/external-body" message, referring to an object in PostScript
2141
+ format, might look like this:
2142
+
2143
+ From: Whomever
2144
+ To: Someone
2145
+ Date: Whenever
2146
+ Subject: whatever
2147
+ MIME-Version: 1.0
2148
+ Message-ID: <id1@host.com>
2149
+ Content-Type: multipart/alternative; boundary=42
2150
+ Content-ID: <id001@guppylake.bellcore.com>
2151
+
2152
+ --42
2153
+ Content-Type: message/external-body; name="BodyFormats.ps";
2154
+ site="thumper.bellcore.com"; mode="image";
2155
+ access-type=ANON-FTP; directory="pub";
2156
+ expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
2157
+
2158
+ Content-type: application/postscript
2159
+ Content-ID: <id42@guppylake.bellcore.com>
2160
+
2161
+ --42
2162
+ Content-Type: message/external-body; access-type=local-file;
2163
+ name="/u/nsb/writing/rfcs/RFC-MIME.ps";
2164
+ site="thumper.bellcore.com";
2165
+ expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
2166
+
2167
+ Content-type: application/postscript
2168
+ Content-ID: <id42@guppylake.bellcore.com>
2169
+
2170
+ --42
2171
+ Content-Type: message/external-body;
2172
+ access-type=mail-server
2173
+ server="listserv@bogus.bitnet";
2174
+ expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
2175
+
2176
+ Content-type: application/postscript
2177
+ Content-ID: <id42@guppylake.bellcore.com>
2178
+
2179
+ get RFC-MIME.DOC
2180
+
2181
+ --42--
2182
+
2183
+
2184
+
2185
+ Freed & Borenstein Standards Track [Page 39]
2186
+
2187
+ RFC 2046 Media Types November 1996
2188
+
2189
+
2190
+ Note that in the above examples, the default Content-transfer-
2191
+ encoding of "7bit" is assumed for the external postscript data.
2192
+
2193
+ Like the "message/partial" type, the "message/external-body" media
2194
+ type is intended to be transparent, that is, to convey the data type
2195
+ in the external body rather than to convey a message with a body of
2196
+ that type. Thus the headers on the outer and inner parts must be
2197
+ merged using the same rules as for "message/partial". In particular,
2198
+ this means that the Content-type and Subject fields are overridden,
2199
+ but the From field is preserved.
2200
+
2201
+ Note that since the external bodies are not transported along with
2202
+ the external body reference, they need not conform to transport
2203
+ limitations that apply to the reference itself. In particular,
2204
+ Internet mail transports may impose 7bit and line length limits, but
2205
+ these do not automatically apply to binary external body references.
2206
+ Thus a Content-Transfer-Encoding is not generally necessary, though
2207
+ it is permitted.
2208
+
2209
+ Note that the body of a message of type "message/external-body" is
2210
+ governed by the basic syntax for an RFC 822 message. In particular,
2211
+ anything before the first consecutive pair of CRLFs is header
2212
+ information, while anything after it is body information, which is
2213
+ ignored for most access-types.
2214
+
2215
+ 5.2.4. Other Message Subtypes
2216
+
2217
+ MIME implementations must in general treat unrecognized subtypes of
2218
+ "message" as being equivalent to "application/octet-stream".
2219
+
2220
+ Future subtypes of "message" intended for use with email should be
2221
+ restricted to "7bit" encoding. A type other than "message" should be
2222
+ used if restriction to "7bit" is not possible.
2223
+
2224
+ 6. Experimental Media Type Values
2225
+
2226
+ A media type value beginning with the characters "X-" is a private
2227
+ value, to be used by consenting systems by mutual agreement. Any
2228
+ format without a rigorous and public definition must be named with an
2229
+ "X-" prefix, and publicly specified values shall never begin with
2230
+ "X-". (Older versions of the widely used Andrew system use the "X-
2231
+ BE2" name, so new systems should probably choose a different name.)
2232
+
2233
+ In general, the use of "X-" top-level types is strongly discouraged.
2234
+ Implementors should invent subtypes of the existing types whenever
2235
+ possible. In many cases, a subtype of "application" will be more
2236
+ appropriate than a new top-level type.
2237
+
2238
+
2239
+
2240
+
2241
+ Freed & Borenstein Standards Track [Page 40]
2242
+
2243
+ RFC 2046 Media Types November 1996
2244
+
2245
+
2246
+ 7. Summary
2247
+
2248
+ The five discrete media types provide provide a standardized
2249
+ mechanism for tagging entities as "audio", "image", or several other
2250
+ kinds of data. The composite "multipart" and "message" media types
2251
+ allow mixing and hierarchical structuring of entities of different
2252
+ types in a single message. A distinguished parameter syntax allows
2253
+ further specification of data format details, particularly the
2254
+ specification of alternate character sets. Additional optional
2255
+ header fields provide mechanisms for certain extensions deemed
2256
+ desirable by many implementors. Finally, a number of useful media
2257
+ types are defined for general use by consenting user agents, notably
2258
+ "message/partial" and "message/external-body".
2259
+
2260
+ 9. Security Considerations
2261
+
2262
+ Security issues are discussed in the context of the
2263
+ "application/postscript" type, the "message/external-body" type, and
2264
+ in RFC 2048. Implementors should pay special attention to the
2265
+ security implications of any media types that can cause the remote
2266
+ execution of any actions in the recipient's environment. In such
2267
+ cases, the discussion of the "application/postscript" type may serve
2268
+ as a model for considering other media types with remote execution
2269
+ capabilities.
2270
+
2271
+
2272
+
2273
+
2274
+
2275
+
2276
+
2277
+
2278
+
2279
+
2280
+
2281
+
2282
+
2283
+
2284
+
2285
+
2286
+
2287
+
2288
+
2289
+
2290
+
2291
+
2292
+
2293
+
2294
+
2295
+
2296
+
2297
+ Freed & Borenstein Standards Track [Page 41]
2298
+
2299
+ RFC 2046 Media Types November 1996
2300
+
2301
+
2302
+ 9. Authors' Addresses
2303
+
2304
+ For more information, the authors of this document are best contacted
2305
+ via Internet mail:
2306
+
2307
+ Ned Freed
2308
+ Innosoft International, Inc.
2309
+ 1050 East Garvey Avenue South
2310
+ West Covina, CA 91790
2311
+ USA
2312
+
2313
+ Phone: +1 818 919 3600
2314
+ Fax: +1 818 919 3614
2315
+ EMail: ned@innosoft.com
2316
+
2317
+
2318
+ Nathaniel S. Borenstein
2319
+ First Virtual Holdings
2320
+ 25 Washington Avenue
2321
+ Morristown, NJ 07960
2322
+ USA
2323
+
2324
+ Phone: +1 201 540 8967
2325
+ Fax: +1 201 993 3032
2326
+ EMail: nsb@nsb.fv.com
2327
+
2328
+
2329
+ MIME is a result of the work of the Internet Engineering Task Force
2330
+ Working Group on RFC 822 Extensions. The chairman of that group,
2331
+ Greg Vaudreuil, may be reached at:
2332
+
2333
+ Gregory M. Vaudreuil
2334
+ Octel Network Services
2335
+ 17080 Dallas Parkway
2336
+ Dallas, TX 75248-1905
2337
+ USA
2338
+
2339
+ EMail: Greg.Vaudreuil@Octel.Com
2340
+
2341
+
2342
+
2343
+
2344
+
2345
+
2346
+
2347
+
2348
+
2349
+
2350
+
2351
+
2352
+
2353
+ Freed & Borenstein Standards Track [Page 42]
2354
+
2355
+ RFC 2046 Media Types November 1996
2356
+
2357
+
2358
+ Appendix A -- Collected Grammar
2359
+
2360
+ This appendix contains the complete BNF grammar for all the syntax
2361
+ specified by this document.
2362
+
2363
+ By itself, however, this grammar is incomplete. It refers by name to
2364
+ several syntax rules that are defined by RFC 822. Rather than
2365
+ reproduce those definitions here, and risk unintentional differences
2366
+ between the two, this document simply refers the reader to RFC 822
2367
+ for the remaining definitions. Wherever a term is undefined, it
2368
+ refers to the RFC 822 definition.
2369
+
2370
+ boundary := 0*69<bchars> bcharsnospace
2371
+
2372
+ bchars := bcharsnospace / " "
2373
+
2374
+ bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" /
2375
+ "+" / "_" / "," / "-" / "." /
2376
+ "/" / ":" / "=" / "?"
2377
+
2378
+ body-part := <"message" as defined in RFC 822, with all
2379
+ header fields optional, not starting with the
2380
+ specified dash-boundary, and with the
2381
+ delimiter not occurring anywhere in the
2382
+ body part. Note that the semantics of a
2383
+ part differ from the semantics of a message,
2384
+ as described in the text.>
2385
+
2386
+ close-delimiter := delimiter "--"
2387
+
2388
+ dash-boundary := "--" boundary
2389
+ ; boundary taken from the value of
2390
+ ; boundary parameter of the
2391
+ ; Content-Type field.
2392
+
2393
+ delimiter := CRLF dash-boundary
2394
+
2395
+ discard-text := *(*text CRLF)
2396
+ ; May be ignored or discarded.
2397
+
2398
+ encapsulation := delimiter transport-padding
2399
+ CRLF body-part
2400
+
2401
+ epilogue := discard-text
2402
+
2403
+ multipart-body := [preamble CRLF]
2404
+ dash-boundary transport-padding CRLF
2405
+ body-part *encapsulation
2406
+
2407
+
2408
+
2409
+ Freed & Borenstein Standards Track [Page 43]
2410
+
2411
+ RFC 2046 Media Types November 1996
2412
+
2413
+
2414
+ close-delimiter transport-padding
2415
+ [CRLF epilogue]
2416
+
2417
+ preamble := discard-text
2418
+
2419
+ transport-padding := *LWSP-char
2420
+ ; Composers MUST NOT generate
2421
+ ; non-zero length transport
2422
+ ; padding, but receivers MUST
2423
+ ; be able to handle padding
2424
+ ; added by message transports.
2425
+
2426
+
2427
+
2428
+
2429
+
2430
+
2431
+
2432
+
2433
+
2434
+
2435
+
2436
+
2437
+
2438
+
2439
+
2440
+
2441
+
2442
+
2443
+
2444
+
2445
+
2446
+
2447
+
2448
+
2449
+
2450
+
2451
+
2452
+
2453
+
2454
+
2455
+
2456
+
2457
+
2458
+
2459
+
2460
+
2461
+
2462
+
2463
+
2464
+
2465
+ Freed & Borenstein Standards Track [Page 44]
2466
+
2467
+