rfc724.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 1,576 行 · 第 1/5 页
TXT
1,576 行
white-space-char>.
2) Structure of header fields
Once header fields have been unfolded, they may be viewed
as being composed of a <field-name> followed by a ":"
(colon), followed by a <field-body>. The <field-name>
must be composed of printable ASCII characters (i.e.,
characters which have decimal values between 33 and 126)
and <linear-white-space> characters. The <field-body> may
composed of any ASCII characters (other than <cr> and
<lf>, which have been removed by unfolding).
Certain header fields may be interpreted according to an
internal syntax which some systems may wish to parse.
These fields will be referred to as structured fields.
Examples include fields containing dates and addresses.
Other fields, such as the subject field, are regarded
simply as a single line of text.
3) Field names
To aid in the creation and reading of <field-name>s, the
free insertion of <linear-white-space> characters is
allowed in reasonable places. Rather than obscuring the
syntax specification for <field-name> with the explicit
syntax for these <linear-white-space> characters, the
existence of a simple "lexical" analyzer is assumed. The
analyzer reinterprets the unfolded text which comprises
the <field-name> as a sequence of <atoms> separated by
<linear-white-space> characters. The field name may be
conveniently represented by the sequence of these atoms,
separated by a single ASCII space character.
II. Standard for the Format of Messages / 11
B. Syntax
1. Lexical Analysis
4) Field bodies
To aid in the creation and reading of structured fields,
the free insertion of <linear-white-space> characters is
allowed in reasonable places. Rather than obscuring the
syntax specifications for these structured fields with
explicit syntax for these <linear-white-space> characters,
the existence of another simple "lexical" analyzer is
assumed. It provides an interpretation of the unfolded
text comprising the body of the field as a sequence of
lexical symbols. These include
- individual special characters
- quoted strings
- comments
- atoms
The first three symbols are self-delimiting. Atoms are
not; they therefore are delimited by the self-delimiting
symbols and by <linear-white-space>.
So, for example, the folded body of an address field
":sysmail"@ Some-Host,
Muhammed(I am the greatest)Ali at WBA
is analyzed into the following lexical symbols and types:
":sysmail" quoted string
@ special
Some-Host atom
, special
Muhammed atom
(I am the greatest) comment
Ali atom
at atom
WBA atom
b. Formal Definition
<field> ::= <field-name> ":" <field-body>
<field-name> ::= <atom>
| <atom> <field-name>
<field-body> ::= <field-body-contents>
| <field-body-contents> <crlf>
<linear-white-space-char>
<field-body>
II. Standard for the Format of Messages / 12
B. Syntax
1. Lexical Analysis
<field-body-contents> ::= <the TELNET ASCII characters making
up the <field-body>, as defined in
the following sections, and
consisting of combinations of
<atom>, <quoted-string>, <text-line>,
and <specials> tokens>
<atom> ::= <a sequence of one or more TELNET
ASCII alpha-numeric or graphics
characters, excluding all control
characters (those characters with
a decimal value less than 33 or
equal to 127) and <delimeters> >
<quoted-string> ::= <double quote mark ("), decimal 34>
<a sequence of one or more TELNET
ASCII characters, where two
adjacent quotes are treated as a
single quote and part of the
string> <">
<text-line> ::= <a sequence of one or more TELNET
ASCII characters excluding <cr>
and <lf> >
<message-text> ::= <a sequence of zero of more TELNET
ASCII characters>
<delimeters> ::= <specials> | <comment>
| <linear-white-space> | <crlf>
<specials> ::= "(" | ")" | "<" | ">"
| "@" | "," | ";" | ":" | <">
<comment> ::= "(" <TELNET ASCII characters, except
<crlf> > ")"
<linear-white-space>::= <linear-white-space-char>
| <linear-white-space-char>
<linear-white-space>
<linear-white-space-char>::= <space> | <horizontal-tab>
<space> ::= <TELNET ASCII space (decimal 32)>
<tab> ::= <TELNET ASCII tab (decimal 9)>
<cr> ::= <TELNET ASCII carriage return
(decimal 13)>
<lf> ::= <TELNET ASCII line feed (decimal 10)>
<crlf> ::= <TELNET ASCII carriage return/line
feed (decimal 13, followed by
decimal 10)>
II. Standard for the Format of Messages / 13
B. Syntax
1. Lexical Analysis
c. Clarifications
1) Comments
Comments may appear only within <field-body>s of
structured fields. A comment is any set of TELNET ASCII
characters, which is not within a quoted string, and which
is enclosed in matching parentheses; parentheses nest, so
that if a left paren occurs in a comment string, there
must also be a matching right paren.
Comments are NOT passed to the FTP server, as part of a
MAIL or MLFL command, since comments are not part of the
"formal" address.
2) "White space"
Remember that in structured fields, MULTIPLE LINEAR WHITE
SPACE TELNET ASCII CHARACTERS (namely <tab>s and <space>s)
ARE TREATED AS SINGLE SPACES AND MAY FREELY SURROUND ANY
SYMBOL. In all header fields, at least one <space> is
REQUIRED only at the beginning of folded lines.
Writers of mail-sending (i.e. header generating) programs
should realize that there is no Network-wide definition of
the effect of <tab> TELNET ASCII characters on the
appearance of text at another Network host; therefore, the
use of <tab>s in message headers, though permitted, is
discouraged.
Note that the contents of messages are required to conform
with TELNET NVT conventions (e.g. <cr> must be followed
by either <lf>, making a <crlf>, or <null>, if the <cr> is
to stand alone).
3) Quoted strings
Where permitted (i.e., in structured fields) quoted
strings are treated as a single symbol (i.e. equivalent
to an <atom> syntactically). However, if quoted strings
are to be "folded" onto multiple lines, then the syntax
for folding must be adhered to (See items II.B.1.a.1,
above, and II.B.1.c.6, below.) Note that the official
semantics do not encounter <crlf>s in quoted strings,
although particular parsing programs may wish to note
their presence.
II. Standard for the Format of Messages / 14
B. Syntax
1. Lexical Analysis
4) Bracketing characters
There are two types of brackets which must be well nested:
- Parentheses are used to indicate comments.
- Angle brackets ("<" and ">") are used
where there is a question of the presence
of machine-usable code (e.g. deliminating
mailboxes).
5) Case independence of certain specials <atom>s
It should be assumed by all mail reading programs that
certain <atom>s can be represented in any combination of
upper and lower case. These are:
- <field-name>s,
- "File", in a <path>,
- "at", in an <at-indicator>,
- <host-name>s,
- <day-of-week>s,
- <string-month>s, and
- <time-zone>s
For example, the <field-name>s "From", "FROM", "from", and
even "FroM" should all be treated identically. Note that,
at the level of this specification, case IS relevant to
other <word>s and <text-line>s. Also see Section
II.C.1.a.4, below.
6) Folding long lines
Each header item (field of the message) may be represented
on exactly one line consisting of the name of the field
and its body, and this is what the parser sees. For
readability, it is recommended that the <field-body>
portion of long header items be "folded" onto multiple
lines of the actual header.
7) Backspace characters
Backspace TELNET ASCII characters (ASCII BS, decimal 8)
may be included in <text-line> and <quoted-string> to
effect overstriking; however, any use of backspaces which
effects an overstrike to the left of the beginning of the
<text-line> or <quoted-string> is prohibited.
II. Standard for the Format of Messages / 15
B. Syntax
2. Messages
2. GENERAL SYNTAX OF MESSAGES:
NOTE: The syntax indicates that items in <required-headers>
must be in a specific order and precede all other header
items. Header fields, in fact, are NOT required to occur in
any particular order. Required header items must be unique
(occur exactly once). This specification permits multiple
occurrences of most optional fields. However, the
interpretation of such multiple occurrences is not specified
here.
<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>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?