rfc5322.txt 119 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195
  1. Network Working Group P. Resnick, Ed.
  2. Request for Comments: 5322 Qualcomm Incorporated
  3. Obsoletes: 2822 October 2008
  4. Updates: 4021
  5. Category: Standards Track
  6. Internet Message Format
  7. Status of This Memo
  8. This document specifies an Internet standards track protocol for the
  9. Internet community, and requests discussion and suggestions for
  10. improvements. Please refer to the current edition of the "Internet
  11. Official Protocol Standards" (STD 1) for the standardization state
  12. and status of this protocol. Distribution of this memo is unlimited.
  13. Abstract
  14. This document specifies the Internet Message Format (IMF), a syntax
  15. for text messages that are sent between computer users, within the
  16. framework of "electronic mail" messages. This specification is a
  17. revision of Request For Comments (RFC) 2822, which itself superseded
  18. Request For Comments (RFC) 822, "Standard for the Format of ARPA
  19. Internet Text Messages", updating it to reflect current practice and
  20. incorporating incremental changes that were specified in other RFCs.
  21. Resnick Standards Track [Page 1]
  22. RFC 5322 Internet Message Format October 2008
  23. Table of Contents
  24. 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
  25. 1.1. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 4
  26. 1.2. Notational Conventions . . . . . . . . . . . . . . . . . . 5
  27. 1.2.1. Requirements Notation . . . . . . . . . . . . . . . . 5
  28. 1.2.2. Syntactic Notation . . . . . . . . . . . . . . . . . . 5
  29. 1.2.3. Structure of This Document . . . . . . . . . . . . . . 5
  30. 2. Lexical Analysis of Messages . . . . . . . . . . . . . . . . . 6
  31. 2.1. General Description . . . . . . . . . . . . . . . . . . . 6
  32. 2.1.1. Line Length Limits . . . . . . . . . . . . . . . . . . 7
  33. 2.2. Header Fields . . . . . . . . . . . . . . . . . . . . . . 8
  34. 2.2.1. Unstructured Header Field Bodies . . . . . . . . . . . 8
  35. 2.2.2. Structured Header Field Bodies . . . . . . . . . . . . 8
  36. 2.2.3. Long Header Fields . . . . . . . . . . . . . . . . . . 8
  37. 2.3. Body . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
  38. 3. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  39. 3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 10
  40. 3.2. Lexical Tokens . . . . . . . . . . . . . . . . . . . . . . 10
  41. 3.2.1. Quoted characters . . . . . . . . . . . . . . . . . . 10
  42. 3.2.2. Folding White Space and Comments . . . . . . . . . . . 11
  43. 3.2.3. Atom . . . . . . . . . . . . . . . . . . . . . . . . . 12
  44. 3.2.4. Quoted Strings . . . . . . . . . . . . . . . . . . . . 13
  45. 3.2.5. Miscellaneous Tokens . . . . . . . . . . . . . . . . . 14
  46. 3.3. Date and Time Specification . . . . . . . . . . . . . . . 14
  47. 3.4. Address Specification . . . . . . . . . . . . . . . . . . 16
  48. 3.4.1. Addr-Spec Specification . . . . . . . . . . . . . . . 17
  49. 3.5. Overall Message Syntax . . . . . . . . . . . . . . . . . . 18
  50. 3.6. Field Definitions . . . . . . . . . . . . . . . . . . . . 19
  51. 3.6.1. The Origination Date Field . . . . . . . . . . . . . . 22
  52. 3.6.2. Originator Fields . . . . . . . . . . . . . . . . . . 22
  53. 3.6.3. Destination Address Fields . . . . . . . . . . . . . . 23
  54. 3.6.4. Identification Fields . . . . . . . . . . . . . . . . 25
  55. 3.6.5. Informational Fields . . . . . . . . . . . . . . . . . 27
  56. 3.6.6. Resent Fields . . . . . . . . . . . . . . . . . . . . 28
  57. 3.6.7. Trace Fields . . . . . . . . . . . . . . . . . . . . . 30
  58. 3.6.8. Optional Fields . . . . . . . . . . . . . . . . . . . 30
  59. 4. Obsolete Syntax . . . . . . . . . . . . . . . . . . . . . . . 31
  60. 4.1. Miscellaneous Obsolete Tokens . . . . . . . . . . . . . . 32
  61. 4.2. Obsolete Folding White Space . . . . . . . . . . . . . . . 33
  62. 4.3. Obsolete Date and Time . . . . . . . . . . . . . . . . . . 33
  63. 4.4. Obsolete Addressing . . . . . . . . . . . . . . . . . . . 35
  64. 4.5. Obsolete Header Fields . . . . . . . . . . . . . . . . . . 35
  65. 4.5.1. Obsolete Origination Date Field . . . . . . . . . . . 36
  66. 4.5.2. Obsolete Originator Fields . . . . . . . . . . . . . . 36
  67. 4.5.3. Obsolete Destination Address Fields . . . . . . . . . 37
  68. 4.5.4. Obsolete Identification Fields . . . . . . . . . . . . 37
  69. 4.5.5. Obsolete Informational Fields . . . . . . . . . . . . 37
  70. Resnick Standards Track [Page 2]
  71. RFC 5322 Internet Message Format October 2008
  72. 4.5.6. Obsolete Resent Fields . . . . . . . . . . . . . . . . 38
  73. 4.5.7. Obsolete Trace Fields . . . . . . . . . . . . . . . . 38
  74. 4.5.8. Obsolete optional fields . . . . . . . . . . . . . . . 38
  75. 5. Security Considerations . . . . . . . . . . . . . . . . . . . 38
  76. 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 39
  77. Appendix A. Example Messages . . . . . . . . . . . . . . . . . 43
  78. Appendix A.1. Addressing Examples . . . . . . . . . . . . . . . 44
  79. Appendix A.1.1. A Message from One Person to Another with
  80. Simple Addressing . . . . . . . . . . . . . . . . 44
  81. Appendix A.1.2. Different Types of Mailboxes . . . . . . . . . . . 45
  82. Appendix A.1.3. Group Addresses . . . . . . . . . . . . . . . . . 45
  83. Appendix A.2. Reply Messages . . . . . . . . . . . . . . . . . . 46
  84. Appendix A.3. Resent Messages . . . . . . . . . . . . . . . . . 47
  85. Appendix A.4. Messages with Trace Fields . . . . . . . . . . . . 48
  86. Appendix A.5. White Space, Comments, and Other Oddities . . . . 49
  87. Appendix A.6. Obsoleted Forms . . . . . . . . . . . . . . . . . 50
  88. Appendix A.6.1. Obsolete Addressing . . . . . . . . . . . . . . . 50
  89. Appendix A.6.2. Obsolete Dates . . . . . . . . . . . . . . . . . . 50
  90. Appendix A.6.3. Obsolete White Space and Comments . . . . . . . . 51
  91. Appendix B. Differences from Earlier Specifications . . . . . 52
  92. Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . 53
  93. 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 55
  94. 7.1. Normative References . . . . . . . . . . . . . . . . . . . 55
  95. 7.2. Informative References . . . . . . . . . . . . . . . . . . 55
  96. Resnick Standards Track [Page 3]
  97. RFC 5322 Internet Message Format October 2008
  98. 1. Introduction
  99. 1.1. Scope
  100. This document specifies the Internet Message Format (IMF), a syntax
  101. for text messages that are sent between computer users, within the
  102. framework of "electronic mail" messages. This specification is an
  103. update to [RFC2822], which itself superseded [RFC0822], updating it
  104. to reflect current practice and incorporating incremental changes
  105. that were specified in other RFCs such as [RFC1123].
  106. This document specifies a syntax only for text messages. In
  107. particular, it makes no provision for the transmission of images,
  108. audio, or other sorts of structured data in electronic mail messages.
  109. There are several extensions published, such as the MIME document
  110. series ([RFC2045], [RFC2046], [RFC2049]), which describe mechanisms
  111. for the transmission of such data through electronic mail, either by
  112. extending the syntax provided here or by structuring such messages to
  113. conform to this syntax. Those mechanisms are outside of the scope of
  114. this specification.
  115. In the context of electronic mail, messages are viewed as having an
  116. envelope and contents. The envelope contains whatever information is
  117. needed to accomplish transmission and delivery. (See [RFC5321] for a
  118. discussion of the envelope.) The contents comprise the object to be
  119. delivered to the recipient. This specification applies only to the
  120. format and some of the semantics of message contents. It contains no
  121. specification of the information in the envelope.
  122. However, some message systems may use information from the contents
  123. to create the envelope. It is intended that this specification
  124. facilitate the acquisition of such information by programs.
  125. This specification is intended as a definition of what message
  126. content format is to be passed between systems. Though some message
  127. systems locally store messages in this format (which eliminates the
  128. need for translation between formats) and others use formats that
  129. differ from the one specified in this specification, local storage is
  130. outside of the scope of this specification.
  131. Note: This specification is not intended to dictate the internal
  132. formats used by sites, the specific message system features that
  133. they are expected to support, or any of the characteristics of
  134. user interface programs that create or read messages. In
  135. addition, this document does not specify an encoding of the
  136. characters for either transport or storage; that is, it does not
  137. specify the number of bits used or how those bits are specifically
  138. transferred over the wire or stored on disk.
  139. Resnick Standards Track [Page 4]
  140. RFC 5322 Internet Message Format October 2008
  141. 1.2. Notational Conventions
  142. 1.2.1. Requirements Notation
  143. This document occasionally uses terms that appear in capital letters.
  144. When the terms "MUST", "SHOULD", "RECOMMENDED", "MUST NOT", "SHOULD
  145. NOT", and "MAY" appear capitalized, they are being used to indicate
  146. particular requirements of this specification. A discussion of the
  147. meanings of these terms appears in [RFC2119].
  148. 1.2.2. Syntactic Notation
  149. This specification uses the Augmented Backus-Naur Form (ABNF)
  150. [RFC5234] notation for the formal definitions of the syntax of
  151. messages. Characters will be specified either by a decimal value
  152. (e.g., the value %d65 for uppercase A and %d97 for lowercase A) or by
  153. a case-insensitive literal value enclosed in quotation marks (e.g.,
  154. "A" for either uppercase or lowercase A).
  155. 1.2.3. Structure of This Document
  156. This document is divided into several sections.
  157. This section, section 1, is a short introduction to the document.
  158. Section 2 lays out the general description of a message and its
  159. constituent parts. This is an overview to help the reader understand
  160. some of the general principles used in the later portions of this
  161. document. Any examples in this section MUST NOT be taken as
  162. specification of the formal syntax of any part of a message.
  163. Section 3 specifies formal ABNF rules for the structure of each part
  164. of a message (the syntax) and describes the relationship between
  165. those parts and their meaning in the context of a message (the
  166. semantics). That is, it lays out the actual rules for the structure
  167. of each part of a message (the syntax) as well as a description of
  168. the parts and instructions for their interpretation (the semantics).
  169. This includes analysis of the syntax and semantics of subparts of
  170. messages that have specific structure. The syntax included in
  171. section 3 represents messages as they MUST be created. There are
  172. also notes in section 3 to indicate if any of the options specified
  173. in the syntax SHOULD be used over any of the others.
  174. Both sections 2 and 3 describe messages that are legal to generate
  175. for purposes of this specification.
  176. Resnick Standards Track [Page 5]
  177. RFC 5322 Internet Message Format October 2008
  178. Section 4 of this document specifies an "obsolete" syntax. There are
  179. references in section 3 to these obsolete syntactic elements. The
  180. rules of the obsolete syntax are elements that have appeared in
  181. earlier versions of this specification or have previously been widely
  182. used in Internet messages. As such, these elements MUST be
  183. interpreted by parsers of messages in order to be conformant to this
  184. specification. However, since items in this syntax have been
  185. determined to be non-interoperable or to cause significant problems
  186. for recipients of messages, they MUST NOT be generated by creators of
  187. conformant messages.
  188. Section 5 details security considerations to take into account when
  189. implementing this specification.
  190. Appendix A lists examples of different sorts of messages. These
  191. examples are not exhaustive of the types of messages that appear on
  192. the Internet, but give a broad overview of certain syntactic forms.
  193. Appendix B lists the differences between this specification and
  194. earlier specifications for Internet messages.
  195. Appendix C contains acknowledgements.
  196. 2. Lexical Analysis of Messages
  197. 2.1. General Description
  198. At the most basic level, a message is a series of characters. A
  199. message that is conformant with this specification is composed of
  200. characters with values in the range of 1 through 127 and interpreted
  201. as US-ASCII [ANSI.X3-4.1986] characters. For brevity, this document
  202. sometimes refers to this range of characters as simply "US-ASCII
  203. characters".
  204. Note: This document specifies that messages are made up of
  205. characters in the US-ASCII range of 1 through 127. There are
  206. other documents, specifically the MIME document series ([RFC2045],
  207. [RFC2046], [RFC2047], [RFC2049], [RFC4288], [RFC4289]), that
  208. extend this specification to allow for values outside of that
  209. range. Discussion of those mechanisms is not within the scope of
  210. this specification.
  211. Messages are divided into lines of characters. A line is a series of
  212. characters that is delimited with the two characters carriage-return
  213. and line-feed; that is, the carriage return (CR) character (ASCII
  214. value 13) followed immediately by the line feed (LF) character (ASCII
  215. value 10). (The carriage return/line feed pair is usually written in
  216. this document as "CRLF".)
  217. Resnick Standards Track [Page 6]
  218. RFC 5322 Internet Message Format October 2008
  219. A message consists of header fields (collectively called "the header
  220. section of the message") followed, optionally, by a body. The header
  221. section is a sequence of lines of characters with special syntax as
  222. defined in this specification. The body is simply a sequence of
  223. characters that follows the header section and is separated from the
  224. header section by an empty line (i.e., a line with nothing preceding
  225. the CRLF).
  226. Note: Common parlance and earlier versions of this specification
  227. use the term "header" to either refer to the entire header section
  228. or to refer to an individual header field. To avoid ambiguity,
  229. this document does not use the terms "header" or "headers" in
  230. isolation, but instead always uses "header field" to refer to the
  231. individual field and "header section" to refer to the entire
  232. collection.
  233. 2.1.1. Line Length Limits
  234. There are two limits that this specification places on the number of
  235. characters in a line. Each line of characters MUST be no more than
  236. 998 characters, and SHOULD be no more than 78 characters, excluding
  237. the CRLF.
  238. The 998 character limit is due to limitations in many implementations
  239. that send, receive, or store IMF messages which simply cannot handle
  240. more than 998 characters on a line. Receiving implementations would
  241. do well to handle an arbitrarily large number of characters in a line
  242. for robustness sake. However, there are so many implementations that
  243. (in compliance with the transport requirements of [RFC5321]) do not
  244. accept messages containing more than 1000 characters including the CR
  245. and LF per line, it is important for implementations not to create
  246. such messages.
  247. The more conservative 78 character recommendation is to accommodate
  248. the many implementations of user interfaces that display these
  249. messages which may truncate, or disastrously wrap, the display of
  250. more than 78 characters per line, in spite of the fact that such
  251. implementations are non-conformant to the intent of this
  252. specification (and that of [RFC5321] if they actually cause
  253. information to be lost). Again, even though this limitation is put
  254. on messages, it is incumbent upon implementations that display
  255. messages to handle an arbitrarily large number of characters in a
  256. line (certainly at least up to the 998 character limit) for the sake
  257. of robustness.
  258. Resnick Standards Track [Page 7]
  259. RFC 5322 Internet Message Format October 2008
  260. 2.2. Header Fields
  261. Header fields are lines beginning with a field name, followed by a
  262. colon (":"), followed by a field body, and terminated by CRLF. A
  263. field name MUST be composed of printable US-ASCII characters (i.e.,
  264. characters that have values between 33 and 126, inclusive), except
  265. colon. A field body may be composed of printable US-ASCII characters
  266. as well as the space (SP, ASCII value 32) and horizontal tab (HTAB,
  267. ASCII value 9) characters (together known as the white space
  268. characters, WSP). A field body MUST NOT include CR and LF except
  269. when used in "folding" and "unfolding", as described in section
  270. 2.2.3. All field bodies MUST conform to the syntax described in
  271. sections 3 and 4 of this specification.
  272. 2.2.1. Unstructured Header Field Bodies
  273. Some field bodies in this specification are defined simply as
  274. "unstructured" (which is specified in section 3.2.5 as any printable
  275. US-ASCII characters plus white space characters) with no further
  276. restrictions. These are referred to as unstructured field bodies.
  277. Semantically, unstructured field bodies are simply to be treated as a
  278. single line of characters with no further processing (except for
  279. "folding" and "unfolding" as described in section 2.2.3).
  280. 2.2.2. Structured Header Field Bodies
  281. Some field bodies in this specification have a syntax that is more
  282. restrictive than the unstructured field bodies described above.
  283. These are referred to as "structured" field bodies. Structured field
  284. bodies are sequences of specific lexical tokens as described in
  285. sections 3 and 4 of this specification. Many of these tokens are
  286. allowed (according to their syntax) to be introduced or end with
  287. comments (as described in section 3.2.2) as well as the white space
  288. characters, and those white space characters are subject to "folding"
  289. and "unfolding" as described in section 2.2.3. Semantic analysis of
  290. structured field bodies is given along with their syntax.
  291. 2.2.3. Long Header Fields
  292. Each header field is logically a single line of characters comprising
  293. the field name, the colon, and the field body. For convenience
  294. however, and to deal with the 998/78 character limitations per line,
  295. the field body portion of a header field can be split into a
  296. multiple-line representation; this is called "folding". The general
  297. rule is that wherever this specification allows for folding white
  298. space (not simply WSP characters), a CRLF may be inserted before any
  299. WSP.
  300. Resnick Standards Track [Page 8]
  301. RFC 5322 Internet Message Format October 2008
  302. For example, the header field:
  303. Subject: This is a test
  304. can be represented as:
  305. Subject: This
  306. is a test
  307. Note: Though structured field bodies are defined in such a way
  308. that folding can take place between many of the lexical tokens
  309. (and even within some of the lexical tokens), folding SHOULD be
  310. limited to placing the CRLF at higher-level syntactic breaks. For
  311. instance, if a field body is defined as comma-separated values, it
  312. is recommended that folding occur after the comma separating the
  313. structured items in preference to other places where the field
  314. could be folded, even if it is allowed elsewhere.
  315. The process of moving from this folded multiple-line representation
  316. of a header field to its single line representation is called
  317. "unfolding". Unfolding is accomplished by simply removing any CRLF
  318. that is immediately followed by WSP. Each header field should be
  319. treated in its unfolded form for further syntactic and semantic
  320. evaluation. An unfolded header field has no length restriction and
  321. therefore may be indeterminately long.
  322. 2.3. Body
  323. The body of a message is simply lines of US-ASCII characters. The
  324. only two limitations on the body are as follows:
  325. o CR and LF MUST only occur together as CRLF; they MUST NOT appear
  326. independently in the body.
  327. o Lines of characters in the body MUST be limited to 998 characters,
  328. and SHOULD be limited to 78 characters, excluding the CRLF.
  329. Note: As was stated earlier, there are other documents,
  330. specifically the MIME documents ([RFC2045], [RFC2046], [RFC2049],
  331. [RFC4288], [RFC4289]), that extend (and limit) this specification
  332. to allow for different sorts of message bodies. Again, these
  333. mechanisms are beyond the scope of this document.
  334. Resnick Standards Track [Page 9]
  335. RFC 5322 Internet Message Format October 2008
  336. 3. Syntax
  337. 3.1. Introduction
  338. The syntax as given in this section defines the legal syntax of
  339. Internet messages. Messages that are conformant to this
  340. specification MUST conform to the syntax in this section. If there
  341. are options in this section where one option SHOULD be generated,
  342. that is indicated either in the prose or in a comment next to the
  343. syntax.
  344. For the defined expressions, a short description of the syntax and
  345. use is given, followed by the syntax in ABNF, followed by a semantic
  346. analysis. The following primitive tokens that are used but otherwise
  347. unspecified are taken from the "Core Rules" of [RFC5234], Appendix
  348. B.1: CR, LF, CRLF, HTAB, SP, WSP, DQUOTE, DIGIT, ALPHA, and VCHAR.
  349. In some of the definitions, there will be non-terminals whose names
  350. start with "obs-". These "obs-" elements refer to tokens defined in
  351. the obsolete syntax in section 4. In all cases, these productions
  352. are to be ignored for the purposes of generating legal Internet
  353. messages and MUST NOT be used as part of such a message. However,
  354. when interpreting messages, these tokens MUST be honored as part of
  355. the legal syntax. In this sense, section 3 defines a grammar for the
  356. generation of messages, with "obs-" elements that are to be ignored,
  357. while section 4 adds grammar for the interpretation of messages.
  358. 3.2. Lexical Tokens
  359. The following rules are used to define an underlying lexical
  360. analyzer, which feeds tokens to the higher-level parsers. This
  361. section defines the tokens used in structured header field bodies.
  362. Note: Readers of this specification need to pay special attention
  363. to how these lexical tokens are used in both the lower-level and
  364. higher-level syntax later in the document. Particularly, the
  365. white space tokens and the comment tokens defined in section 3.2.2
  366. get used in the lower-level tokens defined here, and those lower-
  367. level tokens are in turn used as parts of the higher-level tokens
  368. defined later. Therefore, white space and comments may be allowed
  369. in the higher-level tokens even though they may not explicitly
  370. appear in a particular definition.
  371. 3.2.1. Quoted characters
  372. Some characters are reserved for special interpretation, such as
  373. delimiting lexical tokens. To permit use of these characters as
  374. uninterpreted data, a quoting mechanism is provided.
  375. Resnick Standards Track [Page 10]
  376. RFC 5322 Internet Message Format October 2008
  377. quoted-pair = ("\" (VCHAR / WSP)) / obs-qp
  378. Where any quoted-pair appears, it is to be interpreted as the
  379. character alone. That is to say, the "\" character that appears as
  380. part of a quoted-pair is semantically "invisible".
  381. Note: The "\" character may appear in a message where it is not
  382. part of a quoted-pair. A "\" character that does not appear in a
  383. quoted-pair is not semantically invisible. The only places in
  384. this specification where quoted-pair currently appears are
  385. ccontent, qcontent, and in obs-dtext in section 4.
  386. 3.2.2. Folding White Space and Comments
  387. White space characters, including white space used in folding
  388. (described in section 2.2.3), may appear between many elements in
  389. header field bodies. Also, strings of characters that are treated as
  390. comments may be included in structured field bodies as characters
  391. enclosed in parentheses. The following defines the folding white
  392. space (FWS) and comment constructs.
  393. Strings of characters enclosed in parentheses are considered comments
  394. so long as they do not appear within a "quoted-string", as defined in
  395. section 3.2.4. Comments may nest.
  396. There are several places in this specification where comments and FWS
  397. may be freely inserted. To accommodate that syntax, an additional
  398. token for "CFWS" is defined for places where comments and/or FWS can
  399. occur. However, where CFWS occurs in this specification, it MUST NOT
  400. be inserted in such a way that any line of a folded header field is
  401. made up entirely of WSP characters and nothing else.
  402. FWS = ([*WSP CRLF] 1*WSP) / obs-FWS
  403. ; Folding white space
  404. ctext = %d33-39 / ; Printable US-ASCII
  405. %d42-91 / ; characters not including
  406. %d93-126 / ; "(", ")", or "\"
  407. obs-ctext
  408. ccontent = ctext / quoted-pair / comment
  409. comment = "(" *([FWS] ccontent) [FWS] ")"
  410. CFWS = (1*([FWS] comment) [FWS]) / FWS
  411. Resnick Standards Track [Page 11]
  412. RFC 5322 Internet Message Format October 2008
  413. Throughout this specification, where FWS (the folding white space
  414. token) appears, it indicates a place where folding, as discussed in
  415. section 2.2.3, may take place. Wherever folding appears in a message
  416. (that is, a header field body containing a CRLF followed by any WSP),
  417. unfolding (removal of the CRLF) is performed before any further
  418. semantic analysis is performed on that header field according to this
  419. specification. That is to say, any CRLF that appears in FWS is
  420. semantically "invisible".
  421. A comment is normally used in a structured field body to provide some
  422. human-readable informational text. Since a comment is allowed to
  423. contain FWS, folding is permitted within the comment. Also note that
  424. since quoted-pair is allowed in a comment, the parentheses and
  425. backslash characters may appear in a comment, so long as they appear
  426. as a quoted-pair. Semantically, the enclosing parentheses are not
  427. part of the comment; the comment is what is contained between the two
  428. parentheses. As stated earlier, the "\" in any quoted-pair and the
  429. CRLF in any FWS that appears within the comment are semantically
  430. "invisible" and therefore not part of the comment either.
  431. Runs of FWS, comment, or CFWS that occur between lexical tokens in a
  432. structured header field are semantically interpreted as a single
  433. space character.
  434. 3.2.3. Atom
  435. Several productions in structured header field bodies are simply
  436. strings of certain basic characters. Such productions are called
  437. atoms.
  438. Some of the structured header field bodies also allow the period
  439. character (".", ASCII value 46) within runs of atext. An additional
  440. "dot-atom" token is defined for those purposes.
  441. Note: The "specials" token does not appear anywhere else in this
  442. specification. It is simply the visible (i.e., non-control, non-
  443. white space) characters that do not appear in atext. It is
  444. provided only because it is useful for implementers who use tools
  445. that lexically analyze messages. Each of the characters in
  446. specials can be used to indicate a tokenization point in lexical
  447. analysis.
  448. Resnick Standards Track [Page 12]
  449. RFC 5322 Internet Message Format October 2008
  450. atext = ALPHA / DIGIT / ; Printable US-ASCII
  451. "!" / "#" / ; characters not including
  452. "$" / "%" / ; specials. Used for atoms.
  453. "&" / "'" /
  454. "*" / "+" /
  455. "-" / "/" /
  456. "=" / "?" /
  457. "^" / "_" /
  458. "`" / "{" /
  459. "|" / "}" /
  460. "~"
  461. atom = [CFWS] 1*atext [CFWS]
  462. dot-atom-text = 1*atext *("." 1*atext)
  463. dot-atom = [CFWS] dot-atom-text [CFWS]
  464. specials = "(" / ")" / ; Special characters that do
  465. "<" / ">" / ; not appear in atext
  466. "[" / "]" /
  467. ":" / ";" /
  468. "@" / "\" /
  469. "," / "." /
  470. DQUOTE
  471. Both atom and dot-atom are interpreted as a single unit, comprising
  472. the string of characters that make it up. Semantically, the optional
  473. comments and FWS surrounding the rest of the characters are not part
  474. of the atom; the atom is only the run of atext characters in an atom,
  475. or the atext and "." characters in a dot-atom.
  476. 3.2.4. Quoted Strings
  477. Strings of characters that include characters other than those
  478. allowed in atoms can be represented in a quoted string format, where
  479. the characters are surrounded by quote (DQUOTE, ASCII value 34)
  480. characters.
  481. Resnick Standards Track [Page 13]
  482. RFC 5322 Internet Message Format October 2008
  483. qtext = %d33 / ; Printable US-ASCII
  484. %d35-91 / ; characters not including
  485. %d93-126 / ; "\" or the quote character
  486. obs-qtext
  487. qcontent = qtext / quoted-pair
  488. quoted-string = [CFWS]
  489. DQUOTE *([FWS] qcontent) [FWS] DQUOTE
  490. [CFWS]
  491. A quoted-string is treated as a unit. That is, quoted-string is
  492. identical to atom, semantically. Since a quoted-string is allowed to
  493. contain FWS, folding is permitted. Also note that since quoted-pair
  494. is allowed in a quoted-string, the quote and backslash characters may
  495. appear in a quoted-string so long as they appear as a quoted-pair.
  496. Semantically, neither the optional CFWS outside of the quote
  497. characters nor the quote characters themselves are part of the
  498. quoted-string; the quoted-string is what is contained between the two
  499. quote characters. As stated earlier, the "\" in any quoted-pair and
  500. the CRLF in any FWS/CFWS that appears within the quoted-string are
  501. semantically "invisible" and therefore not part of the quoted-string
  502. either.
  503. 3.2.5. Miscellaneous Tokens
  504. Three additional tokens are defined: word and phrase for combinations
  505. of atoms and/or quoted-strings, and unstructured for use in
  506. unstructured header fields and in some places within structured
  507. header fields.
  508. word = atom / quoted-string
  509. phrase = 1*word / obs-phrase
  510. unstructured = (*([FWS] VCHAR) *WSP) / obs-unstruct
  511. 3.3. Date and Time Specification
  512. Date and time values occur in several header fields. This section
  513. specifies the syntax for a full date and time specification. Though
  514. folding white space is permitted throughout the date-time
  515. specification, it is RECOMMENDED that a single space be used in each
  516. place that FWS appears (whether it is required or optional); some
  517. older implementations will not interpret longer sequences of folding
  518. white space correctly.
  519. Resnick Standards Track [Page 14]
  520. RFC 5322 Internet Message Format October 2008
  521. date-time = [ day-of-week "," ] date time [CFWS]
  522. day-of-week = ([FWS] day-name) / obs-day-of-week
  523. day-name = "Mon" / "Tue" / "Wed" / "Thu" /
  524. "Fri" / "Sat" / "Sun"
  525. date = day month year
  526. day = ([FWS] 1*2DIGIT FWS) / obs-day
  527. month = "Jan" / "Feb" / "Mar" / "Apr" /
  528. "May" / "Jun" / "Jul" / "Aug" /
  529. "Sep" / "Oct" / "Nov" / "Dec"
  530. year = (FWS 4*DIGIT FWS) / obs-year
  531. time = time-of-day zone
  532. time-of-day = hour ":" minute [ ":" second ]
  533. hour = 2DIGIT / obs-hour
  534. minute = 2DIGIT / obs-minute
  535. second = 2DIGIT / obs-second
  536. zone = (FWS ( "+" / "-" ) 4DIGIT) / obs-zone
  537. The day is the numeric day of the month. The year is any numeric
  538. year 1900 or later.
  539. The time-of-day specifies the number of hours, minutes, and
  540. optionally seconds since midnight of the date indicated.
  541. The date and time-of-day SHOULD express local time.
  542. The zone specifies the offset from Coordinated Universal Time (UTC,
  543. formerly referred to as "Greenwich Mean Time") that the date and
  544. time-of-day represent. The "+" or "-" indicates whether the time-of-
  545. day is ahead of (i.e., east of) or behind (i.e., west of) Universal
  546. Time. The first two digits indicate the number of hours difference
  547. from Universal Time, and the last two digits indicate the number of
  548. additional minutes difference from Universal Time. (Hence, +hhmm
  549. means +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm)
  550. minutes). The form "+0000" SHOULD be used to indicate a time zone at
  551. Universal Time. Though "-0000" also indicates Universal Time, it is
  552. Resnick Standards Track [Page 15]
  553. RFC 5322 Internet Message Format October 2008
  554. used to indicate that the time was generated on a system that may be
  555. in a local time zone other than Universal Time and that the date-time
  556. contains no information about the local time zone.
  557. A date-time specification MUST be semantically valid. That is, the
  558. day-of-week (if included) MUST be the day implied by the date, the
  559. numeric day-of-month MUST be between 1 and the number of days allowed
  560. for the specified month (in the specified year), the time-of-day MUST
  561. be in the range 00:00:00 through 23:59:60 (the number of seconds
  562. allowing for a leap second; see [RFC1305]), and the last two digits
  563. of the zone MUST be within the range 00 through 59.
  564. 3.4. Address Specification
  565. Addresses occur in several message header fields to indicate senders
  566. and recipients of messages. An address may either be an individual
  567. mailbox, or a group of mailboxes.
  568. address = mailbox / group
  569. mailbox = name-addr / addr-spec
  570. name-addr = [display-name] angle-addr
  571. angle-addr = [CFWS] "<" addr-spec ">" [CFWS] /
  572. obs-angle-addr
  573. group = display-name ":" [group-list] ";" [CFWS]
  574. display-name = phrase
  575. mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
  576. address-list = (address *("," address)) / obs-addr-list
  577. group-list = mailbox-list / CFWS / obs-group-list
  578. A mailbox receives mail. It is a conceptual entity that does not
  579. necessarily pertain to file storage. For example, some sites may
  580. choose to print mail on a printer and deliver the output to the
  581. addressee's desk.
  582. Normally, a mailbox is composed of two parts: (1) an optional display
  583. name that indicates the name of the recipient (which can be a person
  584. or a system) that could be displayed to the user of a mail
  585. application, and (2) an addr-spec address enclosed in angle brackets
  586. Resnick Standards Track [Page 16]
  587. RFC 5322 Internet Message Format October 2008
  588. ("<" and ">"). There is an alternate simple form of a mailbox where
  589. the addr-spec address appears alone, without the recipient's name or
  590. the angle brackets. The Internet addr-spec address is described in
  591. section 3.4.1.
  592. Note: Some legacy implementations used the simple form where the
  593. addr-spec appears without the angle brackets, but included the
  594. name of the recipient in parentheses as a comment following the
  595. addr-spec. Since the meaning of the information in a comment is
  596. unspecified, implementations SHOULD use the full name-addr form of
  597. the mailbox, instead of the legacy form, to specify the display
  598. name associated with a mailbox. Also, because some legacy
  599. implementations interpret the comment, comments generally SHOULD
  600. NOT be used in address fields to avoid confusing such
  601. implementations.
  602. When it is desirable to treat several mailboxes as a single unit
  603. (i.e., in a distribution list), the group construct can be used. The
  604. group construct allows the sender to indicate a named group of
  605. recipients. This is done by giving a display name for the group,
  606. followed by a colon, followed by a comma-separated list of any number
  607. of mailboxes (including zero and one), and ending with a semicolon.
  608. Because the list of mailboxes can be empty, using the group construct
  609. is also a simple way to communicate to recipients that the message
  610. was sent to one or more named sets of recipients, without actually
  611. providing the individual mailbox address for any of those recipients.
  612. 3.4.1. Addr-Spec Specification
  613. An addr-spec is a specific Internet identifier that contains a
  614. locally interpreted string followed by the at-sign character ("@",
  615. ASCII value 64) followed by an Internet domain. The locally
  616. interpreted string is either a quoted-string or a dot-atom. If the
  617. string can be represented as a dot-atom (that is, it contains no
  618. characters other than atext characters or "." surrounded by atext
  619. characters), then the dot-atom form SHOULD be used and the quoted-
  620. string form SHOULD NOT be used. Comments and folding white space
  621. SHOULD NOT be used around the "@" in the addr-spec.
  622. Note: A liberal syntax for the domain portion of addr-spec is
  623. given here. However, the domain portion contains addressing
  624. information specified by and used in other protocols (e.g.,
  625. [RFC1034], [RFC1035], [RFC1123], [RFC5321]). It is therefore
  626. incumbent upon implementations to conform to the syntax of
  627. addresses for the context in which they are used.
  628. Resnick Standards Track [Page 17]
  629. RFC 5322 Internet Message Format October 2008
  630. addr-spec = local-part "@" domain
  631. local-part = dot-atom / quoted-string / obs-local-part
  632. domain = dot-atom / domain-literal / obs-domain
  633. domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
  634. dtext = %d33-90 / ; Printable US-ASCII
  635. %d94-126 / ; characters not including
  636. obs-dtext ; "[", "]", or "\"
  637. The domain portion identifies the point to which the mail is
  638. delivered. In the dot-atom form, this is interpreted as an Internet
  639. domain name (either a host name or a mail exchanger name) as
  640. described in [RFC1034], [RFC1035], and [RFC1123]. In the domain-
  641. literal form, the domain is interpreted as the literal Internet
  642. address of the particular host. In both cases, how addressing is
  643. used and how messages are transported to a particular host is covered
  644. in separate documents, such as [RFC5321]. These mechanisms are
  645. outside of the scope of this document.
  646. The local-part portion is a domain-dependent string. In addresses,
  647. it is simply interpreted on the particular host as a name of a
  648. particular mailbox.
  649. 3.5. Overall Message Syntax
  650. A message consists of header fields, optionally followed by a message
  651. body. Lines in a message MUST be a maximum of 998 characters
  652. excluding the CRLF, but it is RECOMMENDED that lines be limited to 78
  653. characters excluding the CRLF. (See section 2.1.1 for explanation.)
  654. In a message body, though all of the characters listed in the text
  655. rule MAY be used, the use of US-ASCII control characters (values 1
  656. through 8, 11, 12, and 14 through 31) is discouraged since their
  657. interpretation by receivers for display is not guaranteed.
  658. message = (fields / obs-fields)
  659. [CRLF body]
  660. body = (*(*998text CRLF) *998text) / obs-body
  661. text = %d1-9 / ; Characters excluding CR
  662. %d11 / ; and LF
  663. %d12 /
  664. %d14-127
  665. Resnick Standards Track [Page 18]
  666. RFC 5322 Internet Message Format October 2008
  667. The header fields carry most of the semantic information and are
  668. defined in section 3.6. The body is simply a series of lines of text
  669. that are uninterpreted for the purposes of this specification.
  670. 3.6. Field Definitions
  671. The header fields of a message are defined here. All header fields
  672. have the same general syntactic structure: a field name, followed by
  673. a colon, followed by the field body. The specific syntax for each
  674. header field is defined in the subsequent sections.
  675. Note: In the ABNF syntax for each field in subsequent sections,
  676. each field name is followed by the required colon. However, for
  677. brevity, sometimes the colon is not referred to in the textual
  678. description of the syntax. It is, nonetheless, required.
  679. It is important to note that the header fields are not guaranteed to
  680. be in a particular order. They may appear in any order, and they
  681. have been known to be reordered occasionally when transported over
  682. the Internet. However, for the purposes of this specification,
  683. header fields SHOULD NOT be reordered when a message is transported
  684. or transformed. More importantly, the trace header fields and resent
  685. header fields MUST NOT be reordered, and SHOULD be kept in blocks
  686. prepended to the message. See sections 3.6.6 and 3.6.7 for more
  687. information.
  688. The only required header fields are the origination date field and
  689. the originator address field(s). All other header fields are
  690. syntactically optional. More information is contained in the table
  691. following this definition.
  692. Resnick Standards Track [Page 19]
  693. RFC 5322 Internet Message Format October 2008
  694. fields = *(trace
  695. *optional-field /
  696. *(resent-date /
  697. resent-from /
  698. resent-sender /
  699. resent-to /
  700. resent-cc /
  701. resent-bcc /
  702. resent-msg-id))
  703. *(orig-date /
  704. from /
  705. sender /
  706. reply-to /
  707. to /
  708. cc /
  709. bcc /
  710. message-id /
  711. in-reply-to /
  712. references /
  713. subject /
  714. comments /
  715. keywords /
  716. optional-field)
  717. The following table indicates limits on the number of times each
  718. field may occur in the header section of a message as well as any
  719. special limitations on the use of those fields. An asterisk ("*")
  720. next to a value in the minimum or maximum column indicates that a
  721. special restriction appears in the Notes column.
  722. Resnick Standards Track [Page 20]
  723. RFC 5322 Internet Message Format October 2008
  724. +----------------+--------+------------+----------------------------+
  725. | Field | Min | Max number | Notes |
  726. | | number | | |
  727. +----------------+--------+------------+----------------------------+
  728. | trace | 0 | unlimited | Block prepended - see |
  729. | | | | 3.6.7 |
  730. | resent-date | 0* | unlimited* | One per block, required if |
  731. | | | | other resent fields are |
  732. | | | | present - see 3.6.6 |
  733. | resent-from | 0 | unlimited* | One per block - see 3.6.6 |
  734. | resent-sender | 0* | unlimited* | One per block, MUST occur |
  735. | | | | with multi-address |
  736. | | | | resent-from - see 3.6.6 |
  737. | resent-to | 0 | unlimited* | One per block - see 3.6.6 |
  738. | resent-cc | 0 | unlimited* | One per block - see 3.6.6 |
  739. | resent-bcc | 0 | unlimited* | One per block - see 3.6.6 |
  740. | resent-msg-id | 0 | unlimited* | One per block - see 3.6.6 |
  741. | orig-date | 1 | 1 | |
  742. | from | 1 | 1 | See sender and 3.6.2 |
  743. | sender | 0* | 1 | MUST occur with |
  744. | | | | multi-address from - see |
  745. | | | | 3.6.2 |
  746. | reply-to | 0 | 1 | |
  747. | to | 0 | 1 | |
  748. | cc | 0 | 1 | |
  749. | bcc | 0 | 1 | |
  750. | message-id | 0* | 1 | SHOULD be present - see |
  751. | | | | 3.6.4 |
  752. | in-reply-to | 0* | 1 | SHOULD occur in some |
  753. | | | | replies - see 3.6.4 |
  754. | references | 0* | 1 | SHOULD occur in some |
  755. | | | | replies - see 3.6.4 |
  756. | subject | 0 | 1 | |
  757. | comments | 0 | unlimited | |
  758. | keywords | 0 | unlimited | |
  759. | optional-field | 0 | unlimited | |
  760. +----------------+--------+------------+----------------------------+
  761. The exact interpretation of each field is described in subsequent
  762. sections.
  763. Resnick Standards Track [Page 21]
  764. RFC 5322 Internet Message Format October 2008
  765. 3.6.1. The Origination Date Field
  766. The origination date field consists of the field name "Date" followed
  767. by a date-time specification.
  768. orig-date = "Date:" date-time CRLF
  769. The origination date specifies the date and time at which the creator
  770. of the message indicated that the message was complete and ready to
  771. enter the mail delivery system. For instance, this might be the time
  772. that a user pushes the "send" or "submit" button in an application
  773. program. In any case, it is specifically not intended to convey the
  774. time that the message is actually transported, but rather the time at
  775. which the human or other creator of the message has put the message
  776. into its final form, ready for transport. (For example, a portable
  777. computer user who is not connected to a network might queue a message
  778. for delivery. The origination date is intended to contain the date
  779. and time that the user queued the message, not the time when the user
  780. connected to the network to send the message.)
  781. 3.6.2. Originator Fields
  782. The originator fields of a message consist of the from field, the
  783. sender field (when applicable), and optionally the reply-to field.
  784. The from field consists of the field name "From" and a comma-
  785. separated list of one or more mailbox specifications. If the from
  786. field contains more than one mailbox specification in the mailbox-
  787. list, then the sender field, containing the field name "Sender" and a
  788. single mailbox specification, MUST appear in the message. In either
  789. case, an optional reply-to field MAY also be included, which contains
  790. the field name "Reply-To" and a comma-separated list of one or more
  791. addresses.
  792. from = "From:" mailbox-list CRLF
  793. sender = "Sender:" mailbox CRLF
  794. reply-to = "Reply-To:" address-list CRLF
  795. The originator fields indicate the mailbox(es) of the source of the
  796. message. The "From:" field specifies the author(s) of the message,
  797. that is, the mailbox(es) of the person(s) or system(s) responsible
  798. for the writing of the message. The "Sender:" field specifies the
  799. mailbox of the agent responsible for the actual transmission of the
  800. message. For example, if a secretary were to send a message for
  801. another person, the mailbox of the secretary would appear in the
  802. "Sender:" field and the mailbox of the actual author would appear in
  803. the "From:" field. If the originator of the message can be indicated
  804. Resnick Standards Track [Page 22]
  805. RFC 5322 Internet Message Format October 2008
  806. by a single mailbox and the author and transmitter are identical, the
  807. "Sender:" field SHOULD NOT be used. Otherwise, both fields SHOULD
  808. appear.
  809. Note: The transmitter information is always present. The absence
  810. of the "Sender:" field is sometimes mistakenly taken to mean that
  811. the agent responsible for transmission of the message has not been
  812. specified. This absence merely means that the transmitter is
  813. identical to the author and is therefore not redundantly placed
  814. into the "Sender:" field.
  815. The originator fields also provide the information required when
  816. replying to a message. When the "Reply-To:" field is present, it
  817. indicates the address(es) to which the author of the message suggests
  818. that replies be sent. In the absence of the "Reply-To:" field,
  819. replies SHOULD by default be sent to the mailbox(es) specified in the
  820. "From:" field unless otherwise specified by the person composing the
  821. reply.
  822. In all cases, the "From:" field SHOULD NOT contain any mailbox that
  823. does not belong to the author(s) of the message. See also section
  824. 3.6.3 for more information on forming the destination addresses for a
  825. reply.
  826. 3.6.3. Destination Address Fields
  827. The destination fields of a message consist of three possible fields,
  828. each of the same form: the field name, which is either "To", "Cc", or
  829. "Bcc", followed by a comma-separated list of one or more addresses
  830. (either mailbox or group syntax).
  831. to = "To:" address-list CRLF
  832. cc = "Cc:" address-list CRLF
  833. bcc = "Bcc:" [address-list / CFWS] CRLF
  834. The destination fields specify the recipients of the message. Each
  835. destination field may have one or more addresses, and the addresses
  836. indicate the intended recipients of the message. The only difference
  837. between the three fields is how each is used.
  838. The "To:" field contains the address(es) of the primary recipient(s)
  839. of the message.
  840. Resnick Standards Track [Page 23]
  841. RFC 5322 Internet Message Format October 2008
  842. The "Cc:" field (where the "Cc" means "Carbon Copy" in the sense of
  843. making a copy on a typewriter using carbon paper) contains the
  844. addresses of others who are to receive the message, though the
  845. content of the message may not be directed at them.
  846. The "Bcc:" field (where the "Bcc" means "Blind Carbon Copy") contains
  847. addresses of recipients of the message whose addresses are not to be
  848. revealed to other recipients of the message. There are three ways in
  849. which the "Bcc:" field is used. In the first case, when a message
  850. containing a "Bcc:" field is prepared to be sent, the "Bcc:" line is
  851. removed even though all of the recipients (including those specified
  852. in the "Bcc:" field) are sent a copy of the message. In the second
  853. case, recipients specified in the "To:" and "Cc:" lines each are sent
  854. a copy of the message with the "Bcc:" line removed as above, but the
  855. recipients on the "Bcc:" line get a separate copy of the message
  856. containing a "Bcc:" line. (When there are multiple recipient
  857. addresses in the "Bcc:" field, some implementations actually send a
  858. separate copy of the message to each recipient with a "Bcc:"
  859. containing only the address of that particular recipient.) Finally,
  860. since a "Bcc:" field may contain no addresses, a "Bcc:" field can be
  861. sent without any addresses indicating to the recipients that blind
  862. copies were sent to someone. Which method to use with "Bcc:" fields
  863. is implementation dependent, but refer to the "Security
  864. Considerations" section of this document for a discussion of each.
  865. When a message is a reply to another message, the mailboxes of the
  866. authors of the original message (the mailboxes in the "From:" field)
  867. or mailboxes specified in the "Reply-To:" field (if it exists) MAY
  868. appear in the "To:" field of the reply since these would normally be
  869. the primary recipients of the reply. If a reply is sent to a message
  870. that has destination fields, it is often desirable to send a copy of
  871. the reply to all of the recipients of the message, in addition to the
  872. author. When such a reply is formed, addresses in the "To:" and
  873. "Cc:" fields of the original message MAY appear in the "Cc:" field of
  874. the reply, since these are normally secondary recipients of the
  875. reply. If a "Bcc:" field is present in the original message,
  876. addresses in that field MAY appear in the "Bcc:" field of the reply,
  877. but they SHOULD NOT appear in the "To:" or "Cc:" fields.
  878. Note: Some mail applications have automatic reply commands that
  879. include the destination addresses of the original message in the
  880. destination addresses of the reply. How those reply commands
  881. behave is implementation dependent and is beyond the scope of this
  882. document. In particular, whether or not to include the original
  883. destination addresses when the original message had a "Reply-To:"
  884. field is not addressed here.
  885. Resnick Standards Track [Page 24]
  886. RFC 5322 Internet Message Format October 2008
  887. 3.6.4. Identification Fields
  888. Though listed as optional in the table in section 3.6, every message
  889. SHOULD have a "Message-ID:" field. Furthermore, reply messages
  890. SHOULD have "In-Reply-To:" and "References:" fields as appropriate
  891. and as described below.
  892. The "Message-ID:" field contains a single unique message identifier.
  893. The "References:" and "In-Reply-To:" fields each contain one or more
  894. unique message identifiers, optionally separated by CFWS.
  895. The message identifier (msg-id) syntax is a limited version of the
  896. addr-spec construct enclosed in the angle bracket characters, "<" and
  897. ">". Unlike addr-spec, this syntax only permits the dot-atom-text
  898. form on the left-hand side of the "@" and does not have internal CFWS
  899. anywhere in the message identifier.
  900. Note: As with addr-spec, a liberal syntax is given for the right-
  901. hand side of the "@" in a msg-id. However, later in this section,
  902. the use of a domain for the right-hand side of the "@" is
  903. RECOMMENDED. Again, the syntax of domain constructs is specified
  904. by and used in other protocols (e.g., [RFC1034], [RFC1035],
  905. [RFC1123], [RFC5321]). It is therefore incumbent upon
  906. implementations to conform to the syntax of addresses for the
  907. context in which they are used.
  908. message-id = "Message-ID:" msg-id CRLF
  909. in-reply-to = "In-Reply-To:" 1*msg-id CRLF
  910. references = "References:" 1*msg-id CRLF
  911. msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS]
  912. id-left = dot-atom-text / obs-id-left
  913. id-right = dot-atom-text / no-fold-literal / obs-id-right
  914. no-fold-literal = "[" *dtext "]"
  915. The "Message-ID:" field provides a unique message identifier that
  916. refers to a particular version of a particular message. The
  917. uniqueness of the message identifier is guaranteed by the host that
  918. generates it (see below). This message identifier is intended to be
  919. machine readable and not necessarily meaningful to humans. A message
  920. identifier pertains to exactly one version of a particular message;
  921. subsequent revisions to the message each receive new message
  922. identifiers.
  923. Resnick Standards Track [Page 25]
  924. RFC 5322 Internet Message Format October 2008
  925. Note: There are many instances when messages are "changed", but
  926. those changes do not constitute a new instantiation of that
  927. message, and therefore the message would not get a new message
  928. identifier. For example, when messages are introduced into the
  929. transport system, they are often prepended with additional header
  930. fields such as trace fields (described in section 3.6.7) and
  931. resent fields (described in section 3.6.6). The addition of such
  932. header fields does not change the identity of the message and
  933. therefore the original "Message-ID:" field is retained. In all
  934. cases, it is the meaning that the sender of the message wishes to
  935. convey (i.e., whether this is the same message or a different
  936. message) that determines whether or not the "Message-ID:" field
  937. changes, not any particular syntactic difference that appears (or
  938. does not appear) in the message.
  939. The "In-Reply-To:" and "References:" fields are used when creating a
  940. reply to a message. They hold the message identifier of the original
  941. message and the message identifiers of other messages (for example,
  942. in the case of a reply to a message that was itself a reply). The
  943. "In-Reply-To:" field may be used to identify the message (or
  944. messages) to which the new message is a reply, while the
  945. "References:" field may be used to identify a "thread" of
  946. conversation.
  947. When creating a reply to a message, the "In-Reply-To:" and
  948. "References:" fields of the resultant message are constructed as
  949. follows:
  950. The "In-Reply-To:" field will contain the contents of the
  951. "Message-ID:" field of the message to which this one is a reply (the
  952. "parent message"). If there is more than one parent message, then
  953. the "In-Reply-To:" field will contain the contents of all of the
  954. parents' "Message-ID:" fields. If there is no "Message-ID:" field in
  955. any of the parent messages, then the new message will have no "In-
  956. Reply-To:" field.
  957. The "References:" field will contain the contents of the parent's
  958. "References:" field (if any) followed by the contents of the parent's
  959. "Message-ID:" field (if any). If the parent message does not contain
  960. a "References:" field but does have an "In-Reply-To:" field
  961. containing a single message identifier, then the "References:" field
  962. will contain the contents of the parent's "In-Reply-To:" field
  963. followed by the contents of the parent's "Message-ID:" field (if
  964. any). If the parent has none of the "References:", "In-Reply-To:",
  965. or "Message-ID:" fields, then the new message will have no
  966. "References:" field.
  967. Resnick Standards Track [Page 26]
  968. RFC 5322 Internet Message Format October 2008
  969. Note: Some implementations parse the "References:" field to
  970. display the "thread of the discussion". These implementations
  971. assume that each new message is a reply to a single parent and
  972. hence that they can walk backwards through the "References:" field
  973. to find the parent of each message listed there. Therefore,
  974. trying to form a "References:" field for a reply that has multiple
  975. parents is discouraged; how to do so is not defined in this
  976. document.
  977. The message identifier (msg-id) itself MUST be a globally unique
  978. identifier for a message. The generator of the message identifier
  979. MUST guarantee that the msg-id is unique. There are several
  980. algorithms that can be used to accomplish this. Since the msg-id has
  981. a similar syntax to addr-spec (identical except that quoted strings,
  982. comments, and folding white space are not allowed), a good method is
  983. to put the domain name (or a domain literal IP address) of the host
  984. on which the message identifier was created on the right-hand side of
  985. the "@" (since domain names and IP addresses are normally unique),
  986. and put a combination of the current absolute date and time along
  987. with some other currently unique (perhaps sequential) identifier
  988. available on the system (for example, a process id number) on the
  989. left-hand side. Though other algorithms will work, it is RECOMMENDED
  990. that the right-hand side contain some domain identifier (either of
  991. the host itself or otherwise) such that the generator of the message
  992. identifier can guarantee the uniqueness of the left-hand side within
  993. the scope of that domain.
  994. Semantically, the angle bracket characters are not part of the
  995. msg-id; the msg-id is what is contained between the two angle bracket
  996. characters.
  997. 3.6.5. Informational Fields
  998. The informational fields are all optional. The "Subject:" and
  999. "Comments:" fields are unstructured fields as defined in section
  1000. 2.2.1, and therefore may contain text or folding white space. The
  1001. "Keywords:" field contains a comma-separated list of one or more
  1002. words or quoted-strings.
  1003. subject = "Subject:" unstructured CRLF
  1004. comments = "Comments:" unstructured CRLF
  1005. keywords = "Keywords:" phrase *("," phrase) CRLF
  1006. These three fields are intended to have only human-readable content
  1007. with information about the message. The "Subject:" field is the most
  1008. common and contains a short string identifying the topic of the
  1009. Resnick Standards Track [Page 27]
  1010. RFC 5322 Internet Message Format October 2008
  1011. message. When used in a reply, the field body MAY start with the
  1012. string "Re: " (an abbreviation of the Latin "in re", meaning "in the
  1013. matter of") followed by the contents of the "Subject:" field body of
  1014. the original message. If this is done, only one instance of the
  1015. literal string "Re: " ought to be used since use of other strings or
  1016. more than one instance can lead to undesirable consequences. The
  1017. "Comments:" field contains any additional comments on the text of the
  1018. body of the message. The "Keywords:" field contains a comma-
  1019. separated list of important words and phrases that might be useful
  1020. for the recipient.
  1021. 3.6.6. Resent Fields
  1022. Resent fields SHOULD be added to any message that is reintroduced by
  1023. a user into the transport system. A separate set of resent fields
  1024. SHOULD be added each time this is done. All of the resent fields
  1025. corresponding to a particular resending of the message SHOULD be
  1026. grouped together. Each new set of resent fields is prepended to the
  1027. message; that is, the most recent set of resent fields appears
  1028. earlier in the message. No other fields in the message are changed
  1029. when resent fields are added.
  1030. Each of the resent fields corresponds to a particular field elsewhere
  1031. in the syntax. For instance, the "Resent-Date:" field corresponds to
  1032. the "Date:" field and the "Resent-To:" field corresponds to the "To:"
  1033. field. In each case, the syntax for the field body is identical to
  1034. the syntax given previously for the corresponding field.
  1035. When resent fields are used, the "Resent-From:" and "Resent-Date:"
  1036. fields MUST be sent. The "Resent-Message-ID:" field SHOULD be sent.
  1037. "Resent-Sender:" SHOULD NOT be used if "Resent-Sender:" would be
  1038. identical to "Resent-From:".
  1039. resent-date = "Resent-Date:" date-time CRLF
  1040. resent-from = "Resent-From:" mailbox-list CRLF
  1041. resent-sender = "Resent-Sender:" mailbox CRLF
  1042. resent-to = "Resent-To:" address-list CRLF
  1043. resent-cc = "Resent-Cc:" address-list CRLF
  1044. resent-bcc = "Resent-Bcc:" [address-list / CFWS] CRLF
  1045. resent-msg-id = "Resent-Message-ID:" msg-id CRLF
  1046. Resnick Standards Track [Page 28]
  1047. RFC 5322 Internet Message Format October 2008
  1048. Resent fields are used to identify a message as having been
  1049. reintroduced into the transport system by a user. The purpose of
  1050. using resent fields is to have the message appear to the final
  1051. recipient as if it were sent directly by the original sender, with
  1052. all of the original fields remaining the same. Each set of resent
  1053. fields correspond to a particular resending event. That is, if a
  1054. message is resent multiple times, each set of resent fields gives
  1055. identifying information for each individual time. Resent fields are
  1056. strictly informational. They MUST NOT be used in the normal
  1057. processing of replies or other such automatic actions on messages.
  1058. Note: Reintroducing a message into the transport system and using
  1059. resent fields is a different operation from "forwarding".
  1060. "Forwarding" has two meanings: One sense of forwarding is that a
  1061. mail reading program can be told by a user to forward a copy of a
  1062. message to another person, making the forwarded message the body
  1063. of the new message. A forwarded message in this sense does not
  1064. appear to have come from the original sender, but is an entirely
  1065. new message from the forwarder of the message. Forwarding may
  1066. also mean that a mail transport program gets a message and
  1067. forwards it on to a different destination for final delivery.
  1068. Resent header fields are not intended for use with either type of
  1069. forwarding.
  1070. The resent originator fields indicate the mailbox of the person(s) or
  1071. system(s) that resent the message. As with the regular originator
  1072. fields, there are two forms: a simple "Resent-From:" form, which
  1073. contains the mailbox of the individual doing the resending, and the
  1074. more complex form, when one individual (identified in the "Resent-
  1075. Sender:" field) resends a message on behalf of one or more others
  1076. (identified in the "Resent-From:" field).
  1077. Note: When replying to a resent message, replies behave just as
  1078. they would with any other message, using the original "From:",
  1079. "Reply-To:", "Message-ID:", and other fields. The resent fields
  1080. are only informational and MUST NOT be used in the normal
  1081. processing of replies.
  1082. The "Resent-Date:" indicates the date and time at which the resent
  1083. message is dispatched by the resender of the message. Like the
  1084. "Date:" field, it is not the date and time that the message was
  1085. actually transported.
  1086. The "Resent-To:", "Resent-Cc:", and "Resent-Bcc:" fields function
  1087. identically to the "To:", "Cc:", and "Bcc:" fields, respectively,
  1088. except that they indicate the recipients of the resent message, not
  1089. the recipients of the original message.
  1090. Resnick Standards Track [Page 29]
  1091. RFC 5322 Internet Message Format October 2008
  1092. The "Resent-Message-ID:" field provides a unique identifier for the
  1093. resent message.
  1094. 3.6.7. Trace Fields
  1095. The trace fields are a group of header fields consisting of an
  1096. optional "Return-Path:" field, and one or more "Received:" fields.
  1097. The "Return-Path:" header field contains a pair of angle brackets
  1098. that enclose an optional addr-spec. The "Received:" field contains a
  1099. (possibly empty) list of tokens followed by a semicolon and a date-
  1100. time specification. Each token must be a word, angle-addr, addr-
  1101. spec, or a domain. Further restrictions are applied to the syntax of
  1102. the trace fields by specifications that provide for their use, such
  1103. as [RFC5321].
  1104. trace = [return]
  1105. 1*received
  1106. return = "Return-Path:" path CRLF
  1107. path = angle-addr / ([CFWS] "<" [CFWS] ">" [CFWS])
  1108. received = "Received:" *received-token ";" date-time CRLF
  1109. received-token = word / angle-addr / addr-spec / domain
  1110. A full discussion of the Internet mail use of trace fields is
  1111. contained in [RFC5321]. For the purposes of this specification, the
  1112. trace fields are strictly informational, and any formal
  1113. interpretation of them is outside of the scope of this document.
  1114. 3.6.8. Optional Fields
  1115. Fields may appear in messages that are otherwise unspecified in this
  1116. document. They MUST conform to the syntax of an optional-field.
  1117. This is a field name, made up of the printable US-ASCII characters
  1118. except SP and colon, followed by a colon, followed by any text that
  1119. conforms to the unstructured syntax.
  1120. The field names of any optional field MUST NOT be identical to any
  1121. field name specified elsewhere in this document.
  1122. Resnick Standards Track [Page 30]
  1123. RFC 5322 Internet Message Format October 2008
  1124. optional-field = field-name ":" unstructured CRLF
  1125. field-name = 1*ftext
  1126. ftext = %d33-57 / ; Printable US-ASCII
  1127. %d59-126 ; characters not including
  1128. ; ":".
  1129. For the purposes of this specification, any optional field is
  1130. uninterpreted.
  1131. 4. Obsolete Syntax
  1132. Earlier versions of this specification allowed for different (usually
  1133. more liberal) syntax than is allowed in this version. Also, there
  1134. have been syntactic elements used in messages on the Internet whose
  1135. interpretations have never been documented. Though these syntactic
  1136. forms MUST NOT be generated according to the grammar in section 3,
  1137. they MUST be accepted and parsed by a conformant receiver. This
  1138. section documents many of these syntactic elements. Taking the
  1139. grammar in section 3 and adding the definitions presented in this
  1140. section will result in the grammar to use for the interpretation of
  1141. messages.
  1142. Note: This section identifies syntactic forms that any
  1143. implementation MUST reasonably interpret. However, there are
  1144. certainly Internet messages that do not conform to even the
  1145. additional syntax given in this section. The fact that a
  1146. particular form does not appear in any section of this document is
  1147. not justification for computer programs to crash or for malformed
  1148. data to be irretrievably lost by any implementation. It is up to
  1149. the implementation to deal with messages robustly.
  1150. One important difference between the obsolete (interpreting) and the
  1151. current (generating) syntax is that in structured header field bodies
  1152. (i.e., between the colon and the CRLF of any structured header
  1153. field), white space characters, including folding white space, and
  1154. comments could be freely inserted between any syntactic tokens. This
  1155. allowed many complex forms that have proven difficult for some
  1156. implementations to parse.
  1157. Another key difference between the obsolete and the current syntax is
  1158. that the rule in section 3.2.2 regarding lines composed entirely of
  1159. white space in comments and folding white space does not apply. See
  1160. the discussion of folding white space in section 4.2 below.
  1161. Finally, certain characters that were formerly allowed in messages
  1162. appear in this section. The NUL character (ASCII value 0) was once
  1163. Resnick Standards Track [Page 31]
  1164. RFC 5322 Internet Message Format October 2008
  1165. allowed, but is no longer for compatibility reasons. Similarly, US-
  1166. ASCII control characters other than CR, LF, SP, and HTAB (ASCII
  1167. values 1 through 8, 11, 12, 14 through 31, and 127) were allowed to
  1168. appear in header field bodies. CR and LF were allowed to appear in
  1169. messages other than as CRLF; this use is also shown here.
  1170. Other differences in syntax and semantics are noted in the following
  1171. sections.
  1172. 4.1. Miscellaneous Obsolete Tokens
  1173. These syntactic elements are used elsewhere in the obsolete syntax or
  1174. in the main syntax. Bare CR, bare LF, and NUL are added to obs-qp,
  1175. obs-body, and obs-unstruct. US-ASCII control characters are added to
  1176. obs-qp, obs-unstruct, obs-ctext, and obs-qtext. The period character
  1177. is added to obs-phrase. The obs-phrase-list provides for a
  1178. (potentially empty) comma-separated list of phrases that may include
  1179. "null" elements. That is, there could be two or more commas in such
  1180. a list with nothing in between them, or commas at the beginning or
  1181. end of the list.
  1182. Note: The "period" (or "full stop") character (".") in obs-phrase
  1183. is not a form that was allowed in earlier versions of this or any
  1184. other specification. Period (nor any other character from
  1185. specials) was not allowed in phrase because it introduced a
  1186. parsing difficulty distinguishing between phrases and portions of
  1187. an addr-spec (see section 4.4). It appears here because the
  1188. period character is currently used in many messages in the
  1189. display-name portion of addresses, especially for initials in
  1190. names, and therefore must be interpreted properly.
  1191. obs-NO-WS-CTL = %d1-8 / ; US-ASCII control
  1192. %d11 / ; characters that do not
  1193. %d12 / ; include the carriage
  1194. %d14-31 / ; return, line feed, and
  1195. %d127 ; white space characters
  1196. obs-ctext = obs-NO-WS-CTL
  1197. obs-qtext = obs-NO-WS-CTL
  1198. obs-utext = %d0 / obs-NO-WS-CTL / VCHAR
  1199. obs-qp = "\" (%d0 / obs-NO-WS-CTL / LF / CR)
  1200. obs-body = *((*LF *CR *((%d0 / text) *LF *CR)) / CRLF)
  1201. obs-unstruct = *((*LF *CR *(obs-utext *LF *CR)) / FWS)
  1202. Resnick Standards Track [Page 32]
  1203. RFC 5322 Internet Message Format October 2008
  1204. obs-phrase = word *(word / "." / CFWS)
  1205. obs-phrase-list = [phrase / CFWS] *("," [phrase / CFWS])
  1206. Bare CR and bare LF appear in messages with two different meanings.
  1207. In many cases, bare CR or bare LF are used improperly instead of CRLF
  1208. to indicate line separators. In other cases, bare CR and bare LF are
  1209. used simply as US-ASCII control characters with their traditional
  1210. ASCII meanings.
  1211. 4.2. Obsolete Folding White Space
  1212. In the obsolete syntax, any amount of folding white space MAY be
  1213. inserted where the obs-FWS rule is allowed. This creates the
  1214. possibility of having two consecutive "folds" in a line, and
  1215. therefore the possibility that a line which makes up a folded header
  1216. field could be composed entirely of white space.
  1217. obs-FWS = 1*WSP *(CRLF 1*WSP)
  1218. 4.3. Obsolete Date and Time
  1219. The syntax for the obsolete date format allows a 2 digit year in the
  1220. date field and allows for a list of alphabetic time zone specifiers
  1221. that were used in earlier versions of this specification. It also
  1222. permits comments and folding white space between many of the tokens.
  1223. obs-day-of-week = [CFWS] day-name [CFWS]
  1224. obs-day = [CFWS] 1*2DIGIT [CFWS]
  1225. obs-year = [CFWS] 2*DIGIT [CFWS]
  1226. obs-hour = [CFWS] 2DIGIT [CFWS]
  1227. obs-minute = [CFWS] 2DIGIT [CFWS]
  1228. obs-second = [CFWS] 2DIGIT [CFWS]
  1229. obs-zone = "UT" / "GMT" / ; Universal Time
  1230. ; North American UT
  1231. ; offsets
  1232. "EST" / "EDT" / ; Eastern: - 5/ - 4
  1233. "CST" / "CDT" / ; Central: - 6/ - 5
  1234. "MST" / "MDT" / ; Mountain: - 7/ - 6
  1235. "PST" / "PDT" / ; Pacific: - 8/ - 7
  1236. ;
  1237. Resnick Standards Track [Page 33]
  1238. RFC 5322 Internet Message Format October 2008
  1239. %d65-73 / ; Military zones - "A"
  1240. %d75-90 / ; through "I" and "K"
  1241. %d97-105 / ; through "Z", both
  1242. %d107-122 ; upper and lower case
  1243. Where a two or three digit year occurs in a date, the year is to be
  1244. interpreted as follows: If a two digit year is encountered whose
  1245. value is between 00 and 49, the year is interpreted by adding 2000,
  1246. ending up with a value between 2000 and 2049. If a two digit year is
  1247. encountered with a value between 50 and 99, or any three digit year
  1248. is encountered, the year is interpreted by adding 1900.
  1249. In the obsolete time zone, "UT" and "GMT" are indications of
  1250. "Universal Time" and "Greenwich Mean Time", respectively, and are
  1251. both semantically identical to "+0000".
  1252. The remaining three character zones are the US time zones. The first
  1253. letter, "E", "C", "M", or "P" stands for "Eastern", "Central",
  1254. "Mountain", and "Pacific". The second letter is either "S" for
  1255. "Standard" time, or "D" for "Daylight Savings" (or summer) time.
  1256. Their interpretations are as follows:
  1257. EDT is semantically equivalent to -0400
  1258. EST is semantically equivalent to -0500
  1259. CDT is semantically equivalent to -0500
  1260. CST is semantically equivalent to -0600
  1261. MDT is semantically equivalent to -0600
  1262. MST is semantically equivalent to -0700
  1263. PDT is semantically equivalent to -0700
  1264. PST is semantically equivalent to -0800
  1265. The 1 character military time zones were defined in a non-standard
  1266. way in [RFC0822] and are therefore unpredictable in their meaning.
  1267. The original definitions of the military zones "A" through "I" are
  1268. equivalent to "+0100" through "+0900", respectively; "K", "L", and
  1269. "M" are equivalent to "+1000", "+1100", and "+1200", respectively;
  1270. "N" through "Y" are equivalent to "-0100" through "-1200".
  1271. respectively; and "Z" is equivalent to "+0000". However, because of
  1272. the error in [RFC0822], they SHOULD all be considered equivalent to
  1273. "-0000" unless there is out-of-band information confirming their
  1274. meaning.
  1275. Other multi-character (usually between 3 and 5) alphabetic time zones
  1276. have been used in Internet messages. Any such time zone whose
  1277. meaning is not known SHOULD be considered equivalent to "-0000"
  1278. unless there is out-of-band information confirming their meaning.
  1279. Resnick Standards Track [Page 34]
  1280. RFC 5322 Internet Message Format October 2008
  1281. 4.4. Obsolete Addressing
  1282. There are four primary differences in addressing. First, mailbox
  1283. addresses were allowed to have a route portion before the addr-spec
  1284. when enclosed in "<" and ">". The route is simply a comma-separated
  1285. list of domain names, each preceded by "@", and the list terminated
  1286. by a colon. Second, CFWS were allowed between the period-separated
  1287. elements of local-part and domain (i.e., dot-atom was not used). In
  1288. addition, local-part is allowed to contain quoted-string in addition
  1289. to just atom. Third, mailbox-list and address-list were allowed to
  1290. have "null" members. That is, there could be two or more commas in
  1291. such a list with nothing in between them, or commas at the beginning
  1292. or end of the list. Finally, US-ASCII control characters and quoted-
  1293. pairs were allowed in domain literals and are added here.
  1294. obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS]
  1295. obs-route = obs-domain-list ":"
  1296. obs-domain-list = *(CFWS / ",") "@" domain
  1297. *("," [CFWS] ["@" domain])
  1298. obs-mbox-list = *([CFWS] ",") mailbox *("," [mailbox / CFWS])
  1299. obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])
  1300. obs-group-list = 1*([CFWS] ",") [CFWS]
  1301. obs-local-part = word *("." word)
  1302. obs-domain = atom *("." atom)
  1303. obs-dtext = obs-NO-WS-CTL / quoted-pair
  1304. When interpreting addresses, the route portion SHOULD be ignored.
  1305. 4.5. Obsolete Header Fields
  1306. Syntactically, the primary difference in the obsolete field syntax is
  1307. that it allows multiple occurrences of any of the fields and they may
  1308. occur in any order. Also, any amount of white space is allowed
  1309. before the ":" at the end of the field name.
  1310. Resnick Standards Track [Page 35]
  1311. RFC 5322 Internet Message Format October 2008
  1312. obs-fields = *(obs-return /
  1313. obs-received /
  1314. obs-orig-date /
  1315. obs-from /
  1316. obs-sender /
  1317. obs-reply-to /
  1318. obs-to /
  1319. obs-cc /
  1320. obs-bcc /
  1321. obs-message-id /
  1322. obs-in-reply-to /
  1323. obs-references /
  1324. obs-subject /
  1325. obs-comments /
  1326. obs-keywords /
  1327. obs-resent-date /
  1328. obs-resent-from /
  1329. obs-resent-send /
  1330. obs-resent-rply /
  1331. obs-resent-to /
  1332. obs-resent-cc /
  1333. obs-resent-bcc /
  1334. obs-resent-mid /
  1335. obs-optional)
  1336. Except for destination address fields (described in section 4.5.3),
  1337. the interpretation of multiple occurrences of fields is unspecified.
  1338. Also, the interpretation of trace fields and resent fields that do
  1339. not occur in blocks prepended to the message is unspecified as well.
  1340. Unless otherwise noted in the following sections, interpretation of
  1341. other fields is identical to the interpretation of their non-obsolete
  1342. counterparts in section 3.
  1343. 4.5.1. Obsolete Origination Date Field
  1344. obs-orig-date = "Date" *WSP ":" date-time CRLF
  1345. 4.5.2. Obsolete Originator Fields
  1346. obs-from = "From" *WSP ":" mailbox-list CRLF
  1347. obs-sender = "Sender" *WSP ":" mailbox CRLF
  1348. obs-reply-to = "Reply-To" *WSP ":" address-list CRLF
  1349. Resnick Standards Track [Page 36]
  1350. RFC 5322 Internet Message Format October 2008
  1351. 4.5.3. Obsolete Destination Address Fields
  1352. obs-to = "To" *WSP ":" address-list CRLF
  1353. obs-cc = "Cc" *WSP ":" address-list CRLF
  1354. obs-bcc = "Bcc" *WSP ":"
  1355. (address-list / (*([CFWS] ",") [CFWS])) CRLF
  1356. When multiple occurrences of destination address fields occur in a
  1357. message, they SHOULD be treated as if the address list in the first
  1358. occurrence of the field is combined with the address lists of the
  1359. subsequent occurrences by adding a comma and concatenating.
  1360. 4.5.4. Obsolete Identification Fields
  1361. The obsolete "In-Reply-To:" and "References:" fields differ from the
  1362. current syntax in that they allow phrase (words or quoted strings) to
  1363. appear. The obsolete forms of the left and right sides of msg-id
  1364. allow interspersed CFWS, making them syntactically identical to
  1365. local-part and domain, respectively.
  1366. obs-message-id = "Message-ID" *WSP ":" msg-id CRLF
  1367. obs-in-reply-to = "In-Reply-To" *WSP ":" *(phrase / msg-id) CRLF
  1368. obs-references = "References" *WSP ":" *(phrase / msg-id) CRLF
  1369. obs-id-left = local-part
  1370. obs-id-right = domain
  1371. For purposes of interpretation, the phrases in the "In-Reply-To:" and
  1372. "References:" fields are ignored.
  1373. Semantically, none of the optional CFWS in the local-part and the
  1374. domain is part of the obs-id-left and obs-id-right, respectively.
  1375. 4.5.5. Obsolete Informational Fields
  1376. obs-subject = "Subject" *WSP ":" unstructured CRLF
  1377. obs-comments = "Comments" *WSP ":" unstructured CRLF
  1378. obs-keywords = "Keywords" *WSP ":" obs-phrase-list CRLF
  1379. Resnick Standards Track [Page 37]
  1380. RFC 5322 Internet Message Format October 2008
  1381. 4.5.6. Obsolete Resent Fields
  1382. The obsolete syntax adds a "Resent-Reply-To:" field, which consists
  1383. of the field name, the optional comments and folding white space, the
  1384. colon, and a comma separated list of addresses.
  1385. obs-resent-from = "Resent-From" *WSP ":" mailbox-list CRLF
  1386. obs-resent-send = "Resent-Sender" *WSP ":" mailbox CRLF
  1387. obs-resent-date = "Resent-Date" *WSP ":" date-time CRLF
  1388. obs-resent-to = "Resent-To" *WSP ":" address-list CRLF
  1389. obs-resent-cc = "Resent-Cc" *WSP ":" address-list CRLF
  1390. obs-resent-bcc = "Resent-Bcc" *WSP ":"
  1391. (address-list / (*([CFWS] ",") [CFWS])) CRLF
  1392. obs-resent-mid = "Resent-Message-ID" *WSP ":" msg-id CRLF
  1393. obs-resent-rply = "Resent-Reply-To" *WSP ":" address-list CRLF
  1394. As with other resent fields, the "Resent-Reply-To:" field is to be
  1395. treated as trace information only.
  1396. 4.5.7. Obsolete Trace Fields
  1397. The obs-return and obs-received are again given here as template
  1398. definitions, just as return and received are in section 3. Their
  1399. full syntax is given in [RFC5321].
  1400. obs-return = "Return-Path" *WSP ":" path CRLF
  1401. obs-received = "Received" *WSP ":" *received-token CRLF
  1402. 4.5.8. Obsolete optional fields
  1403. obs-optional = field-name *WSP ":" unstructured CRLF
  1404. 5. Security Considerations
  1405. Care needs to be taken when displaying messages on a terminal or
  1406. terminal emulator. Powerful terminals may act on escape sequences
  1407. and other combinations of US-ASCII control characters with a variety
  1408. of consequences. They can remap the keyboard or permit other
  1409. modifications to the terminal that could lead to denial of service or
  1410. even damaged data. They can trigger (sometimes programmable)
  1411. Resnick Standards Track [Page 38]
  1412. RFC 5322 Internet Message Format October 2008
  1413. answerback messages that can allow a message to cause commands to be
  1414. issued on the recipient's behalf. They can also affect the operation
  1415. of terminal attached devices such as printers. Message viewers may
  1416. wish to strip potentially dangerous terminal escape sequences from
  1417. the message prior to display. However, other escape sequences appear
  1418. in messages for useful purposes (cf. [ISO.2022.1994], [RFC2045],
  1419. [RFC2046], [RFC2047], [RFC2049], [RFC4288], [RFC4289]) and therefore
  1420. should not be stripped indiscriminately.
  1421. Transmission of non-text objects in messages raises additional
  1422. security issues. These issues are discussed in [RFC2045], [RFC2046],
  1423. [RFC2047], [RFC2049], [RFC4288], and [RFC4289].
  1424. Many implementations use the "Bcc:" (blind carbon copy) field,
  1425. described in section 3.6.3, to facilitate sending messages to
  1426. recipients without revealing the addresses of one or more of the
  1427. addressees to the other recipients. Mishandling this use of "Bcc:"
  1428. may disclose confidential information that could eventually lead to
  1429. security problems through knowledge of even the existence of a
  1430. particular mail address. For example, if using the first method
  1431. described in section 3.6.3, where the "Bcc:" line is removed from the
  1432. message, blind recipients have no explicit indication that they have
  1433. been sent a blind copy, except insofar as their address does not
  1434. appear in the header section of a message. Because of this, one of
  1435. the blind addressees could potentially send a reply to all of the
  1436. shown recipients and accidentally reveal that the message went to the
  1437. blind recipient. When the second method from section 3.6.3 is used,
  1438. the blind recipient's address appears in the "Bcc:" field of a
  1439. separate copy of the message. If the "Bcc:" field sent contains all
  1440. of the blind addressees, all of the "Bcc:" recipients will be seen by
  1441. each "Bcc:" recipient. Even if a separate message is sent to each
  1442. "Bcc:" recipient with only the individual's address, implementations
  1443. still need to be careful to process replies to the message as per
  1444. section 3.6.3 so as not to accidentally reveal the blind recipient to
  1445. other recipients.
  1446. 6. IANA Considerations
  1447. This document updates the registrations that appeared in [RFC4021]
  1448. that referred to the definitions in [RFC2822]. IANA has updated the
  1449. Permanent Message Header Field Repository with the following header
  1450. fields, in accordance with the procedures set out in [RFC3864].
  1451. Header field name: Date
  1452. Applicable protocol: Mail
  1453. Status: standard
  1454. Author/Change controller: IETF
  1455. Specification document(s): This document (section 3.6.1)
  1456. Resnick Standards Track [Page 39]
  1457. RFC 5322 Internet Message Format October 2008
  1458. Header field name: From
  1459. Applicable protocol: Mail
  1460. Status: standard
  1461. Author/Change controller: IETF
  1462. Specification document(s): This document (section 3.6.2)
  1463. Header field name: Sender
  1464. Applicable protocol: Mail
  1465. Status: standard
  1466. Author/Change controller: IETF
  1467. Specification document(s): This document (section 3.6.2)
  1468. Header field name: Reply-To
  1469. Applicable protocol: Mail
  1470. Status: standard
  1471. Author/Change controller: IETF
  1472. Specification document(s): This document (section 3.6.2)
  1473. Header field name: To
  1474. Applicable protocol: Mail
  1475. Status: standard
  1476. Author/Change controller: IETF
  1477. Specification document(s): This document (section 3.6.3)
  1478. Header field name: Cc
  1479. Applicable protocol: Mail
  1480. Status: standard
  1481. Author/Change controller: IETF
  1482. Specification document(s): This document (section 3.6.3)
  1483. Header field name: Bcc
  1484. Applicable protocol: Mail
  1485. Status: standard
  1486. Author/Change controller: IETF
  1487. Specification document(s): This document (section 3.6.3)
  1488. Header field name: Message-ID
  1489. Applicable protocol: Mail
  1490. Status: standard
  1491. Author/Change controller: IETF
  1492. Specification document(s): This document (section 3.6.4)
  1493. Header field name: In-Reply-To
  1494. Applicable protocol: Mail
  1495. Status: standard
  1496. Author/Change controller: IETF
  1497. Specification document(s): This document (section 3.6.4)
  1498. Resnick Standards Track [Page 40]
  1499. RFC 5322 Internet Message Format October 2008
  1500. Header field name: References
  1501. Applicable protocol: Mail
  1502. Status: standard
  1503. Author/Change controller: IETF
  1504. Specification document(s): This document (section 3.6.4)
  1505. Header field name: Subject
  1506. Applicable protocol: Mail
  1507. Status: standard
  1508. Author/Change controller: IETF
  1509. Specification document(s): This document (section 3.6.5)
  1510. Header field name: Comments
  1511. Applicable protocol: Mail
  1512. Status: standard
  1513. Author/Change controller: IETF
  1514. Specification document(s): This document (section 3.6.5)
  1515. Header field name: Keywords
  1516. Applicable protocol: Mail
  1517. Status: standard
  1518. Author/Change controller: IETF
  1519. Specification document(s): This document (section 3.6.5)
  1520. Header field name: Resent-Date
  1521. Applicable protocol: Mail
  1522. Status: standard
  1523. Author/Change controller: IETF
  1524. Specification document(s): This document (section 3.6.6)
  1525. Header field name: Resent-From
  1526. Applicable protocol: Mail
  1527. Status: standard
  1528. Author/Change controller: IETF
  1529. Specification document(s): This document (section 3.6.6)
  1530. Header field name: Resent-Sender
  1531. Applicable protocol: Mail
  1532. Status: standard
  1533. Author/Change controller: IETF
  1534. Specification document(s): This document (section 3.6.6)
  1535. Header field name: Resent-To
  1536. Applicable protocol: Mail
  1537. Status: standard
  1538. Author/Change controller: IETF
  1539. Specification document(s): This document (section 3.6.6)
  1540. Resnick Standards Track [Page 41]
  1541. RFC 5322 Internet Message Format October 2008
  1542. Header field name: Resent-Cc
  1543. Applicable protocol: Mail
  1544. Status: standard
  1545. Author/Change controller: IETF
  1546. Specification document(s): This document (section 3.6.6)
  1547. Header field name: Resent-Bcc
  1548. Applicable protocol: Mail
  1549. Status: standard
  1550. Author/Change controller: IETF
  1551. Specification document(s): This document (section 3.6.6)
  1552. Header field name: Resent-Reply-To
  1553. Applicable protocol: Mail
  1554. Status: obsolete
  1555. Author/Change controller: IETF
  1556. Specification document(s): This document (section 4.5.6)
  1557. Header field name: Resent-Message-ID
  1558. Applicable protocol: Mail
  1559. Status: standard
  1560. Author/Change controller: IETF
  1561. Specification document(s): This document (section 3.6.6)
  1562. Header field name: Return-Path
  1563. Applicable protocol: Mail
  1564. Status: standard
  1565. Author/Change controller: IETF
  1566. Specification document(s): This document (section 3.6.7)
  1567. Header field name: Received
  1568. Applicable protocol: Mail
  1569. Status: standard
  1570. Author/Change controller: IETF
  1571. Specification document(s): This document (section 3.6.7)
  1572. Related information: [RFC5321]
  1573. Resnick Standards Track [Page 42]
  1574. RFC 5322 Internet Message Format October 2008
  1575. Appendix A. Example Messages
  1576. This section presents a selection of messages. These are intended to
  1577. assist in the implementation of this specification, but should not be
  1578. taken as normative; that is to say, although the examples in this
  1579. section were carefully reviewed, if there happens to be a conflict
  1580. between these examples and the syntax described in sections 3 and 4
  1581. of this document, the syntax in those sections is to be taken as
  1582. correct.
  1583. In the text version of this document, messages in this section are
  1584. delimited between lines of "----". The "----" lines are not part of
  1585. the message itself.
  1586. Resnick Standards Track [Page 43]
  1587. RFC 5322 Internet Message Format October 2008
  1588. Appendix A.1. Addressing Examples
  1589. The following are examples of messages that might be sent between two
  1590. individuals.
  1591. Appendix A.1.1. A Message from One Person to Another with Simple
  1592. Addressing
  1593. This could be called a canonical message. It has a single author,
  1594. John Doe, a single recipient, Mary Smith, a subject, the date, a
  1595. message identifier, and a textual message in the body.
  1596. ----
  1597. From: John Doe <jdoe@machine.example>
  1598. To: Mary Smith <mary@example.net>
  1599. Subject: Saying Hello
  1600. Date: Fri, 21 Nov 1997 09:55:06 -0600
  1601. Message-ID: <1234@local.machine.example>
  1602. This is a message just to say hello.
  1603. So, "Hello".
  1604. ----
  1605. If John's secretary Michael actually sent the message, even though
  1606. John was the author and replies to this message should go back to
  1607. him, the sender field would be used:
  1608. ----
  1609. From: John Doe <jdoe@machine.example>
  1610. Sender: Michael Jones <mjones@machine.example>
  1611. To: Mary Smith <mary@example.net>
  1612. Subject: Saying Hello
  1613. Date: Fri, 21 Nov 1997 09:55:06 -0600
  1614. Message-ID: <1234@local.machine.example>
  1615. This is a message just to say hello.
  1616. So, "Hello".
  1617. ----
  1618. Resnick Standards Track [Page 44]
  1619. RFC 5322 Internet Message Format October 2008
  1620. Appendix A.1.2. Different Types of Mailboxes
  1621. This message includes multiple addresses in the destination fields
  1622. and also uses several different forms of addresses.
  1623. ----
  1624. From: "Joe Q. Public" <john.q.public@example.com>
  1625. To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>
  1626. Cc: <boss@nil.test>, "Giant; \"Big\" Box" <sysservices@example.net>
  1627. Date: Tue, 1 Jul 2003 10:52:37 +0200
  1628. Message-ID: <5678.21-Nov-1997@example.com>
  1629. Hi everyone.
  1630. ----
  1631. Note that the display names for Joe Q. Public and Giant; "Big" Box
  1632. needed to be enclosed in double-quotes because the former contains
  1633. the period and the latter contains both semicolon and double-quote
  1634. characters (the double-quote characters appearing as quoted-pair
  1635. constructs). Conversely, the display name for Who? could appear
  1636. without them because the question mark is legal in an atom. Notice
  1637. also that jdoe@example.org and boss@nil.test have no display names
  1638. associated with them at all, and jdoe@example.org uses the simpler
  1639. address form without the angle brackets.
  1640. Appendix A.1.3. Group Addresses
  1641. ----
  1642. From: Pete <pete@silly.example>
  1643. To: A Group:Ed Jones <c@a.test>,joe@where.test,John <jdoe@one.test>;
  1644. Cc: Undisclosed recipients:;
  1645. Date: Thu, 13 Feb 1969 23:32:54 -0330
  1646. Message-ID: <testabcd.1234@silly.example>
  1647. Testing.
  1648. ----
  1649. In this message, the "To:" field has a single group recipient named
  1650. "A Group", which contains 3 addresses, and a "Cc:" field with an
  1651. empty group recipient named Undisclosed recipients.
  1652. Resnick Standards Track [Page 45]
  1653. RFC 5322 Internet Message Format October 2008
  1654. Appendix A.2. Reply Messages
  1655. The following is a series of three messages that make up a
  1656. conversation thread between John and Mary. John first sends a
  1657. message to Mary, Mary then replies to John's message, and then John
  1658. replies to Mary's reply message.
  1659. Note especially the "Message-ID:", "References:", and "In-Reply-To:"
  1660. fields in each message.
  1661. ----
  1662. From: John Doe <jdoe@machine.example>
  1663. To: Mary Smith <mary@example.net>
  1664. Subject: Saying Hello
  1665. Date: Fri, 21 Nov 1997 09:55:06 -0600
  1666. Message-ID: <1234@local.machine.example>
  1667. This is a message just to say hello.
  1668. So, "Hello".
  1669. ----
  1670. When sending replies, the Subject field is often retained, though
  1671. prepended with "Re: " as described in section 3.6.5.
  1672. ----
  1673. From: Mary Smith <mary@example.net>
  1674. To: John Doe <jdoe@machine.example>
  1675. Reply-To: "Mary Smith: Personal Account" <smith@home.example>
  1676. Subject: Re: Saying Hello
  1677. Date: Fri, 21 Nov 1997 10:01:10 -0600
  1678. Message-ID: <3456@example.net>
  1679. In-Reply-To: <1234@local.machine.example>
  1680. References: <1234@local.machine.example>
  1681. This is a reply to your hello.
  1682. ----
  1683. Note the "Reply-To:" field in the above message. When John replies
  1684. to Mary's message above, the reply should go to the address in the
  1685. "Reply-To:" field instead of the address in the "From:" field.
  1686. Resnick Standards Track [Page 46]
  1687. RFC 5322 Internet Message Format October 2008
  1688. ----
  1689. To: "Mary Smith: Personal Account" <smith@home.example>
  1690. From: John Doe <jdoe@machine.example>
  1691. Subject: Re: Saying Hello
  1692. Date: Fri, 21 Nov 1997 11:00:00 -0600
  1693. Message-ID: <abcd.1234@local.machine.test>
  1694. In-Reply-To: <3456@example.net>
  1695. References: <1234@local.machine.example> <3456@example.net>
  1696. This is a reply to your reply.
  1697. ----
  1698. Appendix A.3. Resent Messages
  1699. Start with the message that has been used as an example several
  1700. times:
  1701. ----
  1702. From: John Doe <jdoe@machine.example>
  1703. To: Mary Smith <mary@example.net>
  1704. Subject: Saying Hello
  1705. Date: Fri, 21 Nov 1997 09:55:06 -0600
  1706. Message-ID: <1234@local.machine.example>
  1707. This is a message just to say hello.
  1708. So, "Hello".
  1709. ----
  1710. Say that Mary, upon receiving this message, wishes to send a copy of
  1711. the message to Jane such that (a) the message would appear to have
  1712. come straight from John; (b) if Jane replies to the message, the
  1713. reply should go back to John; and (c) all of the original
  1714. information, like the date the message was originally sent to Mary,
  1715. the message identifier, and the original addressee, is preserved. In
  1716. this case, resent fields are prepended to the message:
  1717. Resnick Standards Track [Page 47]
  1718. RFC 5322 Internet Message Format October 2008
  1719. ----
  1720. Resent-From: Mary Smith <mary@example.net>
  1721. Resent-To: Jane Brown <j-brown@other.example>
  1722. Resent-Date: Mon, 24 Nov 1997 14:22:01 -0800
  1723. Resent-Message-ID: <78910@example.net>
  1724. From: John Doe <jdoe@machine.example>
  1725. To: Mary Smith <mary@example.net>
  1726. Subject: Saying Hello
  1727. Date: Fri, 21 Nov 1997 09:55:06 -0600
  1728. Message-ID: <1234@local.machine.example>
  1729. This is a message just to say hello.
  1730. So, "Hello".
  1731. ----
  1732. If Jane, in turn, wished to resend this message to another person,
  1733. she would prepend her own set of resent header fields to the above
  1734. and send that. (Note that for brevity, trace fields are not shown.)
  1735. Appendix A.4. Messages with Trace Fields
  1736. As messages are sent through the transport system as described in
  1737. [RFC5321], trace fields are prepended to the message. The following
  1738. is an example of what those trace fields might look like. Note that
  1739. there is some folding white space in the first one since these lines
  1740. can be long.
  1741. ----
  1742. Received: from x.y.test
  1743. by example.net
  1744. via TCP
  1745. with ESMTP
  1746. id ABC12345
  1747. for <mary@example.net>; 21 Nov 1997 10:05:43 -0600
  1748. Received: from node.example by x.y.test; 21 Nov 1997 10:01:22 -0600
  1749. From: John Doe <jdoe@node.example>
  1750. To: Mary Smith <mary@example.net>
  1751. Subject: Saying Hello
  1752. Date: Fri, 21 Nov 1997 09:55:06 -0600
  1753. Message-ID: <1234@local.node.example>
  1754. This is a message just to say hello.
  1755. So, "Hello".
  1756. ----
  1757. Resnick Standards Track [Page 48]
  1758. RFC 5322 Internet Message Format October 2008
  1759. Appendix A.5. White Space, Comments, and Other Oddities
  1760. White space, including folding white space, and comments can be
  1761. inserted between many of the tokens of fields. Taking the example
  1762. from A.1.3, white space and comments can be inserted into all of the
  1763. fields.
  1764. ----
  1765. From: Pete(A nice \) chap) <pete(his account)@silly.test(his host)>
  1766. To:A Group(Some people)
  1767. :Chris Jones <c@(Chris's host.)public.example>,
  1768. joe@example.org,
  1769. John <jdoe@one.test> (my dear friend); (the end of the group)
  1770. Cc:(Empty list)(start)Hidden recipients :(nobody(that I know)) ;
  1771. Date: Thu,
  1772. 13
  1773. Feb
  1774. 1969
  1775. 23:32
  1776. -0330 (Newfoundland Time)
  1777. Message-ID: <testabcd.1234@silly.test>
  1778. Testing.
  1779. ----
  1780. The above example is aesthetically displeasing, but perfectly legal.
  1781. Note particularly (1) the comments in the "From:" field (including
  1782. one that has a ")" character appearing as part of a quoted-pair); (2)
  1783. the white space absent after the ":" in the "To:" field as well as
  1784. the comment and folding white space after the group name, the special
  1785. character (".") in the comment in Chris Jones's address, and the
  1786. folding white space before and after "joe@example.org,"; (3) the
  1787. multiple and nested comments in the "Cc:" field as well as the
  1788. comment immediately following the ":" after "Cc"; (4) the folding
  1789. white space (but no comments except at the end) and the missing
  1790. seconds in the time of the date field; and (5) the white space before
  1791. (but not within) the identifier in the "Message-ID:" field.
  1792. Resnick Standards Track [Page 49]
  1793. RFC 5322 Internet Message Format October 2008
  1794. Appendix A.6. Obsoleted Forms
  1795. The following are examples of obsolete (that is, the "MUST NOT
  1796. generate") syntactic elements described in section 4 of this
  1797. document.
  1798. Appendix A.6.1. Obsolete Addressing
  1799. Note in the example below the lack of quotes around Joe Q. Public,
  1800. the route that appears in the address for Mary Smith, the two commas
  1801. that appear in the "To:" field, and the spaces that appear around the
  1802. "." in the jdoe address.
  1803. ----
  1804. From: Joe Q. Public <john.q.public@example.com>
  1805. To: Mary Smith <@node.test:mary@example.net>, , jdoe@test . example
  1806. Date: Tue, 1 Jul 2003 10:52:37 +0200
  1807. Message-ID: <5678.21-Nov-1997@example.com>
  1808. Hi everyone.
  1809. ----
  1810. Appendix A.6.2. Obsolete Dates
  1811. The following message uses an obsolete date format, including a non-
  1812. numeric time zone and a two digit year. Note that although the day-
  1813. of-week is missing, that is not specific to the obsolete syntax; it
  1814. is optional in the current syntax as well.
  1815. ----
  1816. From: John Doe <jdoe@machine.example>
  1817. To: Mary Smith <mary@example.net>
  1818. Subject: Saying Hello
  1819. Date: 21 Nov 97 09:55:06 GMT
  1820. Message-ID: <1234@local.machine.example>
  1821. This is a message just to say hello.
  1822. So, "Hello".
  1823. ----
  1824. Resnick Standards Track [Page 50]
  1825. RFC 5322 Internet Message Format October 2008
  1826. Appendix A.6.3. Obsolete White Space and Comments
  1827. White space and comments can appear between many more elements than
  1828. in the current syntax. Also, folding lines that are made up entirely
  1829. of white space are legal.
  1830. ----
  1831. From : John Doe <jdoe@machine(comment). example>
  1832. To : Mary Smith
  1833. __
  1834. <mary@example.net>
  1835. Subject : Saying Hello
  1836. Date : Fri, 21 Nov 1997 09(comment): 55 : 06 -0600
  1837. Message-ID : <1234 @ local(blah) .machine .example>
  1838. This is a message just to say hello.
  1839. So, "Hello".
  1840. ----
  1841. Note especially the second line of the "To:" field. It starts with
  1842. two space characters. (Note that "__" represent blank spaces.)
  1843. Therefore, it is considered part of the folding, as described in
  1844. section 4.2. Also, the comments and white space throughout
  1845. addresses, dates, and message identifiers are all part of the
  1846. obsolete syntax.
  1847. Resnick Standards Track [Page 51]
  1848. RFC 5322 Internet Message Format October 2008
  1849. Appendix B. Differences from Earlier Specifications
  1850. This appendix contains a list of changes that have been made in the
  1851. Internet Message Format from earlier specifications, specifically
  1852. [RFC0822], [RFC1123], and [RFC2822]. Items marked with an asterisk
  1853. (*) below are items which appear in section 4 of this document and
  1854. therefore can no longer be generated.
  1855. The following are the changes made from [RFC0822] and [RFC1123] to
  1856. [RFC2822] that remain in this document:
  1857. 1. Period allowed in obsolete form of phrase.
  1858. 2. ABNF moved out of document, now in [RFC5234].
  1859. 3. Four or more digits allowed for year.
  1860. 4. Header field ordering (and lack thereof) made explicit.
  1861. 5. Encrypted header field removed.
  1862. 6. Specifically allow and give meaning to "-0000" time zone.
  1863. 7. Folding white space is not allowed between every token.
  1864. 8. Requirement for destinations removed.
  1865. 9. Forwarding and resending redefined.
  1866. 10. Extension header fields no longer specifically called out.
  1867. 11. ASCII 0 (null) removed.*
  1868. 12. Folding continuation lines cannot contain only white space.*
  1869. 13. Free insertion of comments not allowed in date.*
  1870. 14. Non-numeric time zones not allowed.*
  1871. 15. Two digit years not allowed.*
  1872. 16. Three digit years interpreted, but not allowed for generation.*
  1873. 17. Routes in addresses not allowed.*
  1874. 18. CFWS within local-parts and domains not allowed.*
  1875. 19. Empty members of address lists not allowed.*
  1876. 20. Folding white space between field name and colon not allowed.*
  1877. 21. Comments between field name and colon not allowed.
  1878. 22. Tightened syntax of in-reply-to and references.*
  1879. 23. CFWS within msg-id not allowed.*
  1880. 24. Tightened semantics of resent fields as informational only.
  1881. 25. Resent-Reply-To not allowed.*
  1882. 26. No multiple occurrences of fields (except resent and received).*
  1883. 27. Free CR and LF not allowed.*
  1884. 28. Line length limits specified.
  1885. 29. Bcc more clearly specified.
  1886. Resnick Standards Track [Page 52]
  1887. RFC 5322 Internet Message Format October 2008
  1888. The following are changes from [RFC2822].
  1889. 1. Assorted typographical/grammatical errors fixed and
  1890. clarifications made.
  1891. 2. Changed "standard" to "document" or "specification" throughout.
  1892. 3. Made distinction between "header field" and "header section".
  1893. 4. Removed NO-WS-CTL from ctext, qtext, dtext, and unstructured.*
  1894. 5. Moved discussion of specials to the "Atom" section. Moved text
  1895. to "Overall message syntax" section.
  1896. 6. Simplified CFWS syntax.
  1897. 7. Fixed unstructured syntax.
  1898. 8. Changed date and time syntax to deal with white space in
  1899. obsolete date syntax.
  1900. 9. Removed quoted-pair from domain literals and message
  1901. identifiers.*
  1902. 10. Clarified that other specifications limit domain syntax.
  1903. 11. Simplified "Bcc:" and "Resent-Bcc:" syntax.
  1904. 12. Allowed optional-field to appear within trace information.
  1905. 13. Removed no-fold-quote from msg-id. Clarified syntax
  1906. limitations.
  1907. 14. Generalized "Received:" syntax to fix bugs and move definition
  1908. out of this document.
  1909. 15. Simplified obs-qp. Fixed and simplified obs-utext (which now
  1910. only appears in the obsolete syntax). Removed obs-text and obs-
  1911. char, adding obs-body.
  1912. 16. Fixed obsolete date syntax to allow for more (or less) comments
  1913. and white space.
  1914. 17. Fixed all obsolete list syntax (obs-domain-list, obs-mbox-list,
  1915. obs-addr-list, obs-phrase-list, and the newly added obs-group-
  1916. list).
  1917. 18. Fixed obs-reply-to syntax.
  1918. 19. Fixed obs-bcc and obs-resent-bcc to allow empty lists.
  1919. 20. Removed obs-path.
  1920. Appendix C. Acknowledgements
  1921. Many people contributed to this document. They included folks who
  1922. participated in the Detailed Revision and Update of Messaging
  1923. Standards (DRUMS) Working Group of the Internet Engineering Task
  1924. Force (IETF), the chair of DRUMS, the Area Directors of the IETF, and
  1925. people who simply sent their comments in via email. The editor is
  1926. deeply indebted to them all and thanks them sincerely. The below
  1927. list includes everyone who sent email concerning both this document
  1928. and [RFC2822]. Hopefully, everyone who contributed is named here:
  1929. +--------------------+----------------------+---------------------+
  1930. | Matti Aarnio | Tanaka Akira | Russ Allbery |
  1931. | Eric Allman | Harald Alvestrand | Ran Atkinson |
  1932. | Jos Backus | Bruce Balden | Dave Barr |
  1933. Resnick Standards Track [Page 53]
  1934. RFC 5322 Internet Message Format October 2008
  1935. | Alan Barrett | John Beck | J Robert von Behren |
  1936. | Jos den Bekker | D J Bernstein | James Berriman |
  1937. | Oliver Block | Norbert Bollow | Raj Bose |
  1938. | Antony Bowesman | Scott Bradner | Randy Bush |
  1939. | Tom Byrer | Bruce Campbell | Larry Campbell |
  1940. | W J Carpenter | Michael Chapman | Richard Clayton |
  1941. | Maurizio Codogno | Jim Conklin | R Kelley Cook |
  1942. | Nathan Coulter | Steve Coya | Mark Crispin |
  1943. | Dave Crocker | Matt Curtin | Michael D'Errico |
  1944. | Cyrus Daboo | Michael D Dean | Jutta Degener |
  1945. | Mark Delany | Steve Dorner | Harold A Driscoll |
  1946. | Michael Elkins | Frank Ellerman | Robert Elz |
  1947. | Johnny Eriksson | Erik E Fair | Roger Fajman |
  1948. | Patrik Faltstrom | Claus Andre Faerber | Barry Finkel |
  1949. | Erik Forsberg | Chuck Foster | Paul Fox |
  1950. | Klaus M Frank | Ned Freed | Jochen Friedrich |
  1951. | Randall C Gellens | Sukvinder Singh Gill | Tim Goodwin |
  1952. | Philip Guenther | Arnt Gulbrandsen | Eric A Hall |
  1953. | Tony Hansen | John Hawkinson | Philip Hazel |
  1954. | Kai Henningsen | Robert Herriot | Paul Hethmon |
  1955. | Jim Hill | Alfred Hoenes | Paul E Hoffman |
  1956. | Steve Hole | Kari Hurtta | Marco S Hyman |
  1957. | Ofer Inbar | Olle Jarnefors | Kevin Johnson |
  1958. | Sudish Joseph | Maynard Kang | Prabhat Keni |
  1959. | John C Klensin | Graham Klyne | Brad Knowles |
  1960. | Shuhei Kobayashi | Peter Koch | Dan Kohn |
  1961. | Christian Kuhtz | Anand Kumria | Steen Larsen |
  1962. | Eliot Lear | Barry Leiba | Jay Levitt |
  1963. | Bruce Lilly | Lars-Johan Liman | Charles Lindsey |
  1964. | Pete Loshin | Simon Lyall | Bill Manning |
  1965. | John Martin | Mark Martinec | Larry Masinter |
  1966. | Denis McKeon | William P McQuillan | Alexey Melnikov |
  1967. | Perry E Metzger | Steven Miller | S Moonesamy |
  1968. | Keith Moore | John Gardiner Myers | Chris Newman |
  1969. | John W Noerenberg | Eric Norman | Mike O'Dell |
  1970. | Larry Osterman | Paul Overell | Jacob Palme |
  1971. | Michael A Patton | Uzi Paz | Michael A Quinlan |
  1972. | Robert Rapplean | Eric S Raymond | Sam Roberts |
  1973. | Hugh Sasse | Bart Schaefer | Tom Scola |
  1974. | Wolfgang Segmuller | Nick Shelness | John Stanley |
  1975. | Einar Stefferud | Jeff Stephenson | Bernard Stern |
  1976. | Peter Sylvester | Mark Symons | Eric Thomas |
  1977. | Lee Thompson | Karel De Vriendt | Matthew Wall |
  1978. | Rolf Weber | Brent B Welch | Dan Wing |
  1979. | Jack De Winter | Gregory J Woodhouse | Greg A Woods |
  1980. | Kazu Yamamoto | Alain Zahm | Jamie Zawinski |
  1981. | Timothy S Zurcher | | |
  1982. +--------------------+----------------------+---------------------+
  1983. Resnick Standards Track [Page 54]
  1984. RFC 5322 Internet Message Format October 2008
  1985. 7. References
  1986. 7.1. Normative References
  1987. [ANSI.X3-4.1986] American National Standards Institute, "Coded
  1988. Character Set - 7-bit American Standard Code for
  1989. Information Interchange", ANSI X3.4, 1986.
  1990. [RFC1034] Mockapetris, P., "Domain names - concepts and
  1991. facilities", STD 13, RFC 1034, November 1987.
  1992. [RFC1035] Mockapetris, P., "Domain names - implementation and
  1993. specification", STD 13, RFC 1035, November 1987.
  1994. [RFC1123] Braden, R., "Requirements for Internet Hosts -
  1995. Application and Support", STD 3, RFC 1123,
  1996. October 1989.
  1997. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
  1998. Requirement Levels", BCP 14, RFC 2119, March 1997.
  1999. [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for
  2000. Syntax Specifications: ABNF", STD 68, RFC 5234,
  2001. January 2008.
  2002. 7.2. Informative References
  2003. [RFC0822] Crocker, D., "Standard for the format of ARPA
  2004. Internet text messages", STD 11, RFC 822,
  2005. August 1982.
  2006. [RFC1305] Mills, D., "Network Time Protocol (Version 3)
  2007. Specification, Implementation", RFC 1305,
  2008. March 1992.
  2009. [ISO.2022.1994] International Organization for Standardization,
  2010. "Information technology - Character code structure
  2011. and extension techniques", ISO Standard 2022, 1994.
  2012. [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet
  2013. Mail Extensions (MIME) Part One: Format of Internet
  2014. Message Bodies", RFC 2045, November 1996.
  2015. [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet
  2016. Mail Extensions (MIME) Part Two: Media Types",
  2017. RFC 2046, November 1996.
  2018. Resnick Standards Track [Page 55]
  2019. RFC 5322 Internet Message Format October 2008
  2020. [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail
  2021. Extensions) Part Three: Message Header Extensions
  2022. for Non-ASCII Text", RFC 2047, November 1996.
  2023. [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet
  2024. Mail Extensions (MIME) Part Five: Conformance
  2025. Criteria and Examples", RFC 2049, November 1996.
  2026. [RFC2822] Resnick, P., "Internet Message Format", RFC 2822,
  2027. April 2001.
  2028. [RFC3864] Klyne, G., Nottingham, M., and J. Mogul,
  2029. "Registration Procedures for Message Header
  2030. Fields", BCP 90, RFC 3864, September 2004.
  2031. [RFC4021] Klyne, G. and J. Palme, "Registration of Mail and
  2032. MIME Header Fields", RFC 4021, March 2005.
  2033. [RFC4288] Freed, N. and J. Klensin, "Media Type
  2034. Specifications and Registration Procedures",
  2035. BCP 13, RFC 4288, December 2005.
  2036. [RFC4289] Freed, N. and J. Klensin, "Multipurpose Internet
  2037. Mail Extensions (MIME) Part Four: Registration
  2038. Procedures", BCP 13, RFC 4289, December 2005.
  2039. [RFC5321] Klensin, J., "Simple Mail Transfer Protocol",
  2040. RFC 5321, October 2008.
  2041. Author's Address
  2042. Peter W. Resnick (editor)
  2043. Qualcomm Incorporated
  2044. 5775 Morehouse Drive
  2045. San Diego, CA 92121-1714
  2046. US
  2047. Phone: +1 858 651 4478
  2048. EMail: presnick@qualcomm.com
  2049. URI: http://www.qualcomm.com/~presnick/
  2050. Resnick Standards Track [Page 56]
  2051. RFC 5322 Internet Message Format October 2008
  2052. Full Copyright Statement
  2053. Copyright (C) The IETF Trust (2008).
  2054. This document is subject to the rights, licenses and restrictions
  2055. contained in BCP 78, and except as set forth therein, the authors
  2056. retain all their rights.
  2057. This document and the information contained herein are provided on an
  2058. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  2059. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
  2060. THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
  2061. OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
  2062. THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  2063. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  2064. Intellectual Property
  2065. The IETF takes no position regarding the validity or scope of any
  2066. Intellectual Property Rights or other rights that might be claimed to
  2067. pertain to the implementation or use of the technology described in
  2068. this document or the extent to which any license under such rights
  2069. might or might not be available; nor does it represent that it has
  2070. made any independent effort to identify any such rights. Information
  2071. on the procedures with respect to rights in RFC documents can be
  2072. found in BCP 78 and BCP 79.
  2073. Copies of IPR disclosures made to the IETF Secretariat and any
  2074. assurances of licenses to be made available, or the result of an
  2075. attempt made to obtain a general license or permission for the use of
  2076. such proprietary rights by implementers or users of this
  2077. specification can be obtained from the IETF on-line IPR repository at
  2078. http://www.ietf.org/ipr.
  2079. The IETF invites any interested party to bring to its attention any
  2080. copyrights, patents or patent applications, or other proprietary
  2081. rights that may cover technology that may be required to implement
  2082. this standard. Please address the information to the IETF at
  2083. ietf-ipr@ietf.org.
  2084. Resnick Standards Track [Page 57]