rfc1521.txt 183KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539
  1. Network Working Group N. Borenstein
  2. Request for Comments: 1521 Bellcore
  3. Obsoletes: 1341 N. Freed
  4. Category: Standards Track Innosoft
  5. September 1993
  6. MIME (Multipurpose Internet Mail Extensions) Part One:
  7. Mechanisms for Specifying and Describing
  8. the Format of Internet Message Bodies
  9. Status of this Memo
  10. This RFC specifies an Internet standards track protocol for the
  11. Internet community, and requests discussion and suggestions for
  12. improvements. Please refer to the current edition of the "Internet
  13. Official Protocol Standards" for the standardization state and status
  14. of this protocol. Distribution of this memo is unlimited.
  15. Abstract
  16. STD 11, RFC 822 defines a message representation protocol which
  17. specifies considerable detail about message headers, but which leaves
  18. the message content, or message body, as flat ASCII text. This
  19. document redefines the format of message bodies to allow multi-part
  20. textual and non-textual message bodies to be represented and
  21. exchanged without loss of information. This is based on earlier work
  22. documented in RFC 934 and STD 11, RFC 1049, but extends and revises
  23. that work. Because RFC 822 said so little about message bodies, this
  24. document is largely orthogonal to (rather than a revision of) RFC
  25. 822.
  26. In particular, this document is designed to provide facilities to
  27. include multiple objects in a single message, to represent body text
  28. in character sets other than US-ASCII, to represent formatted multi-
  29. font text messages, to represent non-textual material such as images
  30. and audio fragments, and generally to facilitate later extensions
  31. defining new types of Internet mail for use by cooperating mail
  32. agents.
  33. This document does NOT extend Internet mail header fields to permit
  34. anything other than US-ASCII text data. Such extensions are the
  35. subject of a companion document [RFC-1522].
  36. This document is a revision of RFC 1341. Significant differences
  37. from RFC 1341 are summarized in Appendix H.
  38. Borenstein & Freed [Page 1]
  39. RFC 1521 MIME September 1993
  40. Table of Contents
  41. 1. Introduction....................................... 3
  42. 2. Notations, Conventions, and Generic BNF Grammar.... 6
  43. 3. The MIME-Version Header Field...................... 7
  44. 4. The Content-Type Header Field...................... 9
  45. 5. The Content-Transfer-Encoding Header Field......... 13
  46. 5.1. Quoted-Printable Content-Transfer-Encoding......... 18
  47. 5.2. Base64 Content-Transfer-Encoding................... 21
  48. 6. Additional Content-Header Fields................... 23
  49. 6.1. Optional Content-ID Header Field................... 23
  50. 6.2. Optional Content-Description Header Field.......... 24
  51. 7. The Predefined Content-Type Values................. 24
  52. 7.1. The Text Content-Type.............................. 24
  53. 7.1.1. The charset parameter.............................. 25
  54. 7.1.2. The Text/plain subtype............................. 28
  55. 7.2. The Multipart Content-Type......................... 28
  56. 7.2.1. Multipart: The common syntax...................... 29
  57. 7.2.2. The Multipart/mixed (primary) subtype.............. 34
  58. 7.2.3. The Multipart/alternative subtype.................. 34
  59. 7.2.4. The Multipart/digest subtype....................... 36
  60. 7.2.5. The Multipart/parallel subtype..................... 37
  61. 7.2.6. Other Multipart subtypes........................... 37
  62. 7.3. The Message Content-Type........................... 38
  63. 7.3.1. The Message/rfc822 (primary) subtype............... 38
  64. 7.3.2. The Message/Partial subtype........................ 39
  65. 7.3.3. The Message/External-Body subtype.................. 42
  66. 7.3.3.1. The "ftp" and "tftp" access-types............... 44
  67. 7.3.3.2. The "anon-ftp" access-type...................... 45
  68. 7.3.3.3. The "local-file" and "afs" access-types......... 45
  69. 7.3.3.4. The "mail-server" access-type................... 45
  70. 7.3.3.5. Examples and Further Explanations............... 46
  71. 7.4. The Application Content-Type....................... 49
  72. 7.4.1. The Application/Octet-Stream (primary) subtype..... 50
  73. 7.4.2. The Application/PostScript subtype................. 50
  74. 7.4.3. Other Application subtypes......................... 53
  75. 7.5. The Image Content-Type............................. 53
  76. 7.6. The Audio Content-Type............................. 54
  77. 7.7. The Video Content-Type............................. 54
  78. 7.8. Experimental Content-Type Values................... 54
  79. 8. Summary............................................ 56
  80. 9. Security Considerations............................ 56
  81. 10. Authors' Addresses................................. 57
  82. 11. Acknowledgements................................... 58
  83. Appendix A -- Minimal MIME-Conformance.................... 60
  84. Appendix B -- General Guidelines For Sending Email Data... 63
  85. Appendix C -- A Complex Multipart Example................. 66
  86. Appendix D -- Collected Grammar........................... 68
  87. Borenstein & Freed [Page 2]
  88. RFC 1521 MIME September 1993
  89. Appendix E -- IANA Registration Procedures................ 72
  90. E.1 Registration of New Content-type/subtype Values...... 72
  91. E.2 Registration of New Access-type Values
  92. for Message/external-body............................ 73
  93. Appendix F -- Summary of the Seven Content-types.......... 74
  94. Appendix G -- Canonical Encoding Model.................... 76
  95. Appendix H -- Changes from RFC 1341....................... 78
  96. References................................................ 80
  97. 1. Introduction
  98. Since its publication in 1982, STD 11, RFC 822 [RFC-822] has defined
  99. the standard format of textual mail messages on the Internet. Its
  100. success has been such that the RFC 822 format has been adopted,
  101. wholly or partially, well beyond the confines of the Internet and the
  102. Internet SMTP transport defined by STD 10, RFC 821 [RFC-821]. As the
  103. format has seen wider use, a number of limitations have proven
  104. increasingly restrictive for the user community.
  105. RFC 822 was intended to specify a format for text messages. As such,
  106. non-text messages, such as multimedia messages that might include
  107. audio or images, are simply not mentioned. Even in the case of text,
  108. however, RFC 822 is inadequate for the needs of mail users whose
  109. languages require the use of character sets richer than US ASCII
  110. [US-ASCII]. Since RFC 822 does not specify mechanisms for mail
  111. containing audio, video, Asian language text, or even text in most
  112. European languages, additional specifications are needed.
  113. One of the notable limitations of RFC 821/822 based mail systems is
  114. the fact that they limit the contents of electronic mail messages to
  115. relatively short lines of seven-bit ASCII. This forces users to
  116. convert any non-textual data that they may wish to send into seven-
  117. bit bytes representable as printable ASCII characters before invoking
  118. a local mail UA (User Agent, a program with which human users send
  119. and receive mail). Examples of such encodings currently used in the
  120. Internet include pure hexadecimal, uuencode, the 3-in-4 base 64
  121. scheme specified in RFC 1421, the Andrew Toolkit Representation
  122. [ATK], and many others.
  123. The limitations of RFC 822 mail become even more apparent as gateways
  124. are designed to allow for the exchange of mail messages between RFC
  125. 822 hosts and X.400 hosts. X.400 [X400] specifies mechanisms for the
  126. inclusion of non-textual body parts within electronic mail messages.
  127. The current standards for the mapping of X.400 messages to RFC 822
  128. messages specify either that X.400 non-textual body parts must be
  129. converted to (not encoded in) an ASCII format, or that they must be
  130. discarded, notifying the RFC 822 user that discarding has occurred.
  131. This is clearly undesirable, as information that a user may wish to
  132. Borenstein & Freed [Page 3]
  133. RFC 1521 MIME September 1993
  134. receive is lost. Even though a user's UA may not have the capability
  135. of dealing with the non-textual body part, the user might have some
  136. mechanism external to the UA that can extract useful information from
  137. the body part. Moreover, it does not allow for the fact that the
  138. message may eventually be gatewayed back into an X.400 message
  139. handling system (i.e., the X.400 message is "tunneled" through
  140. Internet mail), where the non-textual information would definitely
  141. become useful again.
  142. This document describes several mechanisms that combine to solve most
  143. of these problems without introducing any serious incompatibilities
  144. with the existing world of RFC 822 mail. In particular, it
  145. describes:
  146. 1. A MIME-Version header field, which uses a version number to
  147. declare a message to be conformant with this specification and
  148. allows mail processing agents to distinguish between such
  149. messages and those generated by older or non-conformant software,
  150. which is presumed to lack such a field.
  151. 2. A Content-Type header field, generalized from RFC 1049 [RFC-1049],
  152. which can be used to specify the type and subtype of data in the
  153. body of a message and to fully specify the native representation
  154. (encoding) of such data.
  155. 2.a. A "text" Content-Type value, which can be used to represent
  156. textual information in a number of character sets and
  157. formatted text description languages in a standardized
  158. manner.
  159. 2.b. A "multipart" Content-Type value, which can be used to
  160. combine several body parts, possibly of differing types of
  161. data, into a single message.
  162. 2.c. An "application" Content-Type value, which can be used to
  163. transmit application data or binary data, and hence, among
  164. other uses, to implement an electronic mail file transfer
  165. service.
  166. 2.d. A "message" Content-Type value, for encapsulating another
  167. mail message.
  168. 2.e An "image" Content-Type value, for transmitting still image
  169. (picture) data.
  170. 2.f. An "audio" Content-Type value, for transmitting audio or
  171. voice data.
  172. Borenstein & Freed [Page 4]
  173. RFC 1521 MIME September 1993
  174. 2.g. A "video" Content-Type value, for transmitting video or
  175. moving image data, possibly with audio as part of the
  176. composite video data format.
  177. 3. A Content-Transfer-Encoding header field, which can be used to
  178. specify an auxiliary encoding that was applied to the data in
  179. order to allow it to pass through mail transport mechanisms which
  180. may have data or character set limitations.
  181. 4. Two additional header fields that can be used to further describe
  182. the data in a message body, the Content-ID and Content-
  183. Description header fields.
  184. MIME has been carefully designed as an extensible mechanism, and it
  185. is expected that the set of content-type/subtype pairs and their
  186. associated parameters will grow significantly with time. Several
  187. other MIME fields, notably including character set names, are likely
  188. to have new values defined over time. In order to ensure that the
  189. set of such values is developed in an orderly, well-specified, and
  190. public manner, MIME defines a registration process which uses the
  191. Internet Assigned Numbers Authority (IANA) as a central registry for
  192. such values. Appendix E provides details about how IANA registration
  193. is accomplished.
  194. Finally, to specify and promote interoperability, Appendix A of this
  195. document provides a basic applicability statement for a subset of the
  196. above mechanisms that defines a minimal level of "conformance" with
  197. this document.
  198. HISTORICAL NOTE: Several of the mechanisms described in this
  199. document may seem somewhat strange or even baroque at first
  200. reading. It is important to note that compatibility with existing
  201. standards AND robustness across existing practice were two of the
  202. highest priorities of the working group that developed this
  203. document. In particular, compatibility was always favored over
  204. elegance.
  205. MIME was first defined and published as RFCs 1341 and 1342 [RFC-1341]
  206. [RFC-1342]. This document is a relatively minor updating of RFC
  207. 1341, and is intended to supersede it. The differences between this
  208. document and RFC 1341 are summarized in Appendix H. Please refer to
  209. the current edition of the "IAB Official Protocol Standards" for the
  210. standardization state and status of this protocol. Several other RFC
  211. documents will be of interest to the MIME implementor, in particular
  212. [RFC 1343], [RFC-1344], and [RFC-1345].
  213. Borenstein & Freed [Page 5]
  214. RFC 1521 MIME September 1993
  215. 2. Notations, Conventions, and Generic BNF Grammar
  216. This document is being published in two versions, one as plain ASCII
  217. text and one as PostScript (PostScript is a trademark of Adobe
  218. Systems Incorporated.). While the text version is the official
  219. specification, some will find the PostScript version easier to read.
  220. The textual contents are identical. An Andrew-format copy of this
  221. document is also available from the first author (Borenstein).
  222. Although the mechanisms specified in this document are all described
  223. in prose, most are also described formally in the modified BNF
  224. notation of RFC 822. Implementors will need to be familiar with this
  225. notation in order to understand this specification, and are referred
  226. to RFC 822 for a complete explanation of the modified BNF notation.
  227. Some of the modified BNF in this document makes reference to
  228. syntactic entities that are defined in RFC 822 and not in this
  229. document. A complete formal grammar, then, is obtained by combining
  230. the collected grammar appendix of this document with that of RFC 822
  231. plus the modifications to RFC 822 defined in RFC 1123, which
  232. specifically changes the syntax for `return', `date' and `mailbox'.
  233. The term CRLF, in this document, refers to the sequence of the two
  234. ASCII characters CR (13) and LF (10) which, taken together, in this
  235. order, denote a line break in RFC 822 mail.
  236. The term "character set" is used in this document to refer to a
  237. method used with one or more tables to convert encoded text to a
  238. series of octets. This definition is intended to allow various kinds
  239. of text encodings, from simple single-table mappings such as ASCII to
  240. complex table switching methods such as those that use ISO 2022's
  241. techniques. However, a MIME character set name must fully specify
  242. the mapping to be performed.
  243. The term "message", when not further qualified, means either the
  244. (complete or "top-level") message being transferred on a network, or
  245. a message encapsulated in a body of type "message".
  246. The term "body part", in this document, means one of the parts of the
  247. body of a multipart entity. A body part has a header and a body, so
  248. it makes sense to speak about the body of a body part.
  249. The term "entity", in this document, means either a message or a body
  250. part. All kinds of entities share the property that they have a
  251. header and a body.
  252. The term "body", when not further qualified, means the body of an
  253. entity, that is the body of either a message or of a body part.
  254. Borenstein & Freed [Page 6]
  255. RFC 1521 MIME September 1993
  256. NOTE: The previous four definitions are clearly circular. This is
  257. unavoidable, since the overall structure of a MIME message is
  258. indeed recursive.
  259. In this document, all numeric and octet values are given in decimal
  260. notation.
  261. It must be noted that Content-Type values, subtypes, and parameter
  262. names as defined in this document are case-insensitive. However,
  263. parameter values are case-sensitive unless otherwise specified for
  264. the specific parameter.
  265. FORMATTING NOTE: This document has been carefully formatted for
  266. ease of reading. The PostScript version of this document, in
  267. particular, places notes like this one, which may be skipped by
  268. the reader, in a smaller, italicized, font, and indents it as
  269. well. In the text version, only the indentation is preserved, so
  270. if you are reading the text version of this you might consider
  271. using the PostScript version instead. However, all such notes will
  272. be indented and preceded by "NOTE:" or some similar introduction,
  273. even in the text version.
  274. The primary purpose of these non-essential notes is to convey
  275. information about the rationale of this document, or to place this
  276. document in the proper historical or evolutionary context. Such
  277. information may be skipped by those who are focused entirely on
  278. building a conformant implementation, but may be of use to those
  279. who wish to understand why this document is written as it is.
  280. For ease of recognition, all BNF definitions have been placed in a
  281. fixed-width font in the PostScript version of this document.
  282. 3. The MIME-Version Header Field
  283. Since RFC 822 was published in 1982, there has really been only one
  284. format standard for Internet messages, and there has been little
  285. perceived need to declare the format standard in use. This document
  286. is an independent document that complements RFC 822. Although the
  287. extensions in this document have been defined in such a way as to be
  288. compatible with RFC 822, there are still circumstances in which it
  289. might be desirable for a mail-processing agent to know whether a
  290. message was composed with the new standard in mind.
  291. Therefore, this document defines a new header field, "MIME-Version",
  292. which is to be used to declare the version of the Internet message
  293. body format standard in use.
  294. Messages composed in accordance with this document MUST include such
  295. Borenstein & Freed [Page 7]
  296. RFC 1521 MIME September 1993
  297. a header field, with the following verbatim text:
  298. MIME-Version: 1.0
  299. The presence of this header field is an assertion that the message
  300. has been composed in compliance with this document.
  301. Since it is possible that a future document might extend the message
  302. format standard again, a formal BNF is given for the content of the
  303. MIME-Version field:
  304. version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
  305. Thus, future format specifiers, which might replace or extend "1.0",
  306. are constrained to be two integer fields, separated by a period. If
  307. a message is received with a MIME-version value other than "1.0", it
  308. cannot be assumed to conform with this specification.
  309. Note that the MIME-Version header field is required at the top level
  310. of a message. It is not required for each body part of a multipart
  311. entity. It is required for the embedded headers of a body of type
  312. "message" if and only if the embedded message is itself claimed to be
  313. MIME-conformant.
  314. It is not possible to fully specify how a mail reader that conforms
  315. with MIME as defined in this document should treat a message that
  316. might arrive in the future with some value of MIME-Version other than
  317. "1.0". However, conformant software is encouraged to check the
  318. version number and at least warn the user if an unrecognized MIME-
  319. version is encountered.
  320. It is also worth noting that version control for specific content-
  321. types is not accomplished using the MIME-Version mechanism. In
  322. particular, some formats (such as application/postscript) have
  323. version numbering conventions that are internal to the document
  324. format. Where such conventions exist, MIME does nothing to supersede
  325. them. Where no such conventions exist, a MIME type might use a
  326. "version" parameter in the content-type field if necessary.
  327. NOTE TO IMPLEMENTORS: All header fields defined in this document,
  328. including MIME-Version, Content-type, etc., are subject to the
  329. general syntactic rules for header fields specified in RFC 822. In
  330. particular, all can include comments, which means that the following
  331. two MIME-Version fields are equivalent:
  332. MIME-Version: 1.0
  333. MIME-Version: 1.0 (Generated by GBD-killer 3.7)
  334. Borenstein & Freed [Page 8]
  335. RFC 1521 MIME September 1993
  336. 4. The Content-Type Header Field
  337. The purpose of the Content-Type field is to describe the data
  338. contained in the body fully enough that the receiving user agent can
  339. pick an appropriate agent or mechanism to present the data to the
  340. user, or otherwise deal with the data in an appropriate manner.
  341. HISTORICAL NOTE: The Content-Type header field was first defined in
  342. RFC 1049. RFC 1049 Content-types used a simpler and less powerful
  343. syntax, but one that is largely compatible with the mechanism given
  344. here.
  345. The Content-Type header field is used to specify the nature of the
  346. data in the body of an entity, by giving type and subtype
  347. identifiers, and by providing auxiliary information that may be
  348. required for certain types. After the type and subtype names, the
  349. remainder of the header field is simply a set of parameters,
  350. specified in an attribute/value notation. The set of meaningful
  351. parameters differs for the different types. In particular, there are
  352. NO globally-meaningful parameters that apply to all content-types.
  353. Global mechanisms are best addressed, in the MIME model, by the
  354. definition of additional Content-* header fields. The ordering of
  355. parameters is not significant. Among the defined parameters is a
  356. "charset" parameter by which the character set used in the body may
  357. be declared. Comments are allowed in accordance with RFC 822 rules
  358. for structured header fields.
  359. In general, the top-level Content-Type is used to declare the general
  360. type of data, while the subtype specifies a specific format for that
  361. type of data. Thus, a Content-Type of "image/xyz" is enough to tell
  362. a user agent that the data is an image, even if the user agent has no
  363. knowledge of the specific image format "xyz". Such information can
  364. be used, for example, to decide whether or not to show a user the raw
  365. data from an unrecognized subtype -- such an action might be
  366. reasonable for unrecognized subtypes of text, but not for
  367. unrecognized subtypes of image or audio. For this reason, registered
  368. subtypes of audio, image, text, and video, should not contain
  369. embedded information that is really of a different type. Such
  370. compound types should be represented using the "multipart" or
  371. "application" types.
  372. Parameters are modifiers of the content-subtype, and do not
  373. fundamentally affect the requirements of the host system. Although
  374. most parameters make sense only with certain content-types, others
  375. are "global" in the sense that they might apply to any subtype. For
  376. example, the "boundary" parameter makes sense only for the
  377. "multipart" content-type, but the "charset" parameter might make
  378. sense with several content-types.
  379. Borenstein & Freed [Page 9]
  380. RFC 1521 MIME September 1993
  381. An initial set of seven Content-Types is defined by this document.
  382. This set of top-level names is intended to be substantially complete.
  383. It is expected that additions to the larger set of supported types
  384. can generally be accomplished by the creation of new subtypes of
  385. these initial types. In the future, more top-level types may be
  386. defined only by an extension to this standard. If another primary
  387. type is to be used for any reason, it must be given a name starting
  388. with "X-" to indicate its non-standard status and to avoid a
  389. potential conflict with a future official name.
  390. In the Augmented BNF notation of RFC 822, a Content-Type header field
  391. value is defined as follows:
  392. content := "Content-Type" ":" type "/" subtype *(";"
  393. parameter)
  394. ; case-insensitive matching of type and subtype
  395. type := "application" / "audio"
  396. / "image" / "message"
  397. / "multipart" / "text"
  398. / "video" / extension-token
  399. ; All values case-insensitive
  400. extension-token := x-token / iana-token
  401. iana-token := <a publicly-defined extension token,
  402. registered with IANA, as specified in
  403. appendix E>
  404. x-token := <The two characters "X-" or "x-" followed, with
  405. no intervening white space, by any token>
  406. subtype := token ; case-insensitive
  407. parameter := attribute "=" value
  408. attribute := token ; case-insensitive
  409. value := token / quoted-string
  410. token := 1*<any (ASCII) CHAR except SPACE, CTLs,
  411. or tspecials>
  412. tspecials := "(" / ")" / "<" / ">" / "@"
  413. / "," / ";" / ":" / "\" / <">
  414. / "/" / "[" / "]" / "?" / "="
  415. ; Must be in quoted-string,
  416. ; to use within parameter values
  417. Borenstein & Freed [Page 10]
  418. RFC 1521 MIME September 1993
  419. Note that the definition of "tspecials" is the same as the RFC 822
  420. definition of "specials" with the addition of the three characters
  421. "/", "?", and "=", and the removal of ".".
  422. Note also that a subtype specification is MANDATORY. There are no
  423. default subtypes.
  424. The type, subtype, and parameter names are not case sensitive. For
  425. example, TEXT, Text, and TeXt are all equivalent. Parameter values
  426. are normally case sensitive, but certain parameters are interpreted
  427. to be case-insensitive, depending on the intended use. (For example,
  428. multipart boundaries are case-sensitive, but the "access-type" for
  429. message/External-body is not case-sensitive.)
  430. Beyond this syntax, the only constraint on the definition of subtype
  431. names is the desire that their uses must not conflict. That is, it
  432. would be undesirable to have two different communities using
  433. "Content-Type: application/foobar" to mean two different things. The
  434. process of defining new content-subtypes, then, is not intended to be
  435. a mechanism for imposing restrictions, but simply a mechanism for
  436. publicizing the usages. There are, therefore, two acceptable
  437. mechanisms for defining new Content-Type subtypes:
  438. 1. Private values (starting with "X-") may be
  439. defined bilaterally between two cooperating
  440. agents without outside registration or
  441. standardization.
  442. 2. New standard values must be documented,
  443. registered with, and approved by IANA, as
  444. described in Appendix E. Where intended for
  445. public use, the formats they refer to must
  446. also be defined by a published specification,
  447. and possibly offered for standardization.
  448. The seven standard initial predefined Content-Types are detailed in
  449. the bulk of this document. They are:
  450. text -- textual information. The primary subtype,
  451. "plain", indicates plain (unformatted) text. No
  452. special software is required to get the full
  453. meaning of the text, aside from support for the
  454. indicated character set. Subtypes are to be used
  455. for enriched text in forms where application
  456. software may enhance the appearance of the text,
  457. but such software must not be required in order to
  458. get the general idea of the content. Possible
  459. subtypes thus include any readable word processor
  460. Borenstein & Freed [Page 11]
  461. RFC 1521 MIME September 1993
  462. format. A very simple and portable subtype,
  463. richtext, was defined in RFC 1341, with a future
  464. revision expected.
  465. multipart -- data consisting of multiple parts of
  466. independent data types. Four initial subtypes
  467. are defined, including the primary "mixed"
  468. subtype, "alternative" for representing the same
  469. data in multiple formats, "parallel" for parts
  470. intended to be viewed simultaneously, and "digest"
  471. for multipart entities in which each part is of
  472. type "message".
  473. message -- an encapsulated message. A body of
  474. Content-Type "message" is itself all or part of a
  475. fully formatted RFC 822 conformant message which
  476. may contain its own different Content-Type header
  477. field. The primary subtype is "rfc822". The
  478. "partial" subtype is defined for partial messages,
  479. to permit the fragmented transmission of bodies
  480. that are thought to be too large to be passed
  481. through mail transport facilities. Another
  482. subtype, "External-body", is defined for
  483. specifying large bodies by reference to an
  484. external data source.
  485. image -- image data. Image requires a display device
  486. (such as a graphical display, a printer, or a FAX
  487. machine) to view the information. Initial
  488. subtypes are defined for two widely-used image
  489. formats, jpeg and gif.
  490. audio -- audio data, with initial subtype "basic".
  491. Audio requires an audio output device (such as a
  492. speaker or a telephone) to "display" the contents.
  493. video -- video data. Video requires the capability to
  494. display moving images, typically including
  495. specialized hardware and software. The initial
  496. subtype is "mpeg".
  497. application -- some other kind of data, typically
  498. either uninterpreted binary data or information to
  499. be processed by a mail-based application. The
  500. primary subtype, "octet-stream", is to be used in
  501. the case of uninterpreted binary data, in which
  502. case the simplest recommended action is to offer
  503. to write the information into a file for the user.
  504. Borenstein & Freed [Page 12]
  505. RFC 1521 MIME September 1993
  506. An additional subtype, "PostScript", is defined
  507. for transporting PostScript documents in bodies.
  508. Other expected uses for "application" include
  509. spreadsheets, data for mail-based scheduling
  510. systems, and languages for "active"
  511. (computational) email. (Note that active email
  512. and other application data may entail several
  513. security considerations, which are discussed later
  514. in this memo, particularly in the context of
  515. application/PostScript.)
  516. Default RFC 822 messages are typed by this protocol as plain text in
  517. the US-ASCII character set, which can be explicitly specified as
  518. "Content-type: text/plain; charset=us-ascii". If no Content-Type is
  519. specified, this default is assumed. In the presence of a MIME-
  520. Version header field, a receiving User Agent can also assume that
  521. plain US-ASCII text was the sender's intent. In the absence of a
  522. MIME-Version specification, plain US-ASCII text must still be
  523. assumed, but the sender's intent might have been otherwise.
  524. RATIONALE: In the absence of any Content-Type header field or
  525. MIME-Version header field, it is impossible to be certain that a
  526. message is actually text in the US-ASCII character set, since it
  527. might well be a message that, using the conventions that predate
  528. this document, includes text in another character set or non-
  529. textual data in a manner that cannot be automatically recognized
  530. (e.g., a uuencoded compressed UNIX tar file). Although there is
  531. no fully acceptable alternative to treating such untyped messages
  532. as "text/plain; charset=us-ascii", implementors should remain
  533. aware that if a message lacks both the MIME-Version and the
  534. Content-Type header fields, it may in practice contain almost
  535. anything.
  536. It should be noted that the list of Content-Type values given here
  537. may be augmented in time, via the mechanisms described above, and
  538. that the set of subtypes is expected to grow substantially.
  539. When a mail reader encounters mail with an unknown Content-type
  540. value, it should generally treat it as equivalent to
  541. "application/octet-stream", as described later in this document.
  542. 5. The Content-Transfer-Encoding Header Field
  543. Many Content-Types which could usefully be transported via email are
  544. represented, in their "natural" format, as 8-bit character or binary
  545. data. Such data cannot be transmitted over some transport protocols.
  546. For example, RFC 821 restricts mail messages to 7-bit US-ASCII data
  547. with lines no longer than 1000 characters.
  548. Borenstein & Freed [Page 13]
  549. RFC 1521 MIME September 1993
  550. It is necessary, therefore, to define a standard mechanism for re-
  551. encoding such data into a 7-bit short-line format. This document
  552. specifies that such encodings will be indicated by a new "Content-
  553. Transfer-Encoding" header field. The Content-Transfer-Encoding field
  554. is used to indicate the type of transformation that has been used in
  555. order to represent the body in an acceptable manner for transport.
  556. Unlike Content-Types, a proliferation of Content-Transfer-Encoding
  557. values is undesirable and unnecessary. However, establishing only a
  558. single Content-Transfer-Encoding mechanism does not seem possible.
  559. There is a tradeoff between the desire for a compact and efficient
  560. encoding of largely-binary data and the desire for a readable
  561. encoding of data that is mostly, but not entirely, 7-bit data. For
  562. this reason, at least two encoding mechanisms are necessary: a
  563. "readable" encoding and a "dense" encoding.
  564. The Content-Transfer-Encoding field is designed to specify an
  565. invertible mapping between the "native" representation of a type of
  566. data and a representation that can be readily exchanged using 7 bit
  567. mail transport protocols, such as those defined by RFC 821 (SMTP).
  568. This field has not been defined by any previous standard. The field's
  569. value is a single token specifying the type of encoding, as
  570. enumerated below. Formally:
  571. encoding := "Content-Transfer-Encoding" ":" mechanism
  572. mechanism := "7bit" ; case-insensitive
  573. / "quoted-printable"
  574. / "base64"
  575. / "8bit"
  576. / "binary"
  577. / x-token
  578. These values are not case sensitive. That is, Base64 and BASE64 and
  579. bAsE64 are all equivalent. An encoding type of 7BIT requires that
  580. the body is already in a seven-bit mail-ready representation. This
  581. is the default value -- that is, "Content-Transfer-Encoding: 7BIT" is
  582. assumed if the Content-Transfer-Encoding header field is not present.
  583. The values "8bit", "7bit", and "binary" all mean that NO encoding has
  584. been performed. However, they are potentially useful as indications
  585. of the kind of data contained in the object, and therefore of the
  586. kind of encoding that might need to be performed for transmission in
  587. a given transport system. In particular:
  588. "7bit" means that the data is all represented as short
  589. lines of US-ASCII data.
  590. Borenstein & Freed [Page 14]
  591. RFC 1521 MIME September 1993
  592. "8bit" means that the lines are short, but there may be
  593. non-ASCII characters (octets with the high-order
  594. bit set).
  595. "Binary" means that not only may non-ASCII characters
  596. be present, but also that the lines are not
  597. necessarily short enough for SMTP transport.
  598. The difference between "8bit" (or any other conceivable bit-width
  599. token) and the "binary" token is that "binary" does not require
  600. adherence to any limits on line length or to the SMTP CRLF semantics,
  601. while the bit-width tokens do require such adherence. If the body
  602. contains data in any bit-width other than 7-bit, the appropriate
  603. bit-width Content-Transfer-Encoding token must be used (e.g., "8bit"
  604. for unencoded 8 bit wide data). If the body contains binary data,
  605. the "binary" Content-Transfer-Encoding token must be used.
  606. NOTE: The distinction between the Content-Transfer-Encoding values
  607. of "binary", "8bit", etc. may seem unimportant, in that all of
  608. them really mean "none" -- that is, there has been no encoding of
  609. the data for transport. However, clear labeling will be of
  610. enormous value to gateways between future mail transport systems
  611. with differing capabilities in transporting data that do not meet
  612. the restrictions of RFC 821 transport.
  613. Mail transport for unencoded 8-bit data is defined in RFC-1426
  614. [RFC-1426]. As of the publication of this document, there are no
  615. standardized Internet mail transports for which it is legitimate
  616. to include unencoded binary data in mail bodies. Thus there are
  617. no circumstances in which the "binary" Content-Transfer-Encoding
  618. is actually legal on the Internet. However, in the event that
  619. binary mail transport becomes a reality in Internet mail, or when
  620. this document is used in conjunction with any other binary-capable
  621. transport mechanism, binary bodies should be labeled as such using
  622. this mechanism.
  623. NOTE: The five values defined for the Content-Transfer-Encoding
  624. field imply nothing about the Content-Type other than the
  625. algorithm by which it was encoded or the transport system
  626. requirements if unencoded.
  627. Implementors may, if necessary, define new Content-Transfer-Encoding
  628. values, but must use an x-token, which is a name prefixed by "X-" to
  629. indicate its non-standard status, e.g., "Content-Transfer-Encoding:
  630. x-my-new-encoding". However, unlike Content-Types and subtypes, the
  631. creation of new Content-Transfer-Encoding values is explicitly and
  632. strongly discouraged, as it seems likely to hinder interoperability
  633. with little potential benefit. Their use is allowed only as the
  634. Borenstein & Freed [Page 15]
  635. RFC 1521 MIME September 1993
  636. result of an agreement between cooperating user agents.
  637. If a Content-Transfer-Encoding header field appears as part of a
  638. message header, it applies to the entire body of that message. If a
  639. Content-Transfer-Encoding header field appears as part of a body
  640. part's headers, it applies only to the body of that body part. If an
  641. entity is of type "multipart" or "message", the Content-Transfer-
  642. Encoding is not permitted to have any value other than a bit width
  643. (e.g., "7bit", "8bit", etc.) or "binary".
  644. It should be noted that email is character-oriented, so that the
  645. mechanisms described here are mechanisms for encoding arbitrary octet
  646. streams, not bit streams. If a bit stream is to be encoded via one
  647. of these mechanisms, it must first be converted to an 8-bit byte
  648. stream using the network standard bit order ("big-endian"), in which
  649. the earlier bits in a stream become the higher-order bits in a byte.
  650. A bit stream not ending at an 8-bit boundary must be padded with
  651. zeroes. This document provides a mechanism for noting the addition
  652. of such padding in the case of the application Content-Type, which
  653. has a "padding" parameter.
  654. The encoding mechanisms defined here explicitly encode all data in
  655. ASCII. Thus, for example, suppose an entity has header fields such
  656. as:
  657. Content-Type: text/plain; charset=ISO-8859-1
  658. Content-transfer-encoding: base64
  659. This must be interpreted to mean that the body is a base64 ASCII
  660. encoding of data that was originally in ISO-8859-1, and will be in
  661. that character set again after decoding.
  662. The following sections will define the two standard encoding
  663. mechanisms. The definition of new content-transfer-encodings is
  664. explicitly discouraged and should only occur when absolutely
  665. necessary. All content-transfer-encoding namespace except that
  666. beginning with "X-" is explicitly reserved to the IANA for future
  667. use. Private agreements about content-transfer-encodings are also
  668. explicitly discouraged.
  669. Certain Content-Transfer-Encoding values may only be used on certain
  670. Content-Types. In particular, it is expressly forbidden to use any
  671. encodings other than "7bit", "8bit", or "binary" with any Content-
  672. Type that recursively includes other Content-Type fields, notably the
  673. "multipart" and "message" Content-Types. All encodings that are
  674. desired for bodies of type multipart or message must be done at the
  675. innermost level, by encoding the actual body that needs to be
  676. encoded.
  677. Borenstein & Freed [Page 16]
  678. RFC 1521 MIME September 1993
  679. NOTE ON ENCODING RESTRICTIONS: Though the prohibition against
  680. using content-transfer-encodings on data of type multipart or
  681. message may seem overly restrictive, it is necessary to prevent
  682. nested encodings, in which data are passed through an encoding
  683. algorithm multiple times, and must be decoded multiple times in
  684. order to be properly viewed. Nested encodings add considerable
  685. complexity to user agents: aside from the obvious efficiency
  686. problems with such multiple encodings, they can obscure the basic
  687. structure of a message. In particular, they can imply that
  688. several decoding operations are necessary simply to find out what
  689. types of objects a message contains. Banning nested encodings may
  690. complicate the job of certain mail gateways, but this seems less
  691. of a problem than the effect of nested encodings on user agents.
  692. NOTE ON THE RELATIONSHIP BETWEEN CONTENT-TYPE AND CONTENT-
  693. TRANSFER-ENCODING: It may seem that the Content-Transfer-Encoding
  694. could be inferred from the characteristics of the Content-Type
  695. that is to be encoded, or, at the very least, that certain
  696. Content-Transfer-Encodings could be mandated for use with specific
  697. Content-Types. There are several reasons why this is not the case.
  698. First, given the varying types of transports used for mail, some
  699. encodings may be appropriate for some Content-Type/transport
  700. combinations and not for others. (For example, in an 8-bit
  701. transport, no encoding would be required for text in certain
  702. character sets, while such encodings are clearly required for 7-
  703. bit SMTP.) Second, certain Content-Types may require different
  704. types of transfer encoding under different circumstances. For
  705. example, many PostScript bodies might consist entirely of short
  706. lines of 7-bit data and hence require little or no encoding.
  707. Other PostScript bodies (especially those using Level 2
  708. PostScript's binary encoding mechanism) may only be reasonably
  709. represented using a binary transport encoding. Finally, since
  710. Content-Type is intended to be an open-ended specification
  711. mechanism, strict specification of an association between
  712. Content-Types and encodings effectively couples the specification
  713. of an application protocol with a specific lower-level transport.
  714. This is not desirable since the developers of a Content-Type
  715. should not have to be aware of all the transports in use and what
  716. their limitations are.
  717. NOTE ON TRANSLATING ENCODINGS: The quoted-printable and base64
  718. encodings are designed so that conversion between them is
  719. possible. The only issue that arises in such a conversion is the
  720. handling of line breaks. When converting from quoted-printable to
  721. base64 a line break must be converted into a CRLF sequence.
  722. Similarly, a CRLF sequence in base64 data must be converted to a
  723. quoted-printable line break, but ONLY when converting text data.
  724. Borenstein & Freed [Page 17]
  725. RFC 1521 MIME September 1993
  726. NOTE ON CANONICAL ENCODING MODEL: There was some confusion, in
  727. earlier drafts of this memo, regarding the model for when email
  728. data was to be converted to canonical form and encoded, and in
  729. particular how this process would affect the treatment of CRLFs,
  730. given that the representation of newlines varies greatly from
  731. system to system, and the relationship between content-transfer-
  732. encodings and character sets. For this reason, a canonical model
  733. for encoding is presented as Appendix G.
  734. 5.1. Quoted-Printable Content-Transfer-Encoding
  735. The Quoted-Printable encoding is intended to represent data that
  736. largely consists of octets that correspond to printable characters in
  737. the ASCII character set. It encodes the data in such a way that the
  738. resulting octets are unlikely to be modified by mail transport. If
  739. the data being encoded are mostly ASCII text, the encoded form of the
  740. data remains largely recognizable by humans. A body which is
  741. entirely ASCII may also be encoded in Quoted-Printable to ensure the
  742. integrity of the data should the message pass through a character-
  743. translating, and/or line-wrapping gateway.
  744. In this encoding, octets are to be represented as determined by the
  745. following rules:
  746. Rule #1: (General 8-bit representation) Any octet, except those
  747. indicating a line break according to the newline convention of the
  748. canonical (standard) form of the data being encoded, may be
  749. represented by an "=" followed by a two digit hexadecimal
  750. representation of the octet's value. The digits of the
  751. hexadecimal alphabet, for this purpose, are "0123456789ABCDEF".
  752. Uppercase letters must be used when sending hexadecimal data,
  753. though a robust implementation may choose to recognize lowercase
  754. letters on receipt. Thus, for example, the value 12 (ASCII form
  755. feed) can be represented by "=0C", and the value 61 (ASCII EQUAL
  756. SIGN) can be represented by "=3D". Except when the following
  757. rules allow an alternative encoding, this rule is mandatory.
  758. Rule #2: (Literal representation) Octets with decimal values of 33
  759. through 60 inclusive, and 62 through 126, inclusive, MAY be
  760. represented as the ASCII characters which correspond to those
  761. octets (EXCLAMATION POINT through LESS THAN, and GREATER THAN
  762. through TILDE, respectively).
  763. Rule #3: (White Space): Octets with values of 9 and 32 MAY be
  764. represented as ASCII TAB (HT) and SPACE characters, respectively,
  765. but MUST NOT be so represented at the end of an encoded line. Any
  766. TAB (HT) or SPACE characters on an encoded line MUST thus be
  767. followed on that line by a printable character. In particular, an
  768. Borenstein & Freed [Page 18]
  769. RFC 1521 MIME September 1993
  770. "=" at the end of an encoded line, indicating a soft line break
  771. (see rule #5) may follow one or more TAB (HT) or SPACE characters.
  772. It follows that an octet with value 9 or 32 appearing at the end
  773. of an encoded line must be represented according to Rule #1. This
  774. rule is necessary because some MTAs (Message Transport Agents,
  775. programs which transport messages from one user to another, or
  776. perform a part of such transfers) are known to pad lines of text
  777. with SPACEs, and others are known to remove "white space"
  778. characters from the end of a line. Therefore, when decoding a
  779. Quoted-Printable body, any trailing white space on a line must be
  780. deleted, as it will necessarily have been added by intermediate
  781. transport agents.
  782. Rule #4 (Line Breaks): A line break in a text body, independent of
  783. what its representation is following the canonical representation
  784. of the data being encoded, must be represented by a (RFC 822) line
  785. break, which is a CRLF sequence, in the Quoted-Printable encoding.
  786. Since the canonical representation of types other than text do not
  787. generally include the representation of line breaks, no hard line
  788. breaks (i.e. line breaks that are intended to be meaningful and
  789. to be displayed to the user) should occur in the quoted-printable
  790. encoding of such types. Of course, occurrences of "=0D", "=0A",
  791. "0A=0D" and "=0D=0A" will eventually be encountered. In general,
  792. however, base64 is preferred over quoted-printable for binary
  793. data.
  794. Note that many implementations may elect to encode the local
  795. representation of various content types directly, as described in
  796. Appendix G. In particular, this may apply to plain text material
  797. on systems that use newline conventions other than CRLF
  798. delimiters. Such an implementation is permissible, but the
  799. generation of line breaks must be generalized to account for the
  800. case where alternate representations of newline sequences are
  801. used.
  802. Rule #5 (Soft Line Breaks): The Quoted-Printable encoding REQUIRES
  803. that encoded lines be no more than 76 characters long. If longer
  804. lines are to be encoded with the Quoted-Printable encoding, 'soft'
  805. line breaks must be used. An equal sign as the last character on a
  806. encoded line indicates such a non-significant ('soft') line break
  807. in the encoded text. Thus if the "raw" form of the line is a
  808. single unencoded line that says:
  809. Now's the time for all folk to come to the aid of
  810. their country.
  811. This can be represented, in the Quoted-Printable encoding, as
  812. Borenstein & Freed [Page 19]
  813. RFC 1521 MIME September 1993
  814. Now's the time =
  815. for all folk to come=
  816. to the aid of their country.
  817. This provides a mechanism with which long lines are encoded in
  818. such a way as to be restored by the user agent. The 76 character
  819. limit does not count the trailing CRLF, but counts all other
  820. characters, including any equal signs.
  821. Since the hyphen character ("-") is represented as itself in the
  822. Quoted-Printable encoding, care must be taken, when encapsulating a
  823. quoted-printable encoded body in a multipart entity, to ensure that
  824. the encapsulation boundary does not appear anywhere in the encoded
  825. body. (A good strategy is to choose a boundary that includes a
  826. character sequence such as "=_" which can never appear in a quoted-
  827. printable body. See the definition of multipart messages later in
  828. this document.)
  829. NOTE: The quoted-printable encoding represents something of a
  830. compromise between readability and reliability in transport.
  831. Bodies encoded with the quoted-printable encoding will work
  832. reliably over most mail gateways, but may not work perfectly over
  833. a few gateways, notably those involving translation into EBCDIC.
  834. (In theory, an EBCDIC gateway could decode a quoted-printable body
  835. and re-encode it using base64, but such gateways do not yet
  836. exist.) A higher level of confidence is offered by the base64
  837. Content-Transfer-Encoding. A way to get reasonably reliable
  838. transport through EBCDIC gateways is to also quote the ASCII
  839. characters
  840. !"#$@[\]^`{|}~
  841. according to rule #1. See Appendix B for more information.
  842. Because quoted-printable data is generally assumed to be line-
  843. oriented, it is to be expected that the representation of the breaks
  844. between the lines of quoted printable data may be altered in
  845. transport, in the same manner that plain text mail has always been
  846. altered in Internet mail when passing between systems with differing
  847. newline conventions. If such alterations are likely to constitute a
  848. corruption of the data, it is probably more sensible to use the
  849. base64 encoding rather than the quoted-printable encoding.
  850. WARNING TO IMPLEMENTORS: If binary data are encoded in quoted-
  851. printable, care must be taken to encode CR and LF characters as "=0D"
  852. and "=0A", respectively. In particular, a CRLF sequence in binary
  853. data should be encoded as "=0D=0A". Otherwise, if CRLF were
  854. represented as a hard line break, it might be incorrectly decoded on
  855. Borenstein & Freed [Page 20]
  856. RFC 1521 MIME September 1993
  857. platforms with different line break conventions.
  858. For formalists, the syntax of quoted-printable data is described by
  859. the following grammar:
  860. quoted-printable := ([*(ptext / SPACE / TAB) ptext] ["="] CRLF)
  861. ; Maximum line length of 76 characters excluding CRLF
  862. ptext := octet /<any ASCII character except "=", SPACE, or TAB>
  863. ; characters not listed as "mail-safe" in Appendix B
  864. ; are also not recommended.
  865. octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F")
  866. ; octet must be used for characters > 127, =, SPACE, or TAB,
  867. ; and is recommended for any characters not listed in
  868. ; Appendix B as "mail-safe".
  869. 5.2. Base64 Content-Transfer-Encoding
  870. The Base64 Content-Transfer-Encoding is designed to represent
  871. arbitrary sequences of octets in a form that need not be humanly
  872. readable. The encoding and decoding algorithms are simple, but the
  873. encoded data are consistently only about 33 percent larger than the
  874. unencoded data. This encoding is virtually identical to the one used
  875. in Privacy Enhanced Mail (PEM) applications, as defined in RFC 1421.
  876. The base64 encoding is adapted from RFC 1421, with one change: base64
  877. eliminates the "*" mechanism for embedded clear text.
  878. A 65-character subset of US-ASCII is used, enabling 6 bits to be
  879. represented per printable character. (The extra 65th character, "=",
  880. is used to signify a special processing function.)
  881. NOTE: This subset has the important property that it is
  882. represented identically in all versions of ISO 646, including US
  883. ASCII, and all characters in the subset are also represented
  884. identically in all versions of EBCDIC. Other popular encodings,
  885. such as the encoding used by the uuencode utility and the base85
  886. encoding specified as part of Level 2 PostScript, do not share
  887. these properties, and thus do not fulfill the portability
  888. requirements a binary transport encoding for mail must meet.
  889. The encoding process represents 24-bit groups of input bits as output
  890. strings of 4 encoded characters. Proceeding from left to right, a
  891. 24-bit input group is formed by concatenating 3 8-bit input groups.
  892. These 24 bits are then treated as 4 concatenated 6-bit groups, each
  893. of which is translated into a single digit in the base64 alphabet.
  894. When encoding a bit stream via the base64 encoding, the bit stream
  895. must be presumed to be ordered with the most-significant-bit first.
  896. Borenstein & Freed [Page 21]
  897. RFC 1521 MIME September 1993
  898. That is, the first bit in the stream will be the high-order bit in
  899. the first byte, and the eighth bit will be the low-order bit in the
  900. first byte, and so on.
  901. Each 6-bit group is used as an index into an array of 64 printable
  902. characters. The character referenced by the index is placed in the
  903. output string. These characters, identified in Table 1, below, are
  904. selected so as to be universally representable, and the set excludes
  905. characters with particular significance to SMTP (e.g., ".", CR, LF)
  906. and to the encapsulation boundaries defined in this document (e.g.,
  907. "-").
  908. Table 1: The Base64 Alphabet
  909. Value Encoding Value Encoding Value Encoding Value Encoding
  910. 0 A 17 R 34 i 51 z
  911. 1 B 18 S 35 j 52 0
  912. 2 C 19 T 36 k 53 1
  913. 3 D 20 U 37 l 54 2
  914. 4 E 21 V 38 m 55 3
  915. 5 F 22 W 39 n 56 4
  916. 6 G 23 X 40 o 57 5
  917. 7 H 24 Y 41 p 58 6
  918. 8 I 25 Z 42 q 59 7
  919. 9 J 26 a 43 r 60 8
  920. 10 K 27 b 44 s 61 9
  921. 11 L 28 c 45 t 62 +
  922. 12 M 29 d 46 u 63 /
  923. 13 N 30 e 47 v
  924. 14 O 31 f 48 w (pad) =
  925. 15 P 32 g 49 x
  926. 16 Q 33 h 50 y
  927. The output stream (encoded bytes) must be represented in lines of no
  928. more than 76 characters each. All line breaks or other characters
  929. not found in Table 1 must be ignored by decoding software. In base64
  930. data, characters other than those in Table 1, line breaks, and other
  931. white space probably indicate a transmission error, about which a
  932. warning message or even a message rejection might be appropriate
  933. under some circumstances.
  934. Special processing is performed if fewer than 24 bits are available
  935. at the end of the data being encoded. A full encoding quantum is
  936. always completed at the end of a body. When fewer than 24 input bits
  937. are available in an input group, zero bits are added (on the right)
  938. to form an integral number of 6-bit groups. Padding at the end of
  939. the data is performed using the '=' character. Since all base64
  940. input is an integral number of octets, only the following cases can
  941. Borenstein & Freed [Page 22]
  942. RFC 1521 MIME September 1993
  943. arise: (1) the final quantum of encoding input is an integral
  944. multiple of 24 bits; here, the final unit of encoded output will be
  945. an integral multiple of 4 characters with no "=" padding, (2) the
  946. final quantum of encoding input is exactly 8 bits; here, the final
  947. unit of encoded output will be two characters followed by two "="
  948. padding characters, or (3) the final quantum of encoding input is
  949. exactly 16 bits; here, the final unit of encoded output will be three
  950. characters followed by one "=" padding character.
  951. Because it is used only for padding at the end of the data, the
  952. occurrence of any '=' characters may be taken as evidence that the
  953. end of the data has been reached (without truncation in transit). No
  954. such assurance is possible, however, when the number of octets
  955. transmitted was a multiple of three.
  956. Any characters outside of the base64 alphabet are to be ignored in
  957. base64-encoded data. The same applies to any illegal sequence of
  958. characters in the base64 encoding, such as "====="
  959. Care must be taken to use the proper octets for line breaks if base64
  960. encoding is applied directly to text material that has not been
  961. converted to canonical form. In particular, text line breaks must be
  962. converted into CRLF sequences prior to base64 encoding. The important
  963. thing to note is that this may be done directly by the encoder rather
  964. than in a prior canonicalization step in some implementations.
  965. NOTE: There is no need to worry about quoting apparent
  966. encapsulation boundaries within base64-encoded parts of multipart
  967. entities because no hyphen characters are used in the base64
  968. encoding.
  969. 6. Additional Content-Header Fields
  970. 6.1. Optional Content-ID Header Field
  971. In constructing a high-level user agent, it may be desirable to allow
  972. one body to make reference to another. Accordingly, bodies may be
  973. labeled using the "Content-ID" header field, which is syntactically
  974. identical to the "Message-ID" header field:
  975. id := "Content-ID" ":" msg-id
  976. Like the Message-ID values, Content-ID values must be generated to be
  977. world-unique.
  978. The Content-ID value may be used for uniquely identifying MIME
  979. entities in several contexts, particularly for cacheing data
  980. referenced by the message/external-body mechanism. Although the
  981. Content-ID header is generally optional, its use is mandatory in
  982. Borenstein & Freed [Page 23]
  983. RFC 1521 MIME September 1993
  984. implementations which generate data of the optional MIME Content-type
  985. "message/external-body". That is, each message/external-body entity
  986. must have a Content-ID field to permit cacheing of such data.
  987. It is also worth noting that the Content-ID value has special
  988. semantics in the case of the multipart/alternative content-type.
  989. This is explained in the section of this document dealing with
  990. multipart/alternative.
  991. 6.2. Optional Content-Description Header Field
  992. The ability to associate some descriptive information with a given
  993. body is often desirable. For example, it may be useful to mark an
  994. "image" body as "a picture of the Space Shuttle Endeavor." Such text
  995. may be placed in the Content-Description header field.
  996. description := "Content-Description" ":" *text
  997. The description is presumed to be given in the US-ASCII character
  998. set, although the mechanism specified in [RFC-1522] may be used for
  999. non-US-ASCII Content-Description values.
  1000. 7. The Predefined Content-Type Values
  1001. This document defines seven initial Content-Type values and an
  1002. extension mechanism for private or experimental types. Further
  1003. standard types must be defined by new published specifications. It
  1004. is expected that most innovation in new types of mail will take place
  1005. as subtypes of the seven types defined here. The most essential
  1006. characteristics of the seven content-types are summarized in Appendix
  1007. F.
  1008. 7.1 The Text Content-Type
  1009. The text Content-Type is intended for sending material which is
  1010. principally textual in form. It is the default Content-Type. A
  1011. "charset" parameter may be used to indicate the character set of the
  1012. body text for some text subtypes, notably including the primary
  1013. subtype, "text/plain", which indicates plain (unformatted) text. The
  1014. default Content-Type for Internet mail is "text/plain; charset=us-
  1015. ascii".
  1016. Beyond plain text, there are many formats for representing what might
  1017. be known as "extended text" -- text with embedded formatting and
  1018. presentation information. An interesting characteristic of many such
  1019. representations is that they are to some extent readable even without
  1020. the software that interprets them. It is useful, then, to
  1021. distinguish them, at the highest level, from such unreadable data as
  1022. Borenstein & Freed [Page 24]
  1023. RFC 1521 MIME September 1993
  1024. images, audio, or text represented in an unreadable form. In the
  1025. absence of appropriate interpretation software, it is reasonable to
  1026. show subtypes of text to the user, while it is not reasonable to do
  1027. so with most nontextual data.
  1028. Such formatted textual data should be represented using subtypes of
  1029. text. Plausible subtypes of text are typically given by the common
  1030. name of the representation format, e.g., "text/richtext" [RFC-1341].
  1031. 7.1.1. The charset parameter
  1032. A critical parameter that may be specified in the Content-Type field
  1033. for text/plain data is the character set. This is specified with a
  1034. "charset" parameter, as in:
  1035. Content-type: text/plain; charset=us-ascii
  1036. Unlike some other parameter values, the values of the charset
  1037. parameter are NOT case sensitive. The default character set, which
  1038. must be assumed in the absence of a charset parameter, is US-ASCII.
  1039. The specification for any future subtypes of "text" must specify
  1040. whether or not they will also utilize a "charset" parameter, and may
  1041. possibly restrict its values as well. When used with a particular
  1042. body, the semantics of the "charset" parameter should be identical to
  1043. those specified here for "text/plain", i.e., the body consists
  1044. entirely of characters in the given charset. In particular, definers
  1045. of future text subtypes should pay close attention the the
  1046. implications of multibyte character sets for their subtype
  1047. definitions.
  1048. This RFC specifies the definition of the charset parameter for the
  1049. purposes of MIME to be a unique mapping of a byte stream to glyphs, a
  1050. mapping which does not require external profiling information.
  1051. An initial list of predefined character set names can be found at the
  1052. end of this section. Additional character sets may be registered
  1053. with IANA, although the standardization of their use requires the
  1054. usual IESG [RFC-1340] review and approval. Note that if the
  1055. specified character set includes 8-bit data, a Content-Transfer-
  1056. Encoding header field and a corresponding encoding on the data are
  1057. required in order to transmit the body via some mail transfer
  1058. protocols, such as SMTP.
  1059. The default character set, US-ASCII, has been the subject of some
  1060. confusion and ambiguity in the past. Not only were there some
  1061. ambiguities in the definition, there have been wide variations in
  1062. practice. In order to eliminate such ambiguity and variations in the
  1063. Borenstein & Freed [Page 25]
  1064. RFC 1521 MIME September 1993
  1065. future, it is strongly recommended that new user agents explicitly
  1066. specify a character set via the Content-Type header field. "US-
  1067. ASCII" does not indicate an arbitrary seven-bit character code, but
  1068. specifies that the body uses character coding that uses the exact
  1069. correspondence of codes to characters specified in ASCII. National
  1070. use variations of ISO 646 [ISO-646] are NOT ASCII and their use in
  1071. Internet mail is explicitly discouraged. The omission of the ISO 646
  1072. character set is deliberate in this regard. The character set name
  1073. of "US-ASCII" explicitly refers to ANSI X3.4-1986 [US-ASCII] only.
  1074. The character set name "ASCII" is reserved and must not be used for
  1075. any purpose.
  1076. NOTE: RFC 821 explicitly specifies "ASCII", and references an
  1077. earlier version of the American Standard. Insofar as one of the
  1078. purposes of specifying a Content-Type and character set is to
  1079. permit the receiver to unambiguously determine how the sender
  1080. intended the coded message to be interpreted, assuming anything
  1081. other than "strict ASCII" as the default would risk unintentional
  1082. and incompatible changes to the semantics of messages now being
  1083. transmitted. This also implies that messages containing
  1084. characters coded according to national variations on ISO 646, or
  1085. using code-switching procedures (e.g., those of ISO 2022), as well
  1086. as 8-bit or multiple octet character encodings MUST use an
  1087. appropriate character set specification to be consistent with this
  1088. specification.
  1089. The complete US-ASCII character set is listed in [US-ASCII]. Note
  1090. that the control characters including DEL (0-31, 127) have no defined
  1091. meaning apart from the combination CRLF (ASCII values 13 and 10)
  1092. indicating a new line. Two of the characters have de facto meanings
  1093. in wide use: FF (12) often means "start subsequent text on the
  1094. beginning of a new page"; and TAB or HT (9) often (though not always)
  1095. means "move the cursor to the next available column after the current
  1096. position where the column number is a multiple of 8 (counting the
  1097. first column as column 0)." Apart from this, any use of the control
  1098. characters or DEL in a body must be part of a private agreement
  1099. between the sender and recipient. Such private agreements are
  1100. discouraged and should be replaced by the other capabilities of this
  1101. document.
  1102. NOTE: Beyond US-ASCII, an enormous proliferation of character sets
  1103. is possible. It is the opinion of the IETF working group that a
  1104. large number of character sets is NOT a good thing. We would
  1105. prefer to specify a single character set that can be used
  1106. universally for representing all of the world's languages in
  1107. electronic mail. Unfortunately, existing practice in several
  1108. communities seems to point to the continued use of multiple
  1109. character sets in the near future. For this reason, we define
  1110. Borenstein & Freed [Page 26]
  1111. RFC 1521 MIME September 1993
  1112. names for a small number of character sets for which a strong
  1113. constituent base exists.
  1114. The defined charset values are:
  1115. US-ASCII -- as defined in [US-ASCII].
  1116. ISO-8859-X -- where "X" is to be replaced, as necessary, for the
  1117. parts of ISO-8859 [ISO-8859]. Note that the ISO 646
  1118. character sets have deliberately been omitted in favor of
  1119. their 8859 replacements, which are the designated character
  1120. sets for Internet mail. As of the publication of this
  1121. document, the legitimate values for "X" are the digits 1
  1122. through 9.
  1123. The character sets specified above are the ones that were relatively
  1124. uncontroversial during the drafting of MIME. This document does not
  1125. endorse the use of any particular character set other than US-ASCII,
  1126. and recognizes that the future evolution of world character sets
  1127. remains unclear. It is expected that in the future, additional
  1128. character sets will be registered for use in MIME.
  1129. Note that the character set used, if anything other than US-ASCII,
  1130. must always be explicitly specified in the Content-Type field.
  1131. No other character set name may be used in Internet mail without the
  1132. publication of a formal specification and its registration with IANA,
  1133. or by private agreement, in which case the character set name must
  1134. begin with "X-".
  1135. Implementors are discouraged from defining new character sets for
  1136. mail use unless absolutely necessary.
  1137. The "charset" parameter has been defined primarily for the purpose of
  1138. textual data, and is described in this section for that reason.
  1139. However, it is conceivable that non-textual data might also wish to
  1140. specify a charset value for some purpose, in which case the same
  1141. syntax and values should be used.
  1142. In general, mail-sending software must always use the "lowest common
  1143. denominator" character set possible. For example, if a body contains
  1144. only US-ASCII characters, it must be marked as being in the US-ASCII
  1145. character set, not ISO-8859-1, which, like all the ISO-8859 family of
  1146. character sets, is a superset of US-ASCII. More generally, if a
  1147. widely-used character set is a subset of another character set, and a
  1148. body contains only characters in the widely-used subset, it must be
  1149. labeled as being in that subset. This will increase the chances that
  1150. the recipient will be able to view the mail correctly.
  1151. Borenstein & Freed [Page 27]
  1152. RFC 1521 MIME September 1993
  1153. 7.1.2. The Text/plain subtype
  1154. The primary subtype of text is "plain". This indicates plain
  1155. (unformatted) text. The default Content-Type for Internet mail,
  1156. "text/plain; charset=us-ascii", describes existing Internet practice.
  1157. That is, it is the type of body defined by RFC 822.
  1158. No other text subtype is defined by this document.
  1159. The formal grammar for the content-type header field for text is as
  1160. follows:
  1161. text-type := "text" "/" text-subtype [";" "charset" "=" charset]
  1162. text-subtype := "plain" / extension-token
  1163. charset := "us-ascii"/ "iso-8859-1"/ "iso-8859-2"/ "iso-8859-3"
  1164. / "iso-8859-4"/ "iso-8859-5"/ "iso-8859-6"/ "iso-8859-7"
  1165. / "iso-8859-8" / "iso-8859-9" / extension-token
  1166. ; case insensitive
  1167. 7.2. The Multipart Content-Type
  1168. In the case of multiple part entities, in which one or more different
  1169. sets of data are combined in a single body, a "multipart" Content-
  1170. Type field must appear in the entity's header. The body must then
  1171. contain one or more "body parts," each preceded by an encapsulation
  1172. boundary, and the last one followed by a closing boundary. Each part
  1173. starts with an encapsulation boundary, and then contains a body part
  1174. consisting of header area, a blank line, and a body area. Thus a
  1175. body part is similar to an RFC 822 message in syntax, but different
  1176. in meaning.
  1177. A body part is NOT to be interpreted as actually being an RFC 822
  1178. message. To begin with, NO header fields are actually required in
  1179. body parts. A body part that starts with a blank line, therefore, is
  1180. allowed and is a body part for which all default values are to be
  1181. assumed. In such a case, the absence of a Content-Type header field
  1182. implies that the corresponding body is plain US-ASCII text. The only
  1183. header fields that have defined meaning for body parts are those the
  1184. names of which begin with "Content-". All other header fields are
  1185. generally to be ignored in body parts. Although they should
  1186. generally be retained in mail processing, they may be discarded by
  1187. gateways if necessary. Such other fields are permitted to appear in
  1188. body parts but must not be depended on. "X-" fields may be created
  1189. for experimental or private purposes, with the recognition that the
  1190. information they contain may be lost at some gateways.
  1191. Borenstein & Freed [Page 28]
  1192. RFC 1521 MIME September 1993
  1193. NOTE: The distinction between an RFC 822 message and a body part
  1194. is subtle, but important. A gateway between Internet and X.400
  1195. mail, for example, must be able to tell the difference between a
  1196. body part that contains an image and a body part that contains an
  1197. encapsulated message, the body of which is an image. In order to
  1198. represent the latter, the body part must have "Content-Type:
  1199. message", and its body (after the blank line) must be the
  1200. encapsulated message, with its own "Content-Type: image" header
  1201. field. The use of similar syntax facilitates the conversion of
  1202. messages to body parts, and vice versa, but the distinction
  1203. between the two must be understood by implementors. (For the
  1204. special case in which all parts actually are messages, a "digest"
  1205. subtype is also defined.)
  1206. As stated previously, each body part is preceded by an encapsulation
  1207. boundary. The encapsulation boundary MUST NOT appear inside any of
  1208. the encapsulated parts. Thus, it is crucial that the composing agent
  1209. be able to choose and specify the unique boundary that will separate
  1210. the parts.
  1211. All present and future subtypes of the "multipart" type must use an
  1212. identical syntax. Subtypes may differ in their semantics, and may
  1213. impose additional restrictions on syntax, but must conform to the
  1214. required syntax for the multipart type. This requirement ensures
  1215. that all conformant user agents will at least be able to recognize
  1216. and separate the parts of any multipart entity, even of an
  1217. unrecognized subtype.
  1218. As stated in the definition of the Content-Transfer-Encoding field,
  1219. no encoding other than "7bit", "8bit", or "binary" is permitted for
  1220. entities of type "multipart". The multipart delimiters and header
  1221. fields are always represented as 7-bit ASCII in any case (though the
  1222. header fields may encode non-ASCII header text as per [RFC-1522]),
  1223. and data within the body parts can be encoded on a part-by-part
  1224. basis, with Content-Transfer-Encoding fields for each appropriate
  1225. body part.
  1226. Mail gateways, relays, and other mail handling agents are commonly
  1227. known to alter the top-level header of an RFC 822 message. In
  1228. particular, they frequently add, remove, or reorder header fields.
  1229. Such alterations are explicitly forbidden for the body part headers
  1230. embedded in the bodies of messages of type "multipart."
  1231. 7.2.1. Multipart: The common syntax
  1232. All subtypes of "multipart" share a common syntax, defined in this
  1233. section. A simple example of a multipart message also appears in
  1234. this section. An example of a more complex multipart message is
  1235. Borenstein & Freed [Page 29]
  1236. RFC 1521 MIME September 1993
  1237. given in Appendix C.
  1238. The Content-Type field for multipart entities requires one parameter,
  1239. "boundary", which is used to specify the encapsulation boundary. The
  1240. encapsulation boundary is defined as a line consisting entirely of
  1241. two hyphen characters ("-", decimal code 45) followed by the boundary
  1242. parameter value from the Content-Type header field.
  1243. NOTE: The hyphens are for rough compatibility with the earlier RFC
  1244. 934 method of message encapsulation, and for ease of searching for
  1245. the boundaries in some implementations. However, it should be
  1246. noted that multipart messages are NOT completely compatible with
  1247. RFC 934 encapsulations; in particular, they do not obey RFC 934
  1248. quoting conventions for embedded lines that begin with hyphens.
  1249. This mechanism was chosen over the RFC 934 mechanism because the
  1250. latter causes lines to grow with each level of quoting. The
  1251. combination of this growth with the fact that SMTP implementations
  1252. sometimes wrap long lines made the RFC 934 mechanism unsuitable
  1253. for use in the event that deeply-nested multipart structuring is
  1254. ever desired.
  1255. WARNING TO IMPLEMENTORS: The grammar for parameters on the Content-
  1256. type field is such that it is often necessary to enclose the
  1257. boundaries in quotes on the Content-type line. This is not always
  1258. necessary, but never hurts. Implementors should be sure to study the
  1259. grammar carefully in order to avoid producing illegal Content-type
  1260. fields. Thus, a typical multipart Content-Type header field might
  1261. look like this:
  1262. Content-Type: multipart/mixed;
  1263. boundary=gc0p4Jq0M2Yt08jU534c0p
  1264. But the following is illegal:
  1265. Content-Type: multipart/mixed;
  1266. boundary=gc0p4Jq0M:2Yt08jU534c0p
  1267. (because of the colon) and must instead be represented as
  1268. Content-Type: multipart/mixed;
  1269. boundary="gc0p4Jq0M:2Yt08jU534c0p"
  1270. This indicates that the entity consists of several parts, each itself
  1271. with a structure that is syntactically identical to an RFC 822
  1272. message, except that the header area might be completely empty, and
  1273. that the parts are each preceded by the line
  1274. --gc0p4Jq0M:2Yt08jU534c0p
  1275. Borenstein & Freed [Page 30]
  1276. RFC 1521 MIME September 1993
  1277. Note that the encapsulation boundary must occur at the beginning of a
  1278. line, i.e., following a CRLF, and that the initial CRLF is considered
  1279. to be attached to the encapsulation boundary rather than part of the
  1280. preceding part. The boundary must be followed immediately either by
  1281. another CRLF and the header fields for the next part, or by two
  1282. CRLFs, in which case there are no header fields for the next part
  1283. (and it is therefore assumed to be of Content-Type text/plain).
  1284. NOTE: The CRLF preceding the encapsulation line is conceptually
  1285. attached to the boundary so that it is possible to have a part
  1286. that does not end with a CRLF (line break). Body parts that must
  1287. be considered to end with line breaks, therefore, must have two
  1288. CRLFs preceding the encapsulation line, the first of which is part
  1289. of the preceding body part, and the second of which is part of the
  1290. encapsulation boundary.
  1291. Encapsulation boundaries must not appear within the encapsulations,
  1292. and must be no longer than 70 characters, not counting the two
  1293. leading hyphens.
  1294. The encapsulation boundary following the last body part is a
  1295. distinguished delimiter that indicates that no further body parts
  1296. will follow. Such a delimiter is identical to the previous
  1297. delimiters, with the addition of two more hyphens at the end of the
  1298. line:
  1299. --gc0p4Jq0M2Yt08jU534c0p--
  1300. There appears to be room for additional information prior to the
  1301. first encapsulation boundary and following the final boundary. These
  1302. areas should generally be left blank, and implementations must ignore
  1303. anything that appears before the first boundary or after the last
  1304. one.
  1305. NOTE: These "preamble" and "epilogue" areas are generally not used
  1306. because of the lack of proper typing of these parts and the lack
  1307. of clear semantics for handling these areas at gateways,
  1308. particularly X.400 gateways. However, rather than leaving the
  1309. preamble area blank, many MIME implementations have found this to
  1310. be a convenient place to insert an explanatory note for recipients
  1311. who read the message with pre-MIME software, since such notes will
  1312. be ignored by MIME-compliant software.
  1313. NOTE: Because encapsulation boundaries must not appear in the body
  1314. parts being encapsulated, a user agent must exercise care to
  1315. choose a unique boundary. The boundary in the example above could
  1316. have been the result of an algorithm designed to produce
  1317. boundaries with a very low probability of already existing in the
  1318. Borenstein & Freed [Page 31]
  1319. RFC 1521 MIME September 1993
  1320. data to be encapsulated without having to prescan the data.
  1321. Alternate algorithms might result in more 'readable' boundaries
  1322. for a recipient with an old user agent, but would require more
  1323. attention to the possibility that the boundary might appear in the
  1324. encapsulated part. The simplest boundary possible is something
  1325. like "---", with a closing boundary of "-----".
  1326. As a very simple example, the following multipart message has two
  1327. parts, both of them plain text, one of them explicitly typed and one
  1328. of them implicitly typed:
  1329. From: Nathaniel Borenstein <nsb@bellcore.com>
  1330. To: Ned Freed <ned@innosoft.com>
  1331. Subject: Sample message
  1332. MIME-Version: 1.0
  1333. Content-type: multipart/mixed; boundary="simple
  1334. boundary"
  1335. This is the preamble. It is to be ignored, though it
  1336. is a handy place for mail composers to include an
  1337. explanatory note to non-MIME conformant readers.
  1338. --simple boundary
  1339. This is implicitly typed plain ASCII text.
  1340. It does NOT end with a linebreak.
  1341. --simple boundary
  1342. Content-type: text/plain; charset=us-ascii
  1343. This is explicitly typed plain ASCII text.
  1344. It DOES end with a linebreak.
  1345. --simple boundary--
  1346. This is the epilogue. It is also to be ignored.
  1347. The use of a Content-Type of multipart in a body part within another
  1348. multipart entity is explicitly allowed. In such cases, for obvious
  1349. reasons, care must be taken to ensure that each nested multipart
  1350. entity must use a different boundary delimiter. See Appendix C for an
  1351. example of nested multipart entities.
  1352. The use of the multipart Content-Type with only a single body part
  1353. may be useful in certain contexts, and is explicitly permitted.
  1354. The only mandatory parameter for the multipart Content-Type is the
  1355. boundary parameter, which consists of 1 to 70 characters from a set
  1356. of characters known to be very robust through email gateways, and NOT
  1357. ending with white space. (If a boundary appears to end with white
  1358. space, the white space must be presumed to have been added by a
  1359. Borenstein & Freed [Page 32]
  1360. RFC 1521 MIME September 1993
  1361. gateway, and must be deleted.) It is formally specified by the
  1362. following BNF:
  1363. boundary := 0*69<bchars> bcharsnospace
  1364. bchars := bcharsnospace / " "
  1365. bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" /"_"
  1366. / "," / "-" / "." / "/" / ":" / "=" / "?"
  1367. Overall, the body of a multipart entity may be specified as
  1368. follows:
  1369. multipart-body := preamble 1*encapsulation
  1370. close-delimiter epilogue
  1371. encapsulation := delimiter body-part CRLF
  1372. delimiter := "--" boundary CRLF ; taken from Content-Type field.
  1373. ; There must be no space
  1374. ; between "--" and boundary.
  1375. close-delimiter := "--" boundary "--" CRLF ; Again, no space
  1376. by "--",
  1377. preamble := discard-text ; to be ignored upon receipt.
  1378. epilogue := discard-text ; to be ignored upon receipt.
  1379. discard-text := *(*text CRLF)
  1380. body-part := <"message" as defined in RFC 822,
  1381. with all header fields optional, and with the
  1382. specified delimiter not occurring anywhere in
  1383. the message body, either on a line by itself
  1384. or as a substring anywhere. Note that the
  1385. semantics of a part differ from the semantics
  1386. of a message, as described in the text.>
  1387. NOTE: In certain transport enclaves, RFC 822 restrictions such as
  1388. the one that limits bodies to printable ASCII characters may not
  1389. be in force. (That is, the transport domains may resemble
  1390. standard Internet mail transport as specified in RFC821 and
  1391. assumed by RFC822, but without certain restrictions.) The
  1392. relaxation of these restrictions should be construed as locally
  1393. extending the definition of bodies, for example to include octets
  1394. outside of the ASCII range, as long as these extensions are
  1395. supported by the transport and adequately documented in the
  1396. Borenstein & Freed [Page 33]
  1397. RFC 1521 MIME September 1993
  1398. Content-Transfer-Encoding header field. However, in no event are
  1399. headers (either message headers or body-part headers) allowed to
  1400. contain anything other than ASCII characters.
  1401. NOTE: Conspicuously missing from the multipart type is a notion of
  1402. structured, related body parts. In general, it seems premature to
  1403. try to standardize interpart structure yet. It is recommended
  1404. that those wishing to provide a more structured or integrated
  1405. multipart messaging facility should define a subtype of multipart
  1406. that is syntactically identical, but that always expects the
  1407. inclusion of a distinguished part that can be used to specify the
  1408. structure and integration of the other parts, probably referring
  1409. to them by their Content-ID field. If this approach is used,
  1410. other implementations will not recognize the new subtype, but will
  1411. treat it as the primary subtype (multipart/mixed) and will thus be
  1412. able to show the user the parts that are recognized.
  1413. 7.2.2. The Multipart/mixed (primary) subtype
  1414. The primary subtype for multipart, "mixed", is intended for use when
  1415. the body parts are independent and need to be bundled in a particular
  1416. order. Any multipart subtypes that an implementation does not
  1417. recognize must be treated as being of subtype "mixed".
  1418. 7.2.3. The Multipart/alternative subtype
  1419. The multipart/alternative type is syntactically identical to
  1420. multipart/mixed, but the semantics are different. In particular,
  1421. each of the parts is an "alternative" version of the same
  1422. information.
  1423. Systems should recognize that the content of the various parts are
  1424. interchangeable. Systems should choose the "best" type based on the
  1425. local environment and preferences, in some cases even through user
  1426. interaction. As with multipart/mixed, the order of body parts is
  1427. significant. In this case, the alternatives appear in an order of
  1428. increasing faithfulness to the original content. In general, the best
  1429. choice is the LAST part of a type supported by the recipient system's
  1430. local environment.
  1431. Multipart/alternative may be used, for example, to send mail in a
  1432. fancy text format in such a way that it can easily be displayed
  1433. anywhere:
  1434. Borenstein & Freed [Page 34]
  1435. RFC 1521 MIME September 1993
  1436. From: Nathaniel Borenstein <nsb@bellcore.com>
  1437. To: Ned Freed <ned@innosoft.com>
  1438. Subject: Formatted text mail
  1439. MIME-Version: 1.0
  1440. Content-Type: multipart/alternative; boundary=boundary42
  1441. --boundary42
  1442. Content-Type: text/plain; charset=us-ascii
  1443. ...plain text version of message goes here....
  1444. --boundary42
  1445. Content-Type: text/richtext
  1446. .... RFC 1341 richtext version of same message goes here ...
  1447. --boundary42
  1448. Content-Type: text/x-whatever
  1449. .... fanciest formatted version of same message goes here
  1450. ...
  1451. --boundary42--
  1452. In this example, users whose mail system understood the "text/x-
  1453. whatever" format would see only the fancy version, while other users
  1454. would see only the richtext or plain text version, depending on the
  1455. capabilities of their system.
  1456. In general, user agents that compose multipart/alternative entities
  1457. must place the body parts in increasing order of preference, that is,
  1458. with the preferred format last. For fancy text, the sending user
  1459. agent should put the plainest format first and the richest format
  1460. last. Receiving user agents should pick and display the last format
  1461. they are capable of displaying. In the case where one of the
  1462. alternatives is itself of type "multipart" and contains unrecognized
  1463. sub-parts, the user agent may choose either to show that alternative,
  1464. an earlier alternative, or both.
  1465. NOTE: From an implementor's perspective, it might seem more
  1466. sensible to reverse this ordering, and have the plainest
  1467. alternative last. However, placing the plainest alternative first
  1468. is the friendliest possible option when multipart/alternative
  1469. entities are viewed using a non-MIME-conformant mail reader.
  1470. While this approach does impose some burden on conformant mail
  1471. readers, interoperability with older mail readers was deemed to be
  1472. more important in this case.
  1473. It may be the case that some user agents, if they can recognize more
  1474. than one of the formats, will prefer to offer the user the choice of
  1475. Borenstein & Freed [Page 35]
  1476. RFC 1521 MIME September 1993
  1477. which format to view. This makes sense, for example, if mail
  1478. includes both a nicely-formatted image version and an easily-edited
  1479. text version. What is most critical, however, is that the user not
  1480. automatically be shown multiple versions of the same data. Either
  1481. the user should be shown the last recognized version or should be
  1482. given the choice.
  1483. NOTE ON THE SEMANTICS OF CONTENT-ID IN MULTIPART/ALTERNATIVE: Each
  1484. part of a multipart/alternative entity represents the same data, but
  1485. the mappings between the two are not necessarily without information
  1486. loss. For example, information is lost when translating ODA to
  1487. PostScript or plain text. It is recommended that each part should
  1488. have a different Content-ID value in the case where the information
  1489. content of the two parts is not identical. However, where the
  1490. information content is identical -- for example, where several parts
  1491. of type "application/external- body" specify alternate ways to access
  1492. the identical data -- the same Content-ID field value should be used,
  1493. to optimize any cacheing mechanisms that might be present on the
  1494. recipient's end. However, it is recommended that the Content-ID
  1495. values used by the parts should not be the same Content-ID value that
  1496. describes the multipart/alternative as a whole, if there is any such
  1497. Content-ID field. That is, one Content-ID value will refer to the
  1498. multipart/alternative entity, while one or more other Content-ID
  1499. values will refer to the parts inside it.
  1500. 7.2.4. The Multipart/digest subtype
  1501. This document defines a "digest" subtype of the multipart Content-
  1502. Type. This type is syntactically identical to multipart/mixed, but
  1503. the semantics are different. In particular, in a digest, the default
  1504. Content-Type value for a body part is changed from "text/plain" to
  1505. "message/rfc822". This is done to allow a more readable digest
  1506. format that is largely compatible (except for the quoting convention)
  1507. with RFC 934.
  1508. Borenstein & Freed [Page 36]
  1509. RFC 1521 MIME September 1993
  1510. A digest in this format might, then, look something like this:
  1511. From: Moderator-Address
  1512. To: Recipient-List
  1513. MIME-Version: 1.0
  1514. Subject: Internet Digest, volume 42
  1515. Content-Type: multipart/digest;
  1516. boundary="---- next message ----"
  1517. ------ next message ----
  1518. From: someone-else
  1519. Subject: my opinion
  1520. ...body goes here ...
  1521. ------ next message ----
  1522. From: someone-else-again
  1523. Subject: my different opinion
  1524. ... another body goes here...
  1525. ------ next message ------
  1526. 7.2.5. The Multipart/parallel subtype
  1527. This document defines a "parallel" subtype of the multipart Content-
  1528. Type. This type is syntactically identical to multipart/mixed, but
  1529. the semantics are different. In particular, in a parallel entity,
  1530. the order of body parts is not significant.
  1531. A common presentation of this type is to display all of the parts
  1532. simultaneously on hardware and software that are capable of doing so.
  1533. However, composing agents should be aware that many mail readers will
  1534. lack this capability and will show the parts serially in any event.
  1535. 7.2.6. Other Multipart subtypes
  1536. Other multipart subtypes are expected in the future. MIME
  1537. implementations must in general treat unrecognized subtypes of
  1538. multipart as being equivalent to "multipart/mixed".
  1539. The formal grammar for content-type header fields for multipart data
  1540. is given by:
  1541. multipart-type := "multipart" "/" multipart-subtype
  1542. ";" "boundary" "=" boundary
  1543. Borenstein & Freed [Page 37]
  1544. RFC 1521 MIME September 1993
  1545. multipart-subtype := "mixed" / "parallel" / "digest"
  1546. / "alternative" / extension-token
  1547. 7.3. The Message Content-Type
  1548. It is frequently desirable, in sending mail, to encapsulate another
  1549. mail message. For this common operation, a special Content-Type,
  1550. "message", is defined. The primary subtype, message/rfc822, has no
  1551. required parameters in the Content-Type field. Additional subtypes,
  1552. "partial" and "External-body", do have required parameters. These
  1553. subtypes are explained below.
  1554. NOTE: It has been suggested that subtypes of message might be
  1555. defined for forwarded or rejected messages. However, forwarded
  1556. and rejected messages can be handled as multipart messages in
  1557. which the first part contains any control or descriptive
  1558. information, and a second part, of type message/rfc822, is the
  1559. forwarded or rejected message. Composing rejection and forwarding
  1560. messages in this manner will preserve the type information on the
  1561. original message and allow it to be correctly presented to the
  1562. recipient, and hence is strongly encouraged.
  1563. As stated in the definition of the Content-Transfer-Encoding field,
  1564. no encoding other than "7bit", "8bit", or "binary" is permitted for
  1565. messages or parts of type "message". Even stronger restrictions
  1566. apply to the subtypes "message/partial" and "message/external-body",
  1567. as specified below. The message header fields are always US-ASCII in
  1568. any case, and data within the body can still be encoded, in which
  1569. case the Content-Transfer-Encoding header field in the encapsulated
  1570. message will reflect this. Non-ASCII text in the headers of an
  1571. encapsulated message can be specified using the mechanisms described
  1572. in [RFC-1522].
  1573. Mail gateways, relays, and other mail handling agents are commonly
  1574. known to alter the top-level header of an RFC 822 message. In
  1575. particular, they frequently add, remove, or reorder header fields.
  1576. Such alterations are explicitly forbidden for the encapsulated
  1577. headers embedded in the bodies of messages of type "message."
  1578. 7.3.1. The Message/rfc822 (primary) subtype
  1579. A Content-Type of "message/rfc822" indicates that the body contains
  1580. an encapsulated message, with the syntax of an RFC 822 message.
  1581. However, unlike top-level RFC 822 messages, it is not required that
  1582. each message/rfc822 body must include a "From", "Subject", and at
  1583. least one destination header.
  1584. It should be noted that, despite the use of the numbers "822", a
  1585. Borenstein & Freed [Page 38]
  1586. RFC 1521 MIME September 1993
  1587. message/rfc822 entity can include enhanced information as defined in
  1588. this document. In other words, a message/rfc822 message may be a
  1589. MIME message.
  1590. 7.3.2. The Message/Partial subtype
  1591. A subtype of message, "partial", is defined in order to allow large
  1592. objects to be delivered as several separate pieces of mail and
  1593. automatically reassembled by the receiving user agent. (The concept
  1594. is similar to IP fragmentation/reassembly in the basic Internet
  1595. Protocols.) This mechanism can be used when intermediate transport
  1596. agents limit the size of individual messages that can be sent.
  1597. Content-Type "message/partial" thus indicates that the body contains
  1598. a fragment of a larger message.
  1599. Three parameters must be specified in the Content-Type field of type
  1600. message/partial: The first, "id", is a unique identifier, as close to
  1601. a world-unique identifier as possible, to be used to match the parts
  1602. together. (In general, the identifier is essentially a message-id;
  1603. if placed in double quotes, it can be any message-id, in accordance
  1604. with the BNF for "parameter" given earlier in this specification.)
  1605. The second, "number", an integer, is the part number, which indicates
  1606. where this part fits into the sequence of fragments. The third,
  1607. "total", another integer, is the total number of parts. This third
  1608. subfield is required on the final part, and is optional (though
  1609. encouraged) on the earlier parts. Note also that these parameters
  1610. may be given in any order.
  1611. Thus, part 2 of a 3-part message may have either of the following
  1612. header fields:
  1613. Content-Type: Message/Partial;
  1614. number=2; total=3;
  1615. id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
  1616. Content-Type: Message/Partial;
  1617. id="oc=jpbe0M2Yt4s@thumper.bellcore.com";
  1618. number=2
  1619. But part 3 MUST specify the total number of parts:
  1620. Content-Type: Message/Partial;
  1621. number=3; total=3;
  1622. id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
  1623. Note that part numbering begins with 1, not 0.
  1624. When the parts of a message broken up in this manner are put
  1625. Borenstein & Freed [Page 39]
  1626. RFC 1521 MIME September 1993
  1627. together, the result is a complete MIME entity, which may have its
  1628. own Content-Type header field, and thus may contain any other data
  1629. type.
  1630. Message fragmentation and reassembly: The semantics of a reassembled
  1631. partial message must be those of the "inner" message, rather than of
  1632. a message containing the inner message. This makes it possible, for
  1633. example, to send a large audio message as several partial messages,
  1634. and still have it appear to the recipient as a simple audio message
  1635. rather than as an encapsulated message containing an audio message.
  1636. That is, the encapsulation of the message is considered to be
  1637. "transparent".
  1638. When generating and reassembling the parts of a message/partial
  1639. message, the headers of the encapsulated message must be merged with
  1640. the headers of the enclosing entities. In this process the following
  1641. rules must be observed:
  1642. (1) All of the header fields from the initial enclosing entity
  1643. (part one), except those that start with "Content-" and the
  1644. specific header fields "Message-ID", "Encrypted", and "MIME-
  1645. Version", must be copied, in order, to the new message.
  1646. (2) Only those header fields in the enclosed message which start
  1647. with "Content-" and "Message-ID", "Encrypted", and "MIME-Version"
  1648. must be appended, in order, to the header fields of the new
  1649. message. Any header fields in the enclosed message which do not
  1650. start with "Content-" (except for "Message-ID", "Encrypted", and
  1651. "MIME-Version") will be ignored.
  1652. (3) All of the header fields from the second and any subsequent
  1653. messages will be ignored.
  1654. For example, if an audio message is broken into two parts, the first
  1655. part might look something like this:
  1656. X-Weird-Header-1: Foo
  1657. From: Bill@host.com
  1658. To: joe@otherhost.com
  1659. Subject: Audio mail
  1660. Message-ID: <id1@host.com>
  1661. MIME-Version: 1.0
  1662. Content-type: message/partial;
  1663. id="ABC@host.com";
  1664. number=1; total=2
  1665. X-Weird-Header-1: Bar
  1666. X-Weird-Header-2: Hello
  1667. Borenstein & Freed [Page 40]
  1668. RFC 1521 MIME September 1993
  1669. Message-ID: <anotherid@foo.com>
  1670. MIME-Version: 1.0
  1671. Content-type: audio/basic
  1672. Content-transfer-encoding: base64
  1673. ... first half of encoded audio data goes here...
  1674. and the second half might look something like this:
  1675. From: Bill@host.com
  1676. To: joe@otherhost.com
  1677. Subject: Audio mail
  1678. MIME-Version: 1.0
  1679. Message-ID: <id2@host.com>
  1680. Content-type: message/partial;
  1681. id="ABC@host.com"; number=2; total=2
  1682. ... second half of encoded audio data goes here...
  1683. Then, when the fragmented message is reassembled, the resulting
  1684. message to be displayed to the user should look something like this:
  1685. X-Weird-Header-1: Foo
  1686. From: Bill@host.com
  1687. To: joe@otherhost.com
  1688. Subject: Audio mail
  1689. Message-ID: <anotherid@foo.com>
  1690. MIME-Version: 1.0
  1691. Content-type: audio/basic
  1692. Content-transfer-encoding: base64
  1693. ... first half of encoded audio data goes here...
  1694. ... second half of encoded audio data goes here...
  1695. Note on encoding of MIME entities encapsulated inside message/partial
  1696. entities: Because data of type "message" may never be encoded in
  1697. base64 or quoted-printable, a problem might arise if message/partial
  1698. entities are constructed in an environment that supports binary or
  1699. 8-bit transport. The problem is that the binary data would be split
  1700. into multiple message/partial objects, each of them requiring binary
  1701. transport. If such objects were encountered at a gateway into a 7-
  1702. bit transport environment, there would be no way to properly encode
  1703. them for the 7-bit world, aside from waiting for all of the parts,
  1704. reassembling the message, and then encoding the reassembled data in
  1705. base64 or quoted-printable. Since it is possible that different
  1706. parts might go through different gateways, even this is not an
  1707. acceptable solution. For this reason, it is specified that MIME
  1708. entities of type message/partial must always have a content-
  1709. Borenstein & Freed [Page 41]
  1710. RFC 1521 MIME September 1993
  1711. transfer-encoding of 7-bit (the default). In particular, even in
  1712. environments that support binary or 8-bit transport, the use of a
  1713. content-transfer-encoding of "8bit" or "binary" is explicitly
  1714. prohibited for entities of type message/partial.
  1715. It should be noted that, because some message transfer agents may
  1716. choose to automatically fragment large messages, and because such
  1717. agents may use different fragmentation thresholds, it is possible
  1718. that the pieces of a partial message, upon reassembly, may prove
  1719. themselves to comprise a partial message. This is explicitly
  1720. permitted.
  1721. It should also be noted that the inclusion of a "References" field in
  1722. the headers of the second and subsequent pieces of a fragmented
  1723. message that references the Message-Id on the previous piece may be
  1724. of benefit to mail readers that understand and track references.
  1725. However, the generation of such "References" fields is entirely
  1726. optional.
  1727. Finally, it should be noted that the "Encrypted" header field has
  1728. been made obsolete by Privacy Enhanced Messaging (PEM), but the rules
  1729. above are believed to describe the correct way to treat it if it is
  1730. encountered in the context of conversion to and from message/partial
  1731. fragments.
  1732. 7.3.3. The Message/External-Body subtype
  1733. The external-body subtype indicates that the actual body data are not
  1734. included, but merely referenced. In this case, the parameters
  1735. describe a mechanism for accessing the external data.
  1736. When an entity is of type "message/external-body", it consists of a
  1737. header, two consecutive CRLFs, and the message header for the
  1738. encapsulated message. If another pair of consecutive CRLFs appears,
  1739. this of course ends the message header for the encapsulated message.
  1740. However, since the encapsulated message's body is itself external, it
  1741. does NOT appear in the area that follows. For example, consider the
  1742. following message:
  1743. Content-type: message/external-body; access-
  1744. type=local-file;
  1745. name="/u/nsb/Me.gif"
  1746. Content-type: image/gif
  1747. Content-ID: <id42@guppylake.bellcore.com>
  1748. Content-Transfer-Encoding: binary
  1749. Borenstein & Freed [Page 42]
  1750. RFC 1521 MIME September 1993
  1751. THIS IS NOT REALLY THE BODY!
  1752. The area at the end, which might be called the "phantom body", is
  1753. ignored for most external-body messages. However, it may be used to
  1754. contain auxiliary information for some such messages, as indeed it is
  1755. when the access-type is "mail-server". Of the access-types defined
  1756. by this document, the phantom body is used only when the access-type
  1757. is "mail-server". In all other cases, the phantom body is ignored.
  1758. The only always-mandatory parameter for message/external-body is
  1759. "access-type"; all of the other parameters may be mandatory or
  1760. optional depending on the value of access-type.
  1761. ACCESS-TYPE -- A case-insensitive word, indicating the supported
  1762. access mechanism by which the file or data may be obtained.
  1763. Values include, but are not limited to, "FTP", "ANON-FTP", "TFTP",
  1764. "AFS", "LOCAL-FILE", and "MAIL-SERVER". Future values, except for
  1765. experimental values beginning with "X-" must be registered with
  1766. IANA, as described in Appendix E .
  1767. In addition, the following three parameters are optional for ALL
  1768. access-types:
  1769. EXPIRATION -- The date (in the RFC 822 "date-time" syntax, as
  1770. extended by RFC 1123 to permit 4 digits in the year field) after
  1771. which the existence of the external data is not guaranteed.
  1772. SIZE -- The size (in octets) of the data. The intent of this
  1773. parameter is to help the recipient decide whether or not to expend
  1774. the necessary resources to retrieve the external data. Note that
  1775. this describes the size of the data in its canonical form, that
  1776. is, before any Content- Transfer-Encoding has been applied or
  1777. after the data have been decoded.
  1778. PERMISSION -- A case-insensitive field that indicates whether or
  1779. not it is expected that clients might also attempt to overwrite
  1780. the data. By default, or if permission is "read", the assumption
  1781. is that they are not, and that if the data is retrieved once, it
  1782. is never needed again. If PERMISSION is "read-write", this
  1783. assumption is invalid, and any local copy must be considered no
  1784. more than a cache. "Read" and "Read-write" are the only defined
  1785. values of permission.
  1786. The precise semantics of the access-types defined here are described
  1787. in the sections that follow.
  1788. The encapsulated headers in ALL message/external-body entities MUST
  1789. include a Content-ID header field to give a unique identifier by
  1790. Borenstein & Freed [Page 43]
  1791. RFC 1521 MIME September 1993
  1792. which to reference the data. This identifier may be used for
  1793. cacheing mechanisms, and for recognizing the receipt of the data when
  1794. the access-type is "mail-server".
  1795. Note that, as specified here, the tokens that describe external-body
  1796. data, such as file names and mail server commands, are required to be
  1797. in the US-ASCII character set. If this proves problematic in
  1798. practice, a new mechanism may be required as a future extension to
  1799. MIME, either as newly defined access-types for message/external-body
  1800. or by some other mechanism.
  1801. As with message/partial, it is specified that MIME entities of type
  1802. message/external-body must always have a content-transfer-encoding of
  1803. 7-bit (the default). In particular, even in environments that
  1804. support binary or 8-bit transport, the use of a content-transfer-
  1805. encoding of "8bit" or "binary" is explicitly prohibited for entities
  1806. of type message/external-body.
  1807. 7.3.3.1. The "ftp" and "tftp" access-types
  1808. An access-type of FTP or TFTP indicates that the message body is
  1809. accessible as a file using the FTP [RFC-959] or TFTP [RFC-783]
  1810. protocols, respectively. For these access-types, the following
  1811. additional parameters are mandatory:
  1812. NAME -- The name of the file that contains the actual body data.
  1813. SITE -- A machine from which the file may be obtained, using the
  1814. given protocol. This must be a fully qualified domain name, not a
  1815. nickname.
  1816. Before any data are retrieved, using FTP, the user will generally
  1817. need to be asked to provide a login id and a password for the machine
  1818. named by the site parameter. For security reasons, such an id and
  1819. password are not specified as content-type parameters, but must be
  1820. obtained from the user.
  1821. In addition, the following parameters are optional:
  1822. DIRECTORY -- A directory from which the data named by NAME should
  1823. be retrieved.
  1824. MODE -- A case-insensitive string indicating the mode to be used
  1825. when retrieving the information. The legal values for access-type
  1826. "TFTP" are "NETASCII", "OCTET", and "MAIL", as specified by the
  1827. TFTP protocol [RFC-783]. The legal values for access-type "FTP"
  1828. are "ASCII", "EBCDIC", "IMAGE", and "LOCALn" where "n" is a
  1829. decimal integer, typically 8. These correspond to the
  1830. Borenstein & Freed [Page 44]
  1831. RFC 1521 MIME September 1993
  1832. representation types "A" "E" "I" and "L n" as specified by the FTP
  1833. protocol [RFC-959]. Note that "BINARY" and "TENEX" are not valid
  1834. values for MODE, but that "OCTET" or "IMAGE" or "LOCAL8" should be
  1835. used instead. IF MODE is not specified, the default value is
  1836. "NETASCII" for TFTP and "ASCII" otherwise.
  1837. 7.3.3.2. The "anon-ftp" access-type
  1838. The "anon-ftp" access-type is identical to the "ftp" access type,
  1839. except that the user need not be asked to provide a name and password
  1840. for the specified site. Instead, the ftp protocol will be used with
  1841. login "anonymous" and a password that corresponds to the user's email
  1842. address.
  1843. 7.3.3.3. The "local-file" and "afs" access-types
  1844. An access-type of "local-file" indicates that the actual body is
  1845. accessible as a file on the local machine. An access-type of "afs"
  1846. indicates that the file is accessible via the global AFS file system.
  1847. In both cases, only a single parameter is required:
  1848. NAME -- The name of the file that contains the actual body data.
  1849. The following optional parameter may be used to describe the locality
  1850. of reference for the data, that is, the site or sites at which the
  1851. file is expected to be visible:
  1852. SITE -- A domain specifier for a machine or set of machines that
  1853. are known to have access to the data file. Asterisks may be used
  1854. for wildcard matching to a part of a domain name, such as
  1855. "*.bellcore.com", to indicate a set of machines on which the data
  1856. should be directly visible, while a single asterisk may be used to
  1857. indicate a file that is expected to be universally available,
  1858. e.g., via a global file system.
  1859. 7.3.3.4. The "mail-server" access-type
  1860. The "mail-server" access-type indicates that the actual body is
  1861. available from a mail server. The mandatory parameter for this
  1862. access-type is:
  1863. SERVER -- The email address of the mail server from which the
  1864. actual body data can be obtained.
  1865. Because mail servers accept a variety of syntaxes, some of which is
  1866. multiline, the full command to be sent to a mail server is not
  1867. included as a parameter on the content-type line. Instead, it is
  1868. provided as the "phantom body" when the content-type is
  1869. Borenstein & Freed [Page 45]
  1870. RFC 1521 MIME September 1993
  1871. message/external-body and the access- type is mail-server.
  1872. An optional parameter for this access-type is:
  1873. SUBJECT -- The subject that is to be used in the mail that is sent
  1874. to obtain the data. Note that keying mail servers on Subject lines
  1875. is NOT recommended, but such mail servers are known to exist.
  1876. Note that MIME does not define a mail server syntax. Rather, it
  1877. allows the inclusion of arbitrary mail server commands in the phantom
  1878. body. Implementations must include the phantom body in the body of
  1879. the message it sends to the mail server address to retrieve the
  1880. relevant data.
  1881. It is worth noting that, unlike other access-types, mail-server
  1882. access is asynchronous and will happen at an unpredictable time in
  1883. the future. For this reason, it is important that there be a
  1884. mechanism by which the returned data can be matched up with the
  1885. original message/external-body entity. MIME mailservers must use the
  1886. same Content-ID field on the returned message that was used in the
  1887. original message/external-body entity, to facilitate such matching.
  1888. 7.3.3.5. Examples and Further Explanations
  1889. With the emerging possibility of very wide-area file systems, it
  1890. becomes very hard to know in advance the set of machines where a file
  1891. will and will not be accessible directly from the file system.
  1892. Therefore it may make sense to provide both a file name, to be tried
  1893. directly, and the name of one or more sites from which the file is
  1894. known to be accessible. An implementation can try to retrieve remote
  1895. files using FTP or any other protocol, using anonymous file retrieval
  1896. or prompting the user for the necessary name and password. If an
  1897. external body is accessible via multiple mechanisms, the sender may
  1898. include multiple parts of type message/external-body within an entity
  1899. of type multipart/alternative.
  1900. However, the external-body mechanism is not intended to be limited to
  1901. file retrieval, as shown by the mail-server access-type. Beyond
  1902. this, one can imagine, for example, using a video server for external
  1903. references to video clips.
  1904. If an entity is of type "message/external-body", then the body of the
  1905. entity will contain the header fields of the encapsulated message.
  1906. The body itself is to be found in the external location. This means
  1907. that if the body of the "message/external-body" message contains two
  1908. consecutive CRLFs, everything after those pairs is NOT part of the
  1909. message itself. For most message/external-body messages, this
  1910. trailing area must simply be ignored. However, it is a convenient
  1911. Borenstein & Freed [Page 46]
  1912. RFC 1521 MIME September 1993
  1913. place for additional data that cannot be included in the content-type
  1914. header field. In particular, if the "access-type" value is "mail-
  1915. server", then the trailing area must contain commands to be sent to
  1916. the mail server at the address given by the value of the SERVER
  1917. parameter.
  1918. The embedded message header fields which appear in the body of the
  1919. message/external-body data must be used to declare the Content-type
  1920. of the external body if it is anything other than plain ASCII text,
  1921. since the external body does not have a header section to declare its
  1922. type. Similarly, any Content-transfer-encoding other than "7bit"
  1923. must also be declared here. Thus a complete message/external-body
  1924. message, referring to a document in PostScript format, might look
  1925. like this:
  1926. From: Whomever
  1927. To: Someone
  1928. Subject: whatever
  1929. MIME-Version: 1.0
  1930. Message-ID: <id1@host.com>
  1931. Content-Type: multipart/alternative; boundary=42
  1932. Content-ID: <id001@guppylake.bellcore.com>
  1933. --42
  1934. Content-Type: message/external-body;
  1935. name="BodyFormats.ps";
  1936. site="thumper.bellcore.com";
  1937. access-type=ANON-FTP;
  1938. directory="pub";
  1939. mode="image";
  1940. expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
  1941. Content-type: application/postscript
  1942. Content-ID: <id42@guppylake.bellcore.com>
  1943. --42
  1944. Content-Type: message/external-body;
  1945. name="/u/nsb/writing/rfcs/RFC-MIME.ps";
  1946. site="thumper.bellcore.com";
  1947. access-type=AFS
  1948. expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
  1949. Content-type: application/postscript
  1950. Content-ID: <id42@guppylake.bellcore.com>
  1951. --42
  1952. Content-Type: message/external-body;
  1953. access-type=mail-server
  1954. Borenstein & Freed [Page 47]
  1955. RFC 1521 MIME September 1993
  1956. server="listserv@bogus.bitnet";
  1957. expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
  1958. Content-type: application/postscript
  1959. Content-ID: <id42@guppylake.bellcore.com>
  1960. get RFC-MIME.DOC
  1961. --42--
  1962. Note that in the above examples, the default Content-transfer-
  1963. encoding of "7bit" is assumed for the external postscript data.
  1964. Like the message/partial type, the message/external-body type is
  1965. intended to be transparent, that is, to convey the data type in the
  1966. external body rather than to convey a message with a body of that
  1967. type. Thus the headers on the outer and inner parts must be merged
  1968. using the same rules as for message/partial. In particular, this
  1969. means that the Content-type header is overridden, but the From and
  1970. Subject headers are preserved.
  1971. Note that since the external bodies are not transported as mail, they
  1972. need not conform to the 7-bit and line length requirements, but might
  1973. in fact be binary files. Thus a Content-Transfer-Encoding is not
  1974. generally necessary, though it is permitted.
  1975. Note that the body of a message of type "message/external-body" is
  1976. governed by the basic syntax for an RFC 822 message. In particular,
  1977. anything before the first consecutive pair of CRLFs is header
  1978. information, while anything after it is body information, which is
  1979. ignored for most access-types.
  1980. The formal grammar for content-type header fields for data of type
  1981. message is given by:
  1982. message-type := "message" "/" message-subtype
  1983. message-subtype := "rfc822"
  1984. / "partial" 2#3partial-param
  1985. / "external-body" 1*external-param
  1986. / extension-token
  1987. partial-param := (";" "id" "=" value)
  1988. / (";" "number" "=" 1*DIGIT)
  1989. / (";" "total" "=" 1*DIGIT)
  1990. ; id & number required; total required for last part
  1991. external-param := (";" "access-type" "=" atype)
  1992. Borenstein & Freed [Page 48]
  1993. RFC 1521 MIME September 1993
  1994. / (";" "expiration" "=" date-time)
  1995. ; Note that date-time is quoted
  1996. / (";" "size" "=" 1*DIGIT)
  1997. / (";" "permission" "=" ("read" / "read-write"))
  1998. ; Permission is case-insensitive
  1999. / (";" "name" "=" value)
  2000. / (";" "site" "=" value)
  2001. / (";" "dir" "=" value)
  2002. / (";" "mode" "=" value)
  2003. / (";" "server" "=" value)
  2004. / (";" "subject" "=" value)
  2005. ; access-type required;others required based on access-type
  2006. atype := "ftp" / "anon-ftp" / "tftp" / "local-file"
  2007. / "afs" / "mail-server" / extension-token
  2008. ; Case-insensitive
  2009. 7.4. The Application Content-Type
  2010. The "application" Content-Type is to be used for data which do not
  2011. fit in any of the other categories, and particularly for data to be
  2012. processed by mail-based uses of application programs. This is
  2013. information which must be processed by an application before it is
  2014. viewable or usable to a user. Expected uses for Content-Type
  2015. application include mail-based file transfer, spreadsheets, data for
  2016. mail-based scheduling systems, and languages for "active"
  2017. (computational) email. (The latter, in particular, can pose security
  2018. problems which must be understood by implementors, and are considered
  2019. in detail in the discussion of the application/PostScript content-
  2020. type.)
  2021. For example, a meeting scheduler might define a standard
  2022. representation for information about proposed meeting dates. An
  2023. intelligent user agent would use this information to conduct a dialog
  2024. with the user, and might then send further mail based on that dialog.
  2025. More generally, there have been several "active" messaging languages
  2026. developed in which programs in a suitably specialized language are
  2027. sent through the mail and automatically run in the recipient's
  2028. environment.
  2029. Such applications may be defined as subtypes of the "application"
  2030. Content-Type. This document defines two subtypes: octet-stream, and
  2031. PostScript.
  2032. In general, the subtype of application will often be the name of the
  2033. application for which the data are intended. This does not mean,
  2034. however, that any application program name may be used freely as a
  2035. subtype of application. Such usages (other than subtypes beginning
  2036. Borenstein & Freed [Page 49]
  2037. RFC 1521 MIME September 1993
  2038. with "x-") must be registered with IANA, as described in Appendix E.
  2039. 7.4.1. The Application/Octet-Stream (primary) subtype
  2040. The primary subtype of application, "octet-stream", may be used to
  2041. indicate that a body contains binary data. The set of possible
  2042. parameters includes, but is not limited to:
  2043. TYPE -- the general type or category of binary data. This is
  2044. intended as information for the human recipient rather than for
  2045. any automatic processing.
  2046. PADDING -- the number of bits of padding that were appended to the
  2047. bit-stream comprising the actual contents to produce the enclosed
  2048. byte-oriented data. This is useful for enclosing a bit-stream in
  2049. a body when the total number of bits is not a multiple of the byte
  2050. size.
  2051. An additional parameter, "conversions", was defined in [RFC-1341] but
  2052. has been removed.
  2053. RFC 1341 also defined the use of a "NAME" parameter which gave a
  2054. suggested file name to be used if the data were to be written to a
  2055. file. This has been deprecated in anticipation of a separate
  2056. Content-Disposition header field, to be defined in a subsequent RFC.
  2057. The recommended action for an implementation that receives
  2058. application/octet-stream mail is to simply offer to put the data in a
  2059. file, with any Content-Transfer-Encoding undone, or perhaps to use it
  2060. as input to a user-specified process.
  2061. To reduce the danger of transmitting rogue programs through the mail,
  2062. it is strongly recommended that implementations NOT implement a
  2063. path-search mechanism whereby an arbitrary program named in the
  2064. Content-Type parameter (e.g., an "interpreter=" parameter) is found
  2065. and executed using the mail body as input.
  2066. 7.4.2. The Application/PostScript subtype
  2067. A Content-Type of "application/postscript" indicates a PostScript
  2068. program. Currently two variants of the PostScript language are
  2069. allowed; the original level 1 variant is described in [POSTSCRIPT]
  2070. and the more recent level 2 variant is described in [POSTSCRIPT2].
  2071. PostScript is a registered trademark of Adobe Systems, Inc. Use of
  2072. the MIME content-type "application/postscript" implies recognition of
  2073. that trademark and all the rights it entails.
  2074. Borenstein & Freed [Page 50]
  2075. RFC 1521 MIME September 1993
  2076. The PostScript language definition provides facilities for internal
  2077. labeling of the specific language features a given program uses. This
  2078. labeling, called the PostScript document structuring conventions, is
  2079. very general and provides substantially more information than just
  2080. the language level.
  2081. The use of document structuring conventions, while not required, is
  2082. strongly recommended as an aid to interoperability. Documents which
  2083. lack proper structuring conventions cannot be tested to see whether
  2084. or not they will work in a given environment. As such, some systems
  2085. may assume the worst and refuse to process unstructured documents.
  2086. The execution of general-purpose PostScript interpreters entails
  2087. serious security risks, and implementors are discouraged from simply
  2088. sending PostScript email bodies to "off-the-shelf" interpreters.
  2089. While it is usually safe to send PostScript to a printer, where the
  2090. potential for harm is greatly constrained, implementors should
  2091. consider all of the following before they add interactive display of
  2092. PostScript bodies to their mail readers.
  2093. The remainder of this section outlines some, though probably not all,
  2094. of the possible problems with sending PostScript through the mail.
  2095. Dangerous operations in the PostScript language include, but may not
  2096. be limited to, the PostScript operators deletefile, renamefile,
  2097. filenameforall, and file. File is only dangerous when applied to
  2098. something other than standard input or output. Implementations may
  2099. also define additional nonstandard file operators; these may also
  2100. pose a threat to security. Filenameforall, the wildcard file search
  2101. operator, may appear at first glance to be harmless. Note, however,
  2102. that this operator has the potential to reveal information about what
  2103. files the recipient has access to, and this information may itself be
  2104. sensitive. Message senders should avoid the use of potentially
  2105. dangerous file operators, since these operators are quite likely to
  2106. be unavailable in secure PostScript implementations. Message-
  2107. receiving and -displaying software should either completely disable
  2108. all potentially dangerous file operators or take special care not to
  2109. delegate any special authority to their operation. These operators
  2110. should be viewed as being done by an outside agency when interpreting
  2111. PostScript documents. Such disabling and/or checking should be done
  2112. completely outside of the reach of the PostScript language itself;
  2113. care should be taken to insure that no method exists for re-enabling
  2114. full-function versions of these operators.
  2115. The PostScript language provides facilities for exiting the normal
  2116. interpreter, or server, loop. Changes made in this "outer"
  2117. environment are customarily retained across documents, and may in
  2118. some cases be retained semipermanently in nonvolatile memory. The
  2119. Borenstein & Freed [Page 51]
  2120. RFC 1521 MIME September 1993
  2121. operators associated with exiting the interpreter loop have the
  2122. potential to interfere with subsequent document processing. As such,
  2123. their unrestrained use constitutes a threat of service denial.
  2124. PostScript operators that exit the interpreter loop include, but may
  2125. not be limited to, the exitserver and startjob operators. Message-
  2126. sending software should not generate PostScript that depends on
  2127. exiting the interpreter loop to operate. The ability to exit will
  2128. probably be unavailable in secure PostScript implementations.
  2129. Message-receiving and -displaying software should, if possible,
  2130. disable the ability to make retained changes to the PostScript
  2131. environment, and eliminate the startjob and exitserver commands. If
  2132. these commands cannot be eliminated, the password associated with
  2133. them should at least be set to a hard-to-guess value.
  2134. PostScript provides operators for setting system-wide and device-
  2135. specific parameters. These parameter settings may be retained across
  2136. jobs and may potentially pose a threat to the correct operation of
  2137. the interpreter. The PostScript operators that set system and device
  2138. parameters include, but may not be limited to, the setsystemparams
  2139. and setdevparams operators. Message-sending software should not
  2140. generate PostScript that depends on the setting of system or device
  2141. parameters to operate correctly. The ability to set these parameters
  2142. will probably be unavailable in secure PostScript implementations.
  2143. Message-receiving and -displaying software should, if possible,
  2144. disable the ability to change system and device parameters. If these
  2145. operators cannot be disabled, the password associated with them
  2146. should at least be set to a hard-to-guess value.
  2147. Some PostScript implementations provide nonstandard facilities for
  2148. the direct loading and execution of machine code. Such facilities
  2149. are quite obviously open to substantial abuse. Message-sending
  2150. software should not make use of such features. Besides being totally
  2151. hardware- specific, they are also likely to be unavailable in secure
  2152. implementations of PostScript. Message-receiving and -displaying
  2153. software should not allow such operators to be used if they exist.
  2154. PostScript is an extensible language, and many, if not most,
  2155. implementations of it provide a number of their own extensions. This
  2156. document does not deal with such extensions explicitly since they
  2157. constitute an unknown factor. Message-sending software should not
  2158. make use of nonstandard extensions; they are likely to be missing
  2159. from some implementations. Message-receiving and -displaying software
  2160. should make sure that any nonstandard PostScript operators are secure
  2161. and don't present any kind of threat.
  2162. It is possible to write PostScript that consumes huge amounts of
  2163. various system resources. It is also possible to write PostScript
  2164. programs that loop infinitely. Both types of programs have the
  2165. Borenstein & Freed [Page 52]
  2166. RFC 1521 MIME September 1993
  2167. potential to cause damage if sent to unsuspecting recipients.
  2168. Message-sending software should avoid the construction and
  2169. dissemination of such programs, which is antisocial. Message-
  2170. receiving and -displaying software should provide appropriate
  2171. mechanisms to abort processing of a document after a reasonable
  2172. amount of time has elapsed. In addition, PostScript interpreters
  2173. should be limited to the consumption of only a reasonable amount of
  2174. any given system resource.
  2175. Finally, bugs may exist in some PostScript interpreters which could
  2176. possibly be exploited to gain unauthorized access to a recipient's
  2177. system. Apart from noting this possibility, there is no specific
  2178. action to take to prevent this, apart from the timely correction of
  2179. such bugs if any are found.
  2180. 7.4.3. Other Application subtypes
  2181. It is expected that many other subtypes of application will be
  2182. defined in the future. MIME implementations must generally treat any
  2183. unrecognized subtypes as being equivalent to application/octet-
  2184. stream.
  2185. The formal grammar for content-type header fields for application
  2186. data is given by:
  2187. application-type := "application" "/" application-subtype
  2188. application-subtype := ("octet-stream" *stream-param)
  2189. / "postscript" / extension-token
  2190. stream-param := (";" "type" "=" value)
  2191. / (";" "padding" "=" padding)
  2192. padding := "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7"
  2193. 7.5. The Image Content-Type
  2194. A Content-Type of "image" indicates that the body contains an image.
  2195. The subtype names the specific image format. These names are case
  2196. insensitive. Two initial subtypes are "jpeg" for the JPEG format,
  2197. JFIF encoding, and "gif" for GIF format [GIF].
  2198. The list of image subtypes given here is neither exclusive nor
  2199. exhaustive, and is expected to grow as more types are registered with
  2200. IANA, as described in Appendix E.
  2201. The formal grammar for the content-type header field for data of type
  2202. image is given by:
  2203. Borenstein & Freed [Page 53]
  2204. RFC 1521 MIME September 1993
  2205. image-type := "image" "/" ("gif" / "jpeg" / extension-token)
  2206. 7.6. The Audio Content-Type
  2207. A Content-Type of "audio" indicates that the body contains audio
  2208. data. Although there is not yet a consensus on an "ideal" audio
  2209. format for use with computers, there is a pressing need for a format
  2210. capable of providing interoperable behavior.
  2211. The initial subtype of "basic" is specified to meet this requirement
  2212. by providing an absolutely minimal lowest common denominator audio
  2213. format. It is expected that richer formats for higher quality and/or
  2214. lower bandwidth audio will be defined by a later document.
  2215. The content of the "audio/basic" subtype is audio encoded using 8-bit
  2216. ISDN mu-law [PCM]. When this subtype is present, a sample rate of
  2217. 8000 Hz and a single channel is assumed.
  2218. The formal grammar for the content-type header field for data of type
  2219. audio is given by:
  2220. audio-type := "audio" "/" ("basic" / extension-token)
  2221. 7.7. The Video Content-Type
  2222. A Content-Type of "video" indicates that the body contains a time-
  2223. varying-picture image, possibly with color and coordinated sound.
  2224. The term "video" is used extremely generically, rather than with
  2225. reference to any particular technology or format, and is not meant to
  2226. preclude subtypes such as animated drawings encoded compactly. The
  2227. subtype "mpeg" refers to video coded according to the MPEG standard
  2228. [MPEG].
  2229. Note that although in general this document strongly discourages the
  2230. mixing of multiple media in a single body, it is recognized that many
  2231. so-called "video" formats include a representation for synchronized
  2232. audio, and this is explicitly permitted for subtypes of "video".
  2233. The formal grammar for the content-type header field for data of type
  2234. video is given by:
  2235. video-type := "video" "/" ("mpeg" / extension-token)
  2236. 7.8. Experimental Content-Type Values
  2237. A Content-Type value beginning with the characters "X-" is a private
  2238. value, to be used by consenting mail systems by mutual agreement.
  2239. Any format without a rigorous and public definition must be named
  2240. Borenstein & Freed [Page 54]
  2241. RFC 1521 MIME September 1993
  2242. with an "X-" prefix, and publicly specified values shall never begin
  2243. with "X-". (Older versions of the widely-used Andrew system use the
  2244. "X-BE2" name, so new systems should probably choose a different
  2245. name.)
  2246. In general, the use of "X-" top-level types is strongly discouraged.
  2247. Implementors should invent subtypes of the existing types whenever
  2248. possible. The invention of new types is intended to be restricted
  2249. primarily to the development of new media types for email, such as
  2250. digital odors or holography, and not for new data formats in general.
  2251. In many cases, a subtype of application will be more appropriate than
  2252. a new top-level type.
  2253. Borenstein & Freed [Page 55]
  2254. RFC 1521 MIME September 1993
  2255. 8. Summary
  2256. Using the MIME-Version, Content-Type, and Content-Transfer-Encoding
  2257. header fields, it is possible to include, in a standardized way,
  2258. arbitrary types of data objects with RFC 822 conformant mail
  2259. messages. No restrictions imposed by either RFC 821 or RFC 822 are
  2260. violated, and care has been taken to avoid problems caused by
  2261. additional restrictions imposed by the characteristics of some
  2262. Internet mail transport mechanisms (see Appendix B). The "multipart"
  2263. and "message" Content-Types allow mixing and hierarchical structuring
  2264. of objects of different types in a single message. Further Content-
  2265. Types provide a standardized mechanism for tagging messages or body
  2266. parts as audio, image, or several other kinds of data. A
  2267. distinguished parameter syntax allows further specification of data
  2268. format details, particularly the specification of alternate character
  2269. sets. Additional optional header fields provide mechanisms for
  2270. certain extensions deemed desirable by many implementors. Finally, a
  2271. number of useful Content-Types are defined for general use by
  2272. consenting user agents, notably message/partial, and
  2273. message/external-body.
  2274. 9. Security Considerations
  2275. Security issues are discussed in Section 7.4.2 and in Appendix F.
  2276. Implementors should pay special attention to the security
  2277. implications of any mail content-types that can cause the remote
  2278. execution of any actions in the recipient's environment. In such
  2279. cases, the discussion of the application/postscript content-type in
  2280. Section 7.4.2 may serve as a model for considering other content-
  2281. types with remote execution capabilities.
  2282. Borenstein & Freed [Page 56]
  2283. RFC 1521 MIME September 1993
  2284. 10. Authors' Addresses
  2285. For more information, the authors of this document may be contacted
  2286. via Internet mail:
  2287. Nathaniel S. Borenstein
  2288. MRE 2D-296, Bellcore
  2289. 445 South St.
  2290. Morristown, NJ 07962-1910
  2291. Phone: +1 201 829 4270
  2292. Fax: +1 201 829 7019
  2293. Email: nsb@bellcore.com
  2294. Ned Freed
  2295. Innosoft International, Inc.
  2296. 250 West First Street
  2297. Suite 240
  2298. Claremont, CA 91711
  2299. Phone: +1 909 624 7907
  2300. Fax: +1 909 621 5319
  2301. Email: ned@innosoft.com
  2302. MIME is a result of the work of the Internet Engineering Task Force
  2303. Working Group on Email Extensions. The chairman of that group, Greg
  2304. Vaudreuil, may be reached at:
  2305. Gregory M. Vaudreuil
  2306. Tigon Corporation
  2307. 17060 Dallas Parkway
  2308. Dallas Texas, 75248
  2309. Phone: +1 214-733-2722
  2310. EMail: gvaudre@cnri.reston.va.us
  2311. Borenstein & Freed [Page 57]
  2312. RFC 1521 MIME September 1993
  2313. 11. Acknowledgements
  2314. This document is the result of the collective effort of a large
  2315. number of people, at several IETF meetings, on the IETF-SMTP and
  2316. IETF-822 mailing lists, and elsewhere. Although any enumeration
  2317. seems doomed to suffer from egregious omissions, the following are
  2318. among the many contributors to this effort:
  2319. Harald Tveit Alvestrand Timo Lehtinen
  2320. Randall Atkinson John R. MacMillan
  2321. Philippe Brandon Rick McGowan
  2322. Kevin Carosso Leo Mclaughlin
  2323. Uhhyung Choi Goli Montaser-Kohsari
  2324. Cristian Constantinof Keith Moore
  2325. Mark Crispin Tom Moore
  2326. Dave Crocker Erik Naggum
  2327. Terry Crowley Mark Needleman
  2328. Walt Daniels John Noerenberg
  2329. Frank Dawson Mats Ohrman
  2330. Hitoshi Doi Julian Onions
  2331. Kevin Donnelly Michael Patton
  2332. Keith Edwards David J. Pepper
  2333. Chris Eich Blake C. Ramsdell
  2334. Johnny Eriksson Luc Rooijakkers
  2335. Craig Everhart Marshall T. Rose
  2336. Patrik Faeltstroem Jonathan Rosenberg
  2337. Erik E. Fair Jan Rynning
  2338. Roger Fajman Harri Salminen
  2339. Alain Fontaine Michael Sanderson
  2340. James M. Galvin Masahiro Sekiguchi
  2341. Philip Gladstone Mark Sherman
  2342. Thomas Gordon Keld Simonsen
  2343. Phill Gross Bob Smart
  2344. James Hamilton Peter Speck
  2345. Steve Hardcastle-Kille Henry Spencer
  2346. David Herron Einar Stefferud
  2347. Bruce Howard Michael Stein
  2348. Bill Janssen Klaus Steinberger
  2349. Olle Jaernefors Peter Svanberg
  2350. Risto Kankkunen James Thompson
  2351. Phil Karn Steve Uhler
  2352. Alan Katz Stuart Vance
  2353. Tim Kehres Erik van der Poel
  2354. Neil Katin Guido van Rossum
  2355. Kyuho Kim Peter Vanderbilt
  2356. Anders Klemets Greg Vaudreuil
  2357. John Klensin Ed Vielmetti
  2358. Valdis Kletniek Ryan Waldron
  2359. Borenstein & Freed [Page 58]
  2360. RFC 1521 MIME September 1993
  2361. Jim Knowles Wally Wedel
  2362. Stev Knowles Sven-Ove Westberg
  2363. Bob Kummerfeld Brian Wideen
  2364. Pekka Kytolaakso John Wobus
  2365. Stellan Lagerstrom Glenn Wright
  2366. Vincent Lau Rayan Zachariassen
  2367. Donald Lindsay David Zimmerman
  2368. Marc Andreessen Bob Braden
  2369. Brian Capouch Peter Clitherow
  2370. Dave Collier-Brown John Coonrod
  2371. Stephen Crocker Jim Davis
  2372. Axel Deininger Dana S Emery
  2373. Martin Forssen Stephen Gildea
  2374. Terry Gray Mark Horton
  2375. Warner Losh Carlyn Lowery
  2376. Laurence Lundblade Charles Lynn
  2377. Larry Masinter Michael J. McInerny
  2378. Jon Postel Christer Romson
  2379. Yutaka Sato Markku Savela
  2380. Richard Alan Schafer Larry W. Virden
  2381. Rhys Weatherly Jay Weber
  2382. Dave Wecker
  2383. The authors apologize for any omissions from this list, which are
  2384. certainly unintentional.
  2385. Borenstein & Freed [Page 59]
  2386. RFC 1521 MIME September 1993
  2387. Appendix A -- Minimal MIME-Conformance
  2388. The mechanisms described in this document are open-ended. It is
  2389. definitely not expected that all implementations will support all of
  2390. the Content-Types described, nor that they will all share the same
  2391. extensions. In order to promote interoperability, however, it is
  2392. useful to define the concept of "MIME-conformance" to define a
  2393. certain level of implementation that allows the useful interworking
  2394. of messages with content that differs from US ASCII text. In this
  2395. section, we specify the requirements for such conformance.
  2396. A mail user agent that is MIME-conformant MUST:
  2397. 1. Always generate a "MIME-Version: 1.0" header field.
  2398. 2. Recognize the Content-Transfer-Encoding header field, and
  2399. decode all received data encoded with either the quoted-printable
  2400. or base64 implementations. Encode any data sent that is not in
  2401. seven-bit mail-ready representation using one of these
  2402. transformations and include the appropriate Content-Transfer-
  2403. Encoding header field, unless the underlying transport mechanism
  2404. supports non-seven-bit data, as SMTP does not.
  2405. 3. Recognize and interpret the Content-Type header field, and
  2406. avoid showing users raw data with a Content-Type field other than
  2407. text. Be able to send at least text/plain messages, with the
  2408. character set specified as a parameter if it is not US-ASCII.
  2409. 4. Explicitly handle the following Content-Type values, to at
  2410. least the following extents:
  2411. Text:
  2412. -- Recognize and display "text" mail
  2413. with the character set "US-ASCII."
  2414. -- Recognize other character sets at
  2415. least to the extent of being able
  2416. to inform the user about what
  2417. character set the message uses.
  2418. -- Recognize the "ISO-8859-*" character
  2419. sets to the extent of being able to
  2420. display those characters that are
  2421. common to ISO-8859-* and US-ASCII,
  2422. namely all characters represented
  2423. by octet values 0-127.
  2424. Borenstein & Freed [Page 60]
  2425. RFC 1521 MIME September 1993
  2426. -- For unrecognized subtypes, show or
  2427. offer to show the user the "raw"
  2428. version of the data after
  2429. conversion of the content from
  2430. canonical form to local form.
  2431. Message:
  2432. -- Recognize and display at least the
  2433. primary (822) encapsulation.
  2434. Multipart:
  2435. -- Recognize the primary (mixed)
  2436. subtype. Display all relevant
  2437. information on the message level
  2438. and the body part header level and
  2439. then display or offer to display
  2440. each of the body parts individually.
  2441. -- Recognize the "alternative" subtype,
  2442. and avoid showing the user
  2443. redundant parts of
  2444. multipart/alternative mail.
  2445. -- Treat any unrecognized subtypes as if
  2446. they were "mixed".
  2447. Application:
  2448. -- Offer the ability to remove either of
  2449. the two types of Content-Transfer-
  2450. Encoding defined in this document
  2451. and put the resulting information
  2452. in a user file.
  2453. 5. Upon encountering any unrecognized Content- Type, an
  2454. implementation must treat it as if it had a Content-Type of
  2455. "application/octet-stream" with no parameter sub-arguments. How
  2456. such data are handled is up to an implementation, but likely
  2457. options for handling such unrecognized data include offering the
  2458. user to write it into a file (decoded from its mail transport
  2459. format) or offering the user to name a program to which the
  2460. decoded data should be passed as input. Unrecognized predefined
  2461. types, which in a MIME-conformant mailer might still include
  2462. audio, image, or video, should also be treated in this way.
  2463. A user agent that meets the above conditions is said to be MIME-
  2464. Borenstein & Freed [Page 61]
  2465. RFC 1521 MIME September 1993
  2466. conformant. The meaning of this phrase is that it is assumed to be
  2467. "safe" to send virtually any kind of properly-marked data to users of
  2468. such mail systems, because such systems will at least be able to
  2469. treat the data as undifferentiated binary, and will not simply splash
  2470. it onto the screen of unsuspecting users. There is another sense in
  2471. which it is always "safe" to send data in a format that is MIME-
  2472. conformant, which is that such data will not break or be broken by
  2473. any known systems that are conformant with RFC 821 and RFC 822. User
  2474. agents that are MIME-conformant have the additional guarantee that
  2475. the user will not be shown data that were never intended to be viewed
  2476. as text.
  2477. Borenstein & Freed [Page 62]
  2478. RFC 1521 MIME September 1993
  2479. Appendix B -- General Guidelines For Sending Email Data
  2480. Internet email is not a perfect, homogeneous system. Mail may become
  2481. corrupted at several stages in its travel to a final destination.
  2482. Specifically, email sent throughout the Internet may travel across
  2483. many networking technologies. Many networking and mail technologies
  2484. do not support the full functionality possible in the SMTP transport
  2485. environment. Mail traversing these systems is likely to be modified
  2486. in such a way that it can be transported.
  2487. There exist many widely-deployed non-conformant MTAs in the Internet.
  2488. These MTAs, speaking the SMTP protocol, alter messages on the fly to
  2489. take advantage of the internal data structure of the hosts they are
  2490. implemented on, or are just plain broken.
  2491. The following guidelines may be useful to anyone devising a data
  2492. format (Content-Type) that will survive the widest range of
  2493. networking technologies and known broken MTAs unscathed. Note that
  2494. anything encoded in the base64 encoding will satisfy these rules, but
  2495. that some well-known mechanisms, notably the UNIX uuencode facility,
  2496. will not. Note also that anything encoded in the Quoted-Printable
  2497. encoding will survive most gateways intact, but possibly not some
  2498. gateways to systems that use the EBCDIC character set.
  2499. (1) Under some circumstances the encoding used for data may change
  2500. as part of normal gateway or user agent operation. In particular,
  2501. conversion from base64 to quoted-printable and vice versa may be
  2502. necessary. This may result in the confusion of CRLF sequences with
  2503. line breaks in text bodies. As such, the persistence of CRLF as
  2504. something other than a line break must not be relied on.
  2505. (2) Many systems may elect to represent and store text data using
  2506. local newline conventions. Local newline conventions may not match
  2507. the RFC822 CRLF convention -- systems are known that use plain CR,
  2508. plain LF, CRLF, or counted records. The result is that isolated
  2509. CR and LF characters are not well tolerated in general; they may
  2510. be lost or converted to delimiters on some systems, and hence must
  2511. not be relied on.
  2512. (3) TAB (HT) characters may be misinterpreted or may be
  2513. automatically converted to variable numbers of spaces. This is
  2514. unavoidable in some environments, notably those not based on the
  2515. ASCII character set. Such conversion is STRONGLY DISCOURAGED, but
  2516. it may occur, and mail formats must not rely on the persistence of
  2517. TAB (HT) characters.
  2518. (4) Lines longer than 76 characters may be wrapped or truncated in
  2519. some environments. Line wrapping and line truncation are STRONGLY
  2520. Borenstein & Freed [Page 63]
  2521. RFC 1521 MIME September 1993
  2522. DISCOURAGED, but unavoidable in some cases. Applications which
  2523. require long lines must somehow differentiate between soft and
  2524. hard line breaks. (A simple way to do this is to use the quoted-
  2525. printable encoding.)
  2526. (5) Trailing "white space" characters (SPACE, TAB (HT)) on a line
  2527. may be discarded by some transport agents, while other transport
  2528. agents may pad lines with these characters so that all lines in a
  2529. mail file are of equal length. The persistence of trailing white
  2530. space, therefore, must not be relied on.
  2531. (6) Many mail domains use variations on the ASCII character set,
  2532. or use character sets such as EBCDIC which contain most but not
  2533. all of the US-ASCII characters. The correct translation of
  2534. characters not in the "invariant" set cannot be depended on across
  2535. character converting gateways. For example, this situation is a
  2536. problem when sending uuencoded information across BITNET, an
  2537. EBCDIC system. Similar problems can occur without crossing a
  2538. gateway, since many Internet hosts use character sets other than
  2539. ASCII internally. The definition of Printable Strings in X.400
  2540. adds further restrictions in certain special cases. In
  2541. particular, the only characters that are known to be consistent
  2542. across all gateways are the 73 characters that correspond to the
  2543. upper and lower case letters A-Z and a-z, the 10 digits 0-9, and
  2544. the following eleven special characters:
  2545. "'" (ASCII code 39)
  2546. "(" (ASCII code 40)
  2547. ")" (ASCII code 41)
  2548. "+" (ASCII code 43)
  2549. "," (ASCII code 44)
  2550. "-" (ASCII code 45)
  2551. "." (ASCII code 46)
  2552. "/" (ASCII code 47)
  2553. ":" (ASCII code 58)
  2554. "=" (ASCII code 61)
  2555. "?" (ASCII code 63)
  2556. A maximally portable mail representation, such as the base64
  2557. encoding, will confine itself to relatively short lines of text in
  2558. which the only meaningful characters are taken from this set of 73
  2559. characters.
  2560. (7) Some mail transport agents will corrupt data that includes
  2561. certain literal strings. In particular, a period (".") alone on a
  2562. line is known to be corrupted by some (incorrect) SMTP
  2563. implementations, and a line that starts with the five characters
  2564. "From " (the fifth character is a SPACE) are commonly corrupted as
  2565. Borenstein & Freed [Page 64]
  2566. RFC 1521 MIME September 1993
  2567. well. A careful composition agent can prevent these corruptions
  2568. by encoding the data (e.g., in the quoted-printable encoding,
  2569. "=46rom " in place of "From " at the start of a line, and "=2E" in
  2570. place of "." alone on a line.
  2571. Please note that the above list is NOT a list of recommended
  2572. practices for MTAs. RFC 821 MTAs are prohibited from altering the
  2573. character of white space or wrapping long lines. These BAD and
  2574. illegal practices are known to occur on established networks, and
  2575. implementations should be robust in dealing with the bad effects they
  2576. can cause.
  2577. Borenstein & Freed [Page 65]
  2578. RFC 1521 MIME September 1993
  2579. Appendix C -- A Complex Multipart Example
  2580. What follows is the outline of a complex multipart message. This
  2581. message has five parts to be displayed serially: two introductory
  2582. plain text parts, an embedded multipart message, a richtext part, and
  2583. a closing encapsulated text message in a non-ASCII character set.
  2584. The embedded multipart message has two parts to be displayed in
  2585. parallel, a picture and an audio fragment.
  2586. MIME-Version: 1.0
  2587. From: Nathaniel Borenstein <nsb@bellcore.com>
  2588. To: Ned Freed <ned@innosoft.com>
  2589. Subject: A multipart example
  2590. Content-Type: multipart/mixed;
  2591. boundary=unique-boundary-1
  2592. This is the preamble area of a multipart message.
  2593. Mail readers that understand multipart format
  2594. should ignore this preamble.
  2595. If you are reading this text, you might want to
  2596. consider changing to a mail reader that understands
  2597. how to properly display multipart messages.
  2598. --unique-boundary-1
  2599. ...Some text appears here...
  2600. [Note that the preceding blank line means
  2601. no header fields were given and this is text,
  2602. with charset US ASCII. It could have been
  2603. done with explicit typing as in the next part.]
  2604. --unique-boundary-1
  2605. Content-type: text/plain; charset=US-ASCII
  2606. This could have been part of the previous part,
  2607. but illustrates explicit versus implicit
  2608. typing of body parts.
  2609. --unique-boundary-1
  2610. Content-Type: multipart/parallel;
  2611. boundary=unique-boundary-2
  2612. --unique-boundary-2
  2613. Content-Type: audio/basic
  2614. Content-Transfer-Encoding: base64
  2615. ... base64-encoded 8000 Hz single-channel
  2616. mu-law-format audio data goes here....
  2617. Borenstein & Freed [Page 66]
  2618. RFC 1521 MIME September 1993
  2619. --unique-boundary-2
  2620. Content-Type: image/gif
  2621. Content-Transfer-Encoding: base64
  2622. ... base64-encoded image data goes here....
  2623. --unique-boundary-2--
  2624. --unique-boundary-1
  2625. Content-type: text/richtext
  2626. This is <bold><italic>richtext.</italic></bold>
  2627. <smaller>as defined in RFC 1341</smaller>
  2628. <nl><nl>Isn't it
  2629. <bigger><bigger>cool?</bigger></bigger>
  2630. --unique-boundary-1
  2631. Content-Type: message/rfc822
  2632. From: (mailbox in US-ASCII)
  2633. To: (address in US-ASCII)
  2634. Subject: (subject in US-ASCII)
  2635. Content-Type: Text/plain; charset=ISO-8859-1
  2636. Content-Transfer-Encoding: Quoted-printable
  2637. ... Additional text in ISO-8859-1 goes here ...
  2638. --unique-boundary-1--
  2639. Borenstein & Freed [Page 67]
  2640. RFC 1521 MIME September 1993
  2641. Appendix D -- Collected Grammar
  2642. This appendix contains the complete BNF grammar for all the syntax
  2643. specified by this document.
  2644. By itself, however, this grammar is incomplete. It refers to several
  2645. entities that are defined by RFC 822. Rather than reproduce those
  2646. definitions here, and risk unintentional differences between the two,
  2647. this document simply refers the reader to RFC 822 for the remaining
  2648. definitions. Wherever a term is undefined, it refers to the RFC 822
  2649. definition.
  2650. application-subtype := ("octet-stream" *stream-param)
  2651. / "postscript" / extension-token
  2652. application-type := "application" "/" application-subtype
  2653. attribute := token ; case-insensitive
  2654. atype := "ftp" / "anon-ftp" / "tftp" / "local-file"
  2655. / "afs" / "mail-server" / extension-token
  2656. ; Case-insensitive
  2657. audio-type := "audio" "/" ("basic" / extension-token)
  2658. body-part := <"message" as defined in RFC 822,
  2659. with all header fields optional, and with the
  2660. specified delimiter not occurring anywhere in
  2661. the message body, either on a line by itself
  2662. or as a substring anywhere.>
  2663. NOTE: In certain transport enclaves, RFC 822 restrictions such as
  2664. the one that limits bodies to printable ASCII characters may not
  2665. be in force. (That is, the transport domains may resemble
  2666. standard Internet mail transport as specified in RFC821 and
  2667. assumed by RFC822, but without certain restrictions.) The
  2668. relaxation of these restrictions should be construed as locally
  2669. extending the definition of bodies, for example to include octets
  2670. outside of the ASCII range, as long as these extensions are
  2671. supported by the transport and adequately documented in the
  2672. Content-Transfer-Encoding header field. However, in no event are
  2673. headers (either message headers or body-part headers) allowed to
  2674. contain anything other than ASCII characters.
  2675. Borenstein & Freed [Page 68]
  2676. RFC 1521 MIME September 1993
  2677. boundary := 0*69<bchars> bcharsnospace
  2678. bchars := bcharsnospace / " "
  2679. bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_"
  2680. / "," / "-" / "." / "/" / ":" / "=" / "?"
  2681. charset := "us-ascii" / "iso-8859-1" / "iso-8859-2"/ "iso-8859-3"
  2682. / "iso-8859-4" / "iso-8859-5" / "iso-8859-6" / "iso-8859-7"
  2683. / "iso-8859-8" / "iso-8859-9" / extension-token
  2684. ; case insensitive
  2685. close-delimiter := "--" boundary "--" CRLF;Again,no space by "--",
  2686. content := "Content-Type" ":" type "/" subtype *(";" parameter)
  2687. ; case-insensitive matching of type and subtype
  2688. delimiter := "--" boundary CRLF ;taken from Content-Type field.
  2689. ; There must be no space
  2690. ; between "--" and boundary.
  2691. description := "Content-Description" ":" *text
  2692. discard-text := *(*text CRLF)
  2693. encapsulation := delimiter body-part CRLF
  2694. encoding := "Content-Transfer-Encoding" ":" mechanism
  2695. epilogue := discard-text ; to be ignored upon receipt.
  2696. extension-token := x-token / iana-token
  2697. external-param := (";" "access-type" "=" atype)
  2698. / (";" "expiration" "=" date-time)
  2699. ; Note that date-time is quoted
  2700. / (";" "size" "=" 1*DIGIT)
  2701. / (";" "permission" "=" ("read" / "read-write"))
  2702. ; Permission is case-insensitive
  2703. / (";" "name" "=" value)
  2704. / (";" "site" "=" value)
  2705. / (";" "dir" "=" value)
  2706. / (";" "mode" "=" value)
  2707. / (";" "server" "=" value)
  2708. / (";" "subject" "=" value)
  2709. ;access-type required; others required based on access-type
  2710. Borenstein & Freed [Page 69]
  2711. RFC 1521 MIME September 1993
  2712. iana-token := <a publicly-defined extension token,
  2713. registered with IANA, as specified in
  2714. appendix E>
  2715. id := "Content-ID" ":" msg-id
  2716. image-type := "image" "/" ("gif" / "jpeg" / extension-token)
  2717. mechanism := "7bit" ; case-insensitive
  2718. / "quoted-printable"
  2719. / "base64"
  2720. / "8bit"
  2721. / "binary"
  2722. / x-token
  2723. message-subtype := "rfc822"
  2724. / "partial" 2#3partial-param
  2725. / "external-body" 1*external-param
  2726. / extension-token
  2727. message-type := "message" "/" message-subtype
  2728. multipart-body :=preamble 1*encapsulation close-delimiter epilogue
  2729. multipart-subtype := "mixed" / "parallel" / "digest"
  2730. / "alternative" / extension-token
  2731. multipart-type := "multipart" "/" multipart-subtype
  2732. ";" "boundary" "=" boundary
  2733. octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F")
  2734. ; octet must be used for characters > 127, =, SPACE, or
  2735. TAB,
  2736. ; and is recommended for any characters not listed in
  2737. ; Appendix B as "mail-safe".
  2738. padding := "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7"
  2739. parameter := attribute "=" value
  2740. partial-param := (";" "id" "=" value)
  2741. / (";" "number" "=" 1*DIGIT)
  2742. / (";" "total" "=" 1*DIGIT)
  2743. ; id & number required;total required for last part
  2744. preamble := discard-text ; to be ignored upon receipt.
  2745. ptext := octet / <any ASCII character except "=", SPACE, or TAB>
  2746. Borenstein & Freed [Page 70]
  2747. RFC 1521 MIME September 1993
  2748. ; characters not listed as "mail-safe" in Appendix B
  2749. ; are also not recommended.
  2750. quoted-printable := ([*(ptext / SPACE / TAB) ptext] ["="] CRLF)
  2751. ; Maximum line length of 76 characters excluding CRLF
  2752. stream-param := (";" "type" "=" value)
  2753. / (";" "padding" "=" padding)
  2754. subtype := token ; case-insensitive
  2755. text-subtype := "plain" / extension-token
  2756. text-type := "text" "/" text-subtype [";" "charset" "=" charset]
  2757. token := 1*<any (ASCII) CHAR except SPACE, CTLs, or tspecials>
  2758. tspecials := "(" / ")" / "<" / ">" / "@"
  2759. / "," / ";" / ":" / "\" / <">
  2760. / "/" / "[" / "]" / "?" / "="
  2761. ; Must be in quoted-string,
  2762. ; to use within parameter values
  2763. type := "application" / "audio" ; case-insensitive
  2764. / "image" / "message"
  2765. / "multipart" / "text"
  2766. / "video" / extension-token
  2767. ; All values case-insensitive
  2768. value := token / quoted-string
  2769. version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
  2770. video-type := "video" "/" ("mpeg" / extension-token)
  2771. x-token := <The two characters "X-" or "x-" followed, with no
  2772. intervening white space, by any token>
  2773. Borenstein & Freed [Page 71]
  2774. RFC 1521 MIME September 1993
  2775. Appendix E -- IANA Registration Procedures
  2776. MIME has been carefully designed to have extensible mechanisms, and
  2777. it is expected that the set of content-type/subtype pairs and their
  2778. associated parameters will grow significantly with time. Several
  2779. other MIME fields, notably character set names, access-type
  2780. parameters for the message/external-body type, and possibly even
  2781. Content-Transfer-Encoding values, are likely to have new values
  2782. defined over time. In order to ensure that the set of such values is
  2783. developed in an orderly, well-specified, and public manner, MIME
  2784. defines a registration process which uses the Internet Assigned
  2785. Numbers Authority (IANA) as a central registry for such values.
  2786. In general, parameters in the content-type header field are used to
  2787. convey supplemental information for various content types, and their
  2788. use is defined when the content-type and subtype are defined. New
  2789. parameters should not be defined as a way to introduce new
  2790. functionality.
  2791. In order to simplify and standardize the registration process, this
  2792. appendix gives templates for the registration of new values with
  2793. IANA. Each of these is given in the form of an email message
  2794. template, to be filled in by the registering party.
  2795. E.1 Registration of New Content-type/subtype Values
  2796. Note that MIME is generally expected to be extended by subtypes. If
  2797. a new fundamental top-level type is needed, its specification must be
  2798. published as an RFC or submitted in a form suitable to become an RFC,
  2799. and be subject to the Internet standards process.
  2800. To: IANA@isi.edu
  2801. Subject: Registration of new MIME
  2802. content-type/subtype
  2803. MIME type name:
  2804. (If the above is not an existing top-level MIME type,
  2805. please explain why an existing type cannot be used.)
  2806. MIME subtype name:
  2807. Required parameters:
  2808. Optional parameters:
  2809. Encoding considerations:
  2810. Borenstein & Freed [Page 72]
  2811. RFC 1521 MIME September 1993
  2812. Security considerations:
  2813. Published specification:
  2814. (The published specification must be an Internet RFC or
  2815. RFC-to-be if a new top-level type is being defined, and
  2816. must be a publicly available specification in any
  2817. case.)
  2818. Person & email address to contact for further information:
  2819. E.2 Registration of New Access-type Values
  2820. for Message/external-body
  2821. To: IANA@isi.edu
  2822. Subject: Registration of new MIME Access-type for
  2823. Message/external-body content-type
  2824. MIME access-type name:
  2825. Required parameters:
  2826. Optional parameters:
  2827. Published specification:
  2828. (The published specification must be an Internet RFC or
  2829. RFC-to-be.)
  2830. Person & email address to contact for further information:
  2831. Borenstein & Freed [Page 73]
  2832. RFC 1521 MIME September 1993
  2833. Appendix F -- Summary of the Seven Content-types
  2834. Content-type: text
  2835. Subtypes defined by this document: plain
  2836. Important Parameters: charset
  2837. Encoding notes: quoted-printable generally preferred if an encoding
  2838. is needed and the character set is mostly an ASCII superset.
  2839. Security considerations: Rich text formats such as TeX and Troff
  2840. often contain mechanisms for executing arbitrary commands or file
  2841. system operations, and should not be used automatically unless
  2842. these security problems have been addressed. Even plain text may
  2843. contain control characters that can be used to exploit the
  2844. capabilities of "intelligent" terminals and cause security
  2845. violations. User interfaces designed to run on such terminals
  2846. should be aware of and try to prevent such problems.
  2847. ________________________________________________________
  2848. Content-type: multipart
  2849. Subtypes defined by this document: mixed, alternative,
  2850. digest, parallel.
  2851. Important Parameters: boundary
  2852. Encoding notes: No content-transfer-encoding is permitted.
  2853. ________________________________________________________
  2854. Content-type: message
  2855. Subtypes defined by this document: rfc822, partial, external-body
  2856. Important Parameters: id, number, total, access-type, expiration,
  2857. size, permission, name, site, directory, mode, server, subject
  2858. Encoding notes: No content-transfer-encoding is permitted.
  2859. Specifically, only "7bit" is permitted for "message/partial" or
  2860. "message/external-body", and only "7bit", "8bit", or "binary" are
  2861. permitted for other subtypes of "message".
  2862. ______________________________________________________________
  2863. Content-type: application
  2864. Subtypes defined by this document: octet-stream, postscript
  2865. Important Parameters: type, padding
  2866. Borenstein & Freed [Page 74]
  2867. RFC 1521 MIME September 1993
  2868. Deprecated Parameters: name and conversions were
  2869. defined in RFC 1341.
  2870. Encoding notes: base64 preferred for unreadable subtypes.
  2871. Security considerations: This type is intended for the
  2872. transmission of data to be interpreted by locally-installed
  2873. programs. If used, for example, to transmit executable
  2874. binary programs or programs in general-purpose interpreted
  2875. languages, such as LISP programs or shell scripts, severe
  2876. security problems could result. Authors of mail-reading
  2877. agents are cautioned against giving their systems the power
  2878. to execute mail-based application data without carefully
  2879. considering the security implications. While it is
  2880. certainly possible to define safe application formats and
  2881. even safe interpreters for unsafe formats, each interpreter
  2882. should be evaluated separately for possible security
  2883. problems.
  2884. ________________________________________________________________
  2885. Content-type: image
  2886. Subtypes defined by this document: jpeg, gif
  2887. Important Parameters: none
  2888. Encoding notes: base64 generally preferred
  2889. ________________________________________________________________
  2890. Content-type: audio
  2891. Subtypes defined by this document: basic
  2892. Important Parameters: none
  2893. Encoding notes: base64 generally preferred
  2894. ________________________________________________________________
  2895. Content-type: video
  2896. Subtypes defined by this document: mpeg
  2897. Important Parameters: none
  2898. Encoding notes: base64 generally preferred
  2899. Borenstein & Freed [Page 75]
  2900. RFC 1521 MIME September 1993
  2901. Appendix G -- Canonical Encoding Model
  2902. There was some confusion, in earlier drafts of this memo, regarding
  2903. the model for when email data was to be converted to canonical form
  2904. and encoded, and in particular how this process would affect the
  2905. treatment of CRLFs, given that the representation of newlines varies
  2906. greatly from system to system. For this reason, a canonical model
  2907. for encoding is presented below.
  2908. The process of composing a MIME entity can be modeled as being done
  2909. in a number of steps. Note that these steps are roughly similar to
  2910. those steps used in RFC 1421 and are performed for each 'innermost
  2911. level' body:
  2912. Step 1. Creation of local form.
  2913. The body to be transmitted is created in the system's native format.
  2914. The native character set is used, and where appropriate local end of
  2915. line conventions are used as well. The body may be a UNIX-style text
  2916. file, or a Sun raster image, or a VMS indexed file, or audio data in
  2917. a system-dependent format stored only in memory, or anything else
  2918. that corresponds to the local model for the representation of some
  2919. form of information. Fundamentally, the data is created in the
  2920. "native" form specified by the type/subtype information.
  2921. Step 2. Conversion to canonical form.
  2922. The entire body, including "out-of-band" information such as record
  2923. lengths and possibly file attribute information, is converted to a
  2924. universal canonical form. The specific content type of the body as
  2925. well as its associated attributes dictate the nature of the canonical
  2926. form that is used. Conversion to the proper canonical form may
  2927. involve character set conversion, transformation of audio data,
  2928. compression, or various other operations specific to the various
  2929. content types. If character set conversion is involved, however,
  2930. care must be taken to understand the semantics of the content-type,
  2931. which may have strong implications for any character set conversion,
  2932. e.g. with regard to syntactically meaningful characters in a text
  2933. subtype other than "plain".
  2934. For example, in the case of text/plain data, the text must be
  2935. converted to a supported character set and lines must be delimited
  2936. with CRLF delimiters in accordance with RFC822. Note that the
  2937. restriction on line lengths implied by RFC822 is eliminated if the
  2938. next step employs either quoted-printable or base64 encoding.
  2939. Borenstein & Freed [Page 76]
  2940. RFC 1521 MIME September 1993
  2941. Step 3. Apply transfer encoding.
  2942. A Content-Transfer-Encoding appropriate for this body is applied.
  2943. Note that there is no fixed relationship between the content type and
  2944. the transfer encoding. In particular, it may be appropriate to base
  2945. the choice of base64 or quoted-printable on character frequency
  2946. counts which are specific to a given instance of a body.
  2947. Step 4. Insertion into entity.
  2948. The encoded object is inserted into a MIME entity with appropriate
  2949. headers. The entity is then inserted into the body of a higher-level
  2950. entity (message or multipart) if needed.
  2951. It is vital to note that these steps are only a model; they are
  2952. specifically NOT a blueprint for how an actual system would be built.
  2953. In particular, the model fails to account for two common designs:
  2954. 1. In many cases the conversion to a canonical form prior to
  2955. encoding will be subsumed into the encoder itself, which
  2956. understands local formats directly. For example, the local
  2957. newline convention for text bodies might be carried through to the
  2958. encoder itself along with knowledge of what that format is.
  2959. 2. The output of the encoders may have to pass through one or
  2960. more additional steps prior to being transmitted as a message. As
  2961. such, the output of the encoder may not be conformant with the
  2962. formats specified by RFC822. In particular, once again it may be
  2963. appropriate for the converter's output to be expressed using local
  2964. newline conventions rather than using the standard RFC822 CRLF
  2965. delimiters.
  2966. Other implementation variations are conceivable as well. The vital
  2967. aspect of this discussion is that, in spite of any optimizations,
  2968. collapsings of required steps, or insertion of additional processing,
  2969. the resulting messages must be consistent with those produced by the
  2970. model described here. For example, a message with the following
  2971. header fields:
  2972. Content-type: text/foo; charset=bar
  2973. Content-Transfer-Encoding: base64
  2974. must be first represented in the text/foo form, then (if necessary)
  2975. represented in the "bar" character set, and finally transformed via
  2976. the base64 algorithm into a mail-safe form.
  2977. Borenstein & Freed [Page 77]
  2978. RFC 1521 MIME September 1993
  2979. Appendix H -- Changes from RFC 1341
  2980. This document is a relatively minor revision of RFC 1341. For
  2981. the convenience of those familiar with RFC 1341, the technical
  2982. changes from that document are summarized in this appendix.
  2983. 1. The definition of "tspecials" has been changed to no longer
  2984. include ".".
  2985. 2. The Content-ID field is now mandatory for message/external-body
  2986. parts.
  2987. 3. The text/richtext type (including the old Section 7.1.3 and
  2988. Appendix D) has been moved to a separate document.
  2989. 4. The rules on header merging for message/partial data have been
  2990. changed to treat the Encrypted and MIME-Version headers as special
  2991. cases.
  2992. 5. The definition of the external-body access-type parameter has
  2993. been changed so that it can only indicate a single access method
  2994. (which was all that made sense).
  2995. 6. There is a new "Subject" parameter for message/external-body,
  2996. access-type mail-server, to permit MIME-based use of mail servers
  2997. that rely on Subject field information.
  2998. 7. The "conversions" parameter for application/octet-stream has been
  2999. removed.
  3000. 8. Section 7.4.1 now deprecates the use of the "name" parameter for
  3001. application/octet-stream, as this will be superseded in the future by
  3002. a Content-Disposition header.
  3003. 9. The formal grammar for multipart bodies has been changed so that
  3004. a CRLF is no longer required before the first boundary line.
  3005. 10. MIME entities of type "message/partial" and "message/external-
  3006. body" are now required to use only the "7bit" transfer-encoding.
  3007. (Specifically, "binary" and "8bit" are not permitted.)
  3008. 11. The "application/oda" content-type has been removed.
  3009. 12. A note has been added to the end of section 7.2.3, explaining
  3010. the semantics of Content-ID in a multipart/alternative MIME entity.
  3011. 13. The formal syntax for the "MIME-Version" field has been
  3012. tightened, but in a way that is completely compatible with the only
  3013. Borenstein & Freed [Page 78]
  3014. RFC 1521 MIME September 1993
  3015. version number defined in RFC 1341.
  3016. 14. In Section 7.3.1, the definition of message/rfc822 has been
  3017. relaxed regarding mandatory fields.
  3018. All other changes from RFC 1341 were editorial changes and do not
  3019. affect the technical content of MIME. Considerable formal grammar
  3020. has been added, but this reflects the prose specification that was
  3021. already in place.
  3022. Borenstein & Freed [Page 79]
  3023. RFC 1521 MIME September 1993
  3024. References
  3025. [US-ASCII] Coded Character Set--7-Bit American Standard Code for
  3026. Information Interchange, ANSI X3.4-1986.
  3027. [ATK] Borenstein, Nathaniel S., Multimedia Applications Development
  3028. with the Andrew Toolkit, Prentice-Hall, 1990.
  3029. [GIF] Graphics Interchange Format (Version 89a), Compuserve, Inc.,
  3030. Columbus, Ohio, 1990.
  3031. [ISO-2022] International Standard--Information Processing--ISO 7-bit
  3032. and 8-bit coded character sets--Code extension techniques, ISO
  3033. 2022:1986.
  3034. [ISO-8859] Information Processing -- 8-bit Single-Byte Coded Graphic
  3035. Character Sets -- Part 1: Latin Alphabet No. 1, ISO 8859-1:1987. Part
  3036. 2: Latin alphabet No. 2, ISO 8859-2, 1987. Part 3: Latin alphabet
  3037. No. 3, ISO 8859-3, 1988. Part 4: Latin alphabet No. 4, ISO 8859-4,
  3038. 1988. Part 5: Latin/Cyrillic alphabet, ISO 8859-5, 1988. Part 6:
  3039. Latin/Arabic alphabet, ISO 8859-6, 1987. Part 7: Latin/Greek
  3040. alphabet, ISO 8859-7, 1987. Part 8: Latin/Hebrew alphabet, ISO
  3041. 8859-8, 1988. Part 9: Latin alphabet No. 5, ISO 8859-9, 1990.
  3042. [ISO-646] International Standard--Information Processing--ISO 7-bit
  3043. coded character set for information interchange, ISO 646:1983.
  3044. [MPEG] Video Coding Draft Standard ISO 11172 CD, ISO IEC/TJC1/SC2/WG11
  3045. (Motion Picture Experts Group), May, 1991.
  3046. [PCM] CCITT, Fascicle III.4 - Recommendation G.711, Geneva, 1972,
  3047. "Pulse Code Modulation (PCM) of Voice Frequencies".
  3048. [POSTSCRIPT] Adobe Systems, Inc., PostScript Language Reference
  3049. Manual, Addison-Wesley, 1985.
  3050. [POSTSCRIPT2] Adobe Systems, Inc., PostScript Language Reference
  3051. Manual, Addison-Wesley, Second Edition, 1990.
  3052. [X400] Schicker, Pietro, "Message Handling Systems, X.400", Message
  3053. Handling Systems and Distributed Applications, E. Stefferud, O-j.
  3054. Jacobsen, and P. Schicker, eds., North-Holland, 1989, pp. 3-41.
  3055. [RFC-783] Sollins, K., "TFTP Protocol (revision 2)", RFC 783, MIT,
  3056. June 1981.
  3057. [RFC-821] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC
  3058. 821, USC/Information Sciences Institute, August 1982.
  3059. Borenstein & Freed [Page 80]
  3060. RFC 1521 MIME September 1993
  3061. [RFC-822] Crocker, D., "Standard for the Format of ARPA Internet Text
  3062. Messages", STD 11, RFC 822, UDEL, August 1982.
  3063. [RFC-934] Rose, M., and E. Stefferud, "Proposed Standard for Message
  3064. Encapsulation", RFC 934, Delaware and NMA, January 1985.
  3065. [RFC-959] Postel, J. and J. Reynolds, "File Transfer Protocol",
  3066. STD 9, RFC 959, USC/Information Sciences Institute, October 1985.
  3067. [RFC-1049] Sirbu, M., "Content-Type Header Field for Internet
  3068. Messages", STD 11, RFC 1049, CMU, March 1988.
  3069. [RFC-1421] Linn, J., "Privacy Enhancement for Internet Electronic Mail:
  3070. Part I - Message Encryption and Authentication Procedures", RFC
  3071. 1421, IAB IRTF PSRG, IETF PEM WG, February 1993.
  3072. [RFC-1154] Robinson, D. and R. Ullmann, "Encoding Header Field for
  3073. Internet Messages", RFC 1154, Prime Computer, Inc., April 1990.
  3074. [RFC-1341] Borenstein, N., and N. Freed, "MIME (Multipurpose Internet
  3075. Mail Extensions): Mechanisms for Specifying and Describing the Format
  3076. of Internet Message Bodies", RFC 1341, Bellcore, Innosoft, June 1992.
  3077. [RFC-1342] Moore, K., "Representation of Non-Ascii Text in Internet
  3078. Message Headers", RFC 1342, University of Tennessee, June 1992.
  3079. [RFC-1343] Borenstein, N., "A User Agent Configuration Mechanism
  3080. for Multimedia Mail Format Information", RFC 1343, Bellcore, June
  3081. 1992.
  3082. [RFC-1344] Borenstein, N., "Implications of MIME for Internet
  3083. Mail Gateways", RFC 1344, Bellcore, June 1992.
  3084. [RFC-1345] Simonsen, K., "Character Mnemonics & Character Sets",
  3085. RFC 1345, Rationel Almen Planlaegning, June 1992.
  3086. [RFC-1426] Klensin, J., (WG Chair), Freed, N., (Editor), Rose, M.,
  3087. Stefferud, E., and D. Crocker, "SMTP Service Extension for 8bit-MIME
  3088. transport", RFC 1426, United Nations Universit, Innosoft, Dover Beach
  3089. Consulting, Inc., Network Management Associates, Inc., The Branch
  3090. Office, February 1993.
  3091. [RFC-1522] Moore, K., "Representation of Non-Ascii Text in Internet
  3092. Message Headers" RFC 1522, University of Tennessee, September 1993.
  3093. [RFC-1340] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC
  3094. 1340, USC/Information Sciences Institute, July 1992.
  3095. Borenstein & Freed [Page 81]