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

II.B. 構文(続き)

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

注:この構文は、<required-headers> の項目が特定の順序で並び、他のすべてのヘッダ項目に先行しなければならないことを示している。実際には、ヘッダ・フィールドは特定の順序で現れる必要はない(NOT)。必須のヘッダ項目は一意でなければならない(ちょうど 1 回現れる)。この仕様は、ほとんどの任意フィールドの複数回の出現を許す。ただし、そのような複数回の出現の解釈は、ここでは規定されない。

<message>         ::=   <headers>
| <headers> <crlf> <message-text>

<headers> ::= <required-headers>
| <required-headers> <optional-headers>
<required-headers> ::= <date-field> <originator>
<originator> ::= <mach-from-field>
| <mach-from-list> <sender-field>
| <mach-from-field> <reply-to-field>
| <any-from-field> <sender-field>
<reply-to-field>

<date-field> ::= "Date" ":" <date-time>
<mach-from-field> ::= "From" ":" <mach-addr-item>
<mach-from-list> ::= "From" ":" <mach-addr-list>
<any-from-field> ::= "From" ":" <address-list>
<sender-field> ::= "Sender" ":" <host-phrase>
<reply-to-field> ::= "Reply-To" ":" <mach-addr-list>

<optional-headers>::= <optional-header-field>
| <optional-headers>
<optional-header-field>

<optional-header-field> ::= <addressee-field>
| <extension-field>

<addressee-field> ::= "To" ":" <address-list>
| "cc" ":" <address-list>
| "bcc" ":" <address-list>
| "Fcc" ":" <path-list>

<extension-field> ::= "In-Reply-To" ":" <reference-list>
| "Keywords" ":" <phrase-list>
| "Message-Id" ":" <mach-host-phrase>
| "References" ":" <reference-list>
| "Subject" ":" <text-line>
| "Comments" ":" <text-line>
| <user-defined-field>

<user-defined-field> ::= <A <field> which has a <field-name>
not defined in this specification>

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

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

<mach-addr-list>  ::=   <mach-addr-item>
| <mach-addr-item> "," <address-list>

<address-list> ::= <null>
| <address-item>
| <address-item> "," <address-list>
<address-item> ::= <mach-addr-item>
| <group-name> ":" <address-list> ";"
| <any-name>
| <path>

<mach-addr-item> ::= <mailbox>
| <phrase> "<" <mailbox-list> ">"

<group-name> ::= <phrase>
<any-name> ::= <quoted-string>

<mailbox-list> ::= <mailbox>
| <mailbox> "," <mailbox-list>
<mailbox> ::= <host-phrase>

<path> ::= ":" "File" ":" <path-name>
<path-name> ::= <path-item>
| "<" <path-list> ">"
<path-list> ::= <path-item>
| <path-item> "," <path-list>
<path-item> ::= <host-phrase>

4. 補助構文​

<reference-list>  ::=   <null>
                      | <reference-item>
                      | <reference-item> "," <reference-list>
<reference-item>  ::=   <phrase>
                      | <mach-host-phrase>

<mach-host-phrase>::=   "<" <host-phrase> ">"
<host-phrase>     ::=   <phrase> <host-indicator>
<host-indicator>  ::=   <at-indicator> <host-name>
<at-indicator>    ::=   "at" | "@"
<host-name>       ::=   <atom>
                      | <decimal host address>

<date-time>       ::=   <day> <date> <time>
<day>             ::=   <null>
                      | <day-of-week> ","
<day-of-week>     ::=   "Monday"    | "Mon"
                      | "Tuesday"   | "Tue"
                      | "Wednesday" | "Wed"
                      | "Thursday"  | "Thu"
                      | "Friday"    | "Fri"
                      | "Saturday"  | "Sat"
                      | "Sunday"    | "Sun"
<date>            ::=   <string-date>
                      | <slash-date>
<string-date>     ::=   <day-of-month> <string-month>
                                       <4-digit-year>
<slash-date>      ::=   <numeric-month> "/" <date-of-month>
                                        "/" <2-digit-year>
<numeric-month>   ::=   <one or two decimal digits>
<day-of-month>    ::=   <one or two decimal digits>
<string-month>    ::=   "January" | "Jan"
                      | "February" | "Feb"
                      | "March"    | "Mar"
                      | "April"    | "Apr"
                      | "May"
                      | "June"     | "Jun"
                      | "July"     | "Jul"
                      | "August"   | "Aug"
                      | "September"| "Sep"
                      | "October"  | "Oct"
                      | "November" | "Nov"
                      | "December" | "Dec"
<4-digit-year>    ::=   <four decimal digits>
<2-digit-year>    ::=   <two decimal digits>
<time>            ::=   <24-hour-time> "-" <time-zone>
<24-hour-time>    ::=   <hour> <minute>
<hour>            ::=   <two decimal digits>
<minute>          ::=   <two decimal digits>

<time-zone>       ::=   "GMT" | "Z"   | "GDT"
                      | "AST" | "ADT"
                      | "EST" | "EDT" | "CST" | "CDT"
                      | "MST" | "MDT" | "PST" | "PDT"
                      | "YST" | "YDT" | "HST" | "HDT"

<phrase>          ::=   <word>
                      | <word> <phrase>
<phrase-list>     ::=   <null>
                      | <phrase>
                      | <phrase> "," <phrase-list>

<word>            ::=   <atom>
                      | <quoted-string>