メインコンテンツまでスキップ

III.C-E. メッセージの一般構文、宛先項目、補助構文

C. メッセージの一般構文​

注意: 表記規則の副作用により、構文上、「Date」、「From」、「Sender」、「Reply-To」の各フィールドは、存在する場合には特定の順序でなければならないと示されている。これらのヘッダ項目は一意(ちょうど 1 回出現)でなければならない。しかし実際には、ヘッダフィールドが特定の順序で出現することは要求されない(NOT)。ただし、メッセージ本体はヘッダの後(AFTER)に出現しなければならない。可読性と単純なシステムによる解析の容易さのため、ヘッダは「Date」、「From」、「Subject」、「Sender」、「To」、「cc」などの順序で送ることが推奨される。本仕様は、ほとんどの省略可能フィールドの複数回の出現を許容する。ただし、その解釈はここでは規定されず、使用は強く推奨されない。

各種フィールドの本体に関する以下の構文は、各フィールド本体を 1 つの長い文字列(または行)として記述するものと考えるべきである。字句解析の節(第 II.B 節)は、そのような長い文字列が、実際に伝送されるメッセージでは複数行でどのように表現されうるかを示している。

message     =  fields *( CRLF *text )       ; Everything after
                                            ;  first null line
                                            ;  is message body

fields      =  date-field                   ; Creation time-stamp
               originator-fields            ;  & author id are
               *optional-field              ;  required: others
                                            ;  are all optional

originator-fields =
               (  "From"     ":" mailbox    ; Single author
                 ["Reply-To" ":" #address] )
            /  (  "From"     ":" 1#address  ; Multiple authors &
                  "Sender"   ":" mailbox    ;  may have non-mach-
                 ["Reply-To" ":" #address] );  ine addresses

date-field  =  "Date"       ":" date-time

optional-field  =
               "To"         ":" #address
            /  "cc"         ":" #address
            /  "bcc"        ":" #address    ; Blind carbon
            /  "Subject"    ":" *text
            /  "Comments"   ":" *text
            /  "Message-ID" ":" mach-id     ; Only one allowed
            /  "In-Reply-To"":" #(phrase / mach-id)
            /  "References" ":" #(phrase / mach-id)
            /  "Keywords"   ":" #phrase
            /  extension-field              ; To be defined in
                                            ;  supplemental
                                            ;  specifications
            /  user-defined-field           ; Must have unique
                                            ;  field-name & may
                                            ;  be pre-empted

extension-field = <Any field which is defined in a document
               published as a formal extension to this
               specification>

user-defined-field = <Any field which has not been defined in
               this specification or published as an extension to
               this specification; names for such fields must be
               unique and may be preempted by published
               extensions>

D. 一般的な宛先項目の構文​

address     =  host-phrase                  ; Machine mailbox
/ ( [phrase] "<" #address ">") ; Individual / List
/ ( [phrase] ":" #address ";") ; Group
/ quoted-string ; Arbitrary text
/ (":" ( "Include" ; File, w/ addr list
/ "Postal" ; (U.S.) Postal addr
/ atom ) ; Extended data type
":" address)

mailbox = host-phrase / (phrase mach-id)

mach-id = "<" host-phrase ">" ; Contents must never
; be modified!

E. 補助構文​

host-phrase =  phrase  host-indicator       ; Basic address

host-indicator =  1*( ("at" / "@") node )   ; Right-most node is
                                            ;  at top of network
                                            ;  hierarchy; left-
                                            ;  most must be host

node        =  word / 1*DIGIT               ; Official host or
                                            ;  network name or
                                            ;  decimal address

date-time   =  [ day-of-week "," ] date time

day-of-week =  "Monday"    / "Mon"  / "Tuesday"   / "Tue"
            /  "Wednesday" / "Wed"  / "Thursday"  / "Thu"
            /  "Friday"    / "Fri"  / "Saturday"  / "Sat"
            /  "Sunday"    / "Sun"

date        =  1*2DIGIT ["-"] month         ; day month year
               ["-"] (2DIGIT /4DIGIT)       ;  e.g. 20 Aug [19]77

month       =  "January"   / "Jan"  / "February"  / "Feb"
            /  "March"     / "Mar"  / "April"     / "Apr"
            /  "May"                / "June"      / "Jun"
            /  "July"      / "Jul"  / "August"    / "Aug"
            /  "September" / "Sep"  / "October"   / "Oct"
            /  "November"  / "Nov"  / "December"  / "Dec"

time        =  hour zone                    ; ANSI and Military
                                            ;  (seconds optional)

hour        =  2DIGIT [":"] 2DIGIT [ [":"] 2DIGIT ]
                                            ; 0000[00] - 2359[59]

zone        = ( ["-"] ( "GMT"               ; Relative to GMT:
                                            ; North American
                 /  "NST" /                 ;  Newfoundland:-3:30
                 /  "AST" / "ADT"           ;  Atlantic: - 4/ - 3
                 /  "EST" / "EDT"           ;  Eastern:  - 5/ - 4
                 /  "CST" / "CDT"           ;  Central:  - 6/ - 5
                 /  "MST" / "MDT"           ;  Mountain: - 7/ - 6
                 /  "PST" / "PDT"           ;  Pacific:  - 8/ - 7
                 /  "YST" / "YDT"           ;  Yukon:    - 9/ - 8
                 /  "HST" / "HDT"           ;  Haw/Ala   -10/ - 9
                 /  "BST" / "BDT"           ;  Bering:   -11/ -10
                    1ALPHA       ))         ; Military: Z = GMT;
                                            ;  A:-1; (J not used)
                                            ;  M:-12; N:+1; Y:+12
            / ( ("+" / "-") 4DIGIT )        ; Local differential
                                            ;  hours/min. (HHMM)

phrase      =  1*word                       ; Sequence of words.
                                            ;  Separation seman-
                                            ;  tically = SPACE

word        =  atom / quoted-string