RFC's
RFC 2822 - Internet Message Format

Network Working Group                                 P. Resnick, Editor

Request for Comments: 2822 QUALCOMM Incorporated

Obsoletes: 822 April 2001

Category: Standards Track

Internet Message Format

Status of this Memo

This document specifies an Internet standards track protocol for the

Internet community, and requests discussion and suggestions for

improvements. Please refer to the current edition of the "Internet

Official Protocol Standards" (STD 1) for the standardization state

and status of this protocol. Distribution of this memo is unlimited.

Copyright Notice

Copyright (C) The Internet Society (2001). All Rights Reserved.

Abstract

This standard specifies a syntax for text messages that are sent

between computer users, within the framework of "electronic mail"

messages. This standard supersedes the one specified in Request For

Comments (RFC) 822, "Standard for the Format of ARPA Internet Text

Messages", updating it to reflect current practice and incorporating

incremental changes that were specified in other RFCs.

Table of Contents

1. Introduction ............................................... 3

1.1. Scope .................................................... 3

1.2. Notational conventions ................................... 4

1.2.1. Requirements notation .................................. 4

1.2.2. Syntactic notation ..................................... 4

1.3. Structure of this document ............................... 4

2. Lexical Analysis of Messages ............................... 5

2.1. General Description ...................................... 5

2.1.1. Line Length Limits ..................................... 6

2.2. Header Fields ............................................ 7

2.2.1. Unstructured Header Field Bodies ....................... 7

2.2.2. Structured Header Field Bodies ......................... 7

2.2.3. Long Header Fields ..................................... 7

2.3. Body ..................................................... 8

3. Syntax ..................................................... 9

3.1. Introduction ............................................. 9

3.2. Lexical Tokens ........................................... 9

3.2.1. Primitive Tokens ....................................... 9

3.2.2. Quoted characters ......................................10

3.2.3. Folding white space and comments .......................11

3.2.4. Atom ...................................................12

3.2.5. Quoted strings .........................................13

3.2.6. Miscellaneous tokens ...................................13

3.3. Date and Time Specification ..............................14

3.4. Address Specification ....................................15

3.4.1. Addr-spec specification ................................16

3.5 Overall message syntax ....................................17

3.6. Field definitions ........................................18

3.6.1. The origination date field .............................20

3.6.2. Originator fields ......................................21

3.6.3. Destination address fields .............................22

3.6.4. Identification fields ..................................23

3.6.5. Informational fields ...................................26

3.6.6. Resent fields ..........................................26

3.6.7. Trace fields ...........................................28

3.6.8. Optional fields ........................................29

4. Obsolete Syntax ............................................29

4.1. Miscellaneous obsolete tokens ............................30

4.2. Obsolete folding white space .............................31

4.3. Obsolete Date and Time ...................................31

4.4. Obsolete Addressing ......................................33

4.5. Obsolete header fields ...................................33

4.5.1. Obsolete origination date field ........................34

4.5.2. Obsolete originator fields .............................34

4.5.3. Obsolete destination address fields ....................34

4.5.4. Obsolete identification fields .........................35

4.5.5. Obsolete informational fields ..........................35

4.5.6. Obsolete resent fields .................................35

4.5.7. Obsolete trace fields ..................................36

4.5.8. Obsolete optional fields ...............................36

5. Security Considerations ....................................36

6. Bibliography ...............................................37

7. Editor's Address ...........................................38

8. Acknowledgements ...........................................39

Appendix A. Example messages ..................................41

A.1. Addressing examples ......................................41

A.1.1. A message from one person to another with simple

addressing .............................................41

A.1.2. Different types of mailboxes ...........................42

A.1.3. Group addresses ........................................43

A.2. Reply messages ...........................................43

A.3. Resent messages ..........................................44

A.4. Messages with trace fields ...............................46

A.5. White space, comments, and other oddities ................47

A.6. Obsoleted forms ..........................................47

A.6.1. Obsolete addressing ....................................48

A.6.2. Obsolete dates .........................................48

A.6.3. Obsolete white space and comments ......................48

Appendix B. Differences from earlier standards ................49

Appendix C. Notices ...........................................50

Full Copyright Statement ......................................51

1. Introduction

1.1. Scope

This standard specifies a syntax for text messages that are sent

between computer users, within the framework of "electronic mail"

messages. This standard supersedes the one specified in Request For

Comments (RFC) 822, "Standard for the Format of ARPA Internet Text

Messages" [RFC822], updating it to reflect current practice and

incorporating incremental changes that were specified in other RFCs

[STD3].

This standard specifies a syntax only for text messages. In

particular, it makes no provision for the transmission of images,

audio, or other sorts of structured data in electronic mail messages.

There are several extensions published, such as the MIME document

series [RFC2045, RFC2046, RFC2049], which describe mechanisms for the

transmission of such data through electronic mail, either by

extending the syntax provided here or by structuring such messages to

conform to this syntax. Those mechanisms are outside of the scope of

this standard.

In the context of electronic mail, messages are viewed as having an

envelope and contents. The envelope contains whatever information is

needed to accomplish transmission and delivery. (See [RFC2821] for a

discussion of the envelope.) The contents comprise the object to be

delivered to the recipient. This standard applies only to the format

and some of the semantics of message contents. It contains no

specification of the information in the envelope.

However, some message systems may use information from the contents

to create the envelope. It is intended that this standard facilitate

the acquisition of such information by programs.

This specification is intended as a definition of what message

content format is to be passed between systems. Though some message

systems locally store messages in this format (which eliminates the

need for translation between formats) and others use formats that

differ from the one specified in this standard, local storage is

outside of the scope of this standard.

Note: This standard is not intended to dictate the internal formats

used by sites, the specific message system features that they are

expected to support, or any of the characteristics of user interface

programs that create or read messages. In addition, this standard

does not specify an encoding of the characters for either transport

or storage; that is, it does not specify the number of bits used or

how those bits are specifically transferred over the wire or stored

on disk.

1.2. Notational conventions

1.2.1. Requirements notation

This document occasionally uses terms that appear in capital letters.

When the terms "MUST", "SHOULD", "RECOMMENDED", "MUST NOT", "SHOULD

NOT", and "MAY" appear capitalized, they are being used to indicate

particular requirements of this specification. A discussion of the

meanings of these terms appears in [RFC2119].

1.2.2. Syntactic notation

This standard uses the Augmented Backus-Naur Form (ABNF) notation

specified in [RFC2234] for the formal definitions of the syntax of

messages. Characters will be specified either by a decimal value

(e.g., the value %d65 for uppercase A and %d97 for lowercase A) or by

a case-insensitive literal value enclosed in quotation marks (e.g.,

"A" for either uppercase or lowercase A). See [RFC2234] for the full

description of the notation.

1.3. Structure of this document

This document is divided into several sections.

This section, section 1, is a short introduction to the document.

Section 2 lays out the general description of a message and its

constituent parts. This is an overview to help the reader understand

some of the general principles used in the later portions of this

document. Any examples in this section MUST NOT be taken as

specification of the formal syntax of any part of a message.

Section 3 specifies formal ABNF rules for the structure of each part

of a message (the syntax) and describes the relationship between

those parts and their meaning in the context of a message (the

semantics). That is, it describes the actual rules for the structure

of each part of a message (the syntax) as well as a description of

the parts and instructions on how they ought to be interpreted (the

semantics). This includes analysis of the syntax and semantics of

subparts of messages that have specific structure. The syntax

included in section 3 represents messages as they MUST be created.

There are also notes in section 3 to indicate if any of the options

specified in the syntax SHOULD be used over any of the others.

Both sections 2 and 3 describe messages that are legal to generate

for purposes of this standard.

Section 4 of this document specifies an "obsolete" syntax. There are

references in section 3 to these obsolete syntactic elements. The

rules of the obsolete syntax are elements that have appeared in

earlier revisions of this standard or have previously been widely

used in Internet messages. As such, these elements MUST be

interpreted by parsers of messages in order to be conformant to this

standard. However, since items in this syntax have been determined

to be non-interoperable or to cause significant problems for

recipients of messages, they MUST NOT be generated by creators of

conformant messages.

Section 5 details security considerations to take into account when

implementing this standard.

Section 6 is a bibliography of references in this document.

Section 7 contains the editor's address.

Section 8 contains acknowledgements.

Appendix A lists examples of different sorts of messages. These

examples are not exhaustive of the types of messages that appear on

the Internet, but give a broad overview of certain syntactic forms.

Appendix B lists the differences between this standard and earlier

standards for Internet messages.

Appendix C has copyright and intellectual property notices.

2. Lexical Analysis of Messages

2.1. General Description

At the most basic level, a message is a series of characters. A

message that is conformant with this standard is comprised of

characters with values in the range 1 through 127 and interpreted as

US-ASCII characters [ASCII]. For brevity, this document sometimes

refers to this range of characters as simply "US-ASCII characters".

Note: This standard specifies that messages are made up of characters

in the US-ASCII range of 1 through 127. There are other documents,

specifically the MIME document series [RFC2045, RFC2046, RFC2047,

RFC2048, RFC2049], that extend this standard to allow for values

outside of that range. Discussion of those mechanisms is not within

the scope of this standard.

Messages are divided into lines of characters. A line is a series of

characters that is delimited with the two characters carriage-return

and line-feed; that is, the carriage return (CR) character (ASCII

value 13) followed immediately by the line feed (LF) character (ASCII

value 10). (The carriage-return/line-feed pair is usually written in

this document as "CRLF".)

A message consists of header fields (collectively called "the header

of the message") followed, optionally, by a body. The header is a

sequence of lines of characters with special syntax as defined in

this standard. The body is simply a sequence of characters that

follows the header and is separated from the header by an empty line

(i.e., a line with nothing preceding the CRLF).

2.1.1. Line Length Limits

There are two limits that this standard places on the number of

characters in a line. Each line of characters MUST be no more than

998 characters, and SHOULD be no more than 78 characters, excluding

the CRLF.

The 998 character limit is due to limitations in many implementations

which send, receive, or store Internet Message Format messages that

simply cannot handle more than 998 characters on a line. Receiving

implementations would do well to handle an arbitrarily large number

of characters in a line for robustness sake. However, there are so

many implementations which (in compliance with the transport

requirements of [RFC2821]) do not accept messages containing more

than 1000 character including the CR and LF per line, it is important

for implementations not to create such messages.

The more conservative 78 character recommendation is to accommodate

the many implementations of user interfaces that display these

messages which may truncate, or disastrously wrap, the display of

more than 78 characters per line, in spite of the fact that such

implementations are non-conformant to the intent of this

specification (and that of [RFC2821] if they actually cause

information to be lost). Again, even though this limitation is put on

messages, it is encumbant upon implementations which display messages

to handle an arbitrarily large number of characters in a line

(certainly at least up to the 998 character limit) for the sake of

robustness.

2.2. Header Fields

Header fields are lines composed of a field name, followed by a colon

(":"), followed by a field body, and terminated by CRLF. A field

name MUST be composed of printable US-ASCII characters (i.e.,

characters that have values between 33 and 126, inclusive), except

colon. A field body may be composed of any US-ASCII characters,

except for CR and LF. However, a field body may contain CRLF when

used in header "folding" and "unfolding" as described in section

2.2.3. All field bodies MUST conform to the syntax described in

sections 3 and 4 of this standard.

2.2.1. Unstructured Header Field Bodies

Some field bodies in this standard are defined simply as

"unstructured" (which is specified below as any US-ASCII characters,

except for CR and LF) with no further restrictions. These are

referred to as unstructured field bodies. Semantically, unstructured

field bodies are simply to be treated as a single line of characters

with no further processing (except for header "folding" and

"unfolding" as described in section 2.2.3).

2.2.2. Structured Header Field Bodies

Some field bodies in this standard have specific syntactical

structure more restrictive than the unstructured field bodies

described above. These are referred to as "structured" field bodies.

Structured field bodies are sequences of specific lexical tokens as

described in sections 3 and 4 of this standard. Many of these tokens

are allowed (according to their syntax) to be introduced or end with

comments (as described in section 3.2.3) as well as the space (SP,

ASCII value 32) and horizontal tab (HTAB, ASCII value 9) characters

(together known as the white space characters, WSP), and those WSP

characters are subject to header "folding" and "unfolding" as

described in section 2.2.3. Semantic analysis of structured field

bodies is given along with their syntax.

2.2.3. Long Header Fields

Each header field is logically a single line of characters comprising

the field name, the colon, and the field body. For convenience

however, and to deal with the 998/78 character limitations per line,

the field body portion of a header field can be split into a multiple

line representation; this is called "folding". The general rule is

that wherever this standard allows for folding white space (not

simply WSP characters), a CRLF may be inserted before any WSP. For

example, the header field:

Subject: This is a test

can be represented as:

Subject: This

is a test

Note: Though structured field bodies are defined in such a way that

folding can take place between many of the lexical tokens (and even

within some of the lexical tokens), folding SHOULD be limited to

placing the CRLF at higher-level syntactic breaks. For instance, if

a field body is defined as comma-separated values, it is recommended

that folding occur after the comma separating the structured items in

preference to other places where the field could be folded, even if

it is allowed elsewhere.

The process of moving from this folded multiple-line representation

of a header field to its single line representation is called

"unfolding". Unfolding is accomplished by simply removing any CRLF

that is immediately followed by WSP. Each header field should be

treated in its unfolded form for further syntactic and semantic

evaluation.

2.3. Body

The body of a message is simply lines of US-ASCII characters. The

only two limitations on the body are as follows:

- CR and LF MUST only occur together as CRLF; they MUST NOT appear

independently in the body.

- Lines of characters in the body MUST be limited to 998 characters,

and SHOULD be limited to 78 characters, excluding the CRLF.

Note: As was stated earlier, there are other standards documents,

specifically the MIME documents [RFC2045, RFC2046, RFC2048, RFC2049]

that extend this standard to allow for different sorts of message

bodies. Again, these mechanisms are beyond the scope of this

document.

3. Syntax

3.1. Introduction

The syntax as given in this section defines the legal syntax of

Internet messages. Messages that are conformant to this standard

MUST conform to the syntax in this section. If there are options in

this section where one option SHOULD be generated, that is indicated

either in the prose or in a comment next to the syntax.

For the defined expressions, a short description of the syntax and

use is given, followed by the syntax in ABNF, followed by a semantic

analysis. Primitive tokens that are used but otherwise unspecified

come from [RFC2234].

In some of the definitions, there will be nonterminals whose names

start with "obs-". These "obs-" elements refer to tokens defined in

the obsolete syntax in section 4. In all cases, these productions

are to be ignored for the purposes of generating legal Internet

messages and MUST NOT be used as part of such a message. However,

when interpreting messages, these tokens MUST be honored as part of

the legal syntax. In this sense, section 3 defines a grammar for

generation of messages, with "obs-" elements that are to be ignored,

while section 4 adds grammar for interpretation of messages.

3.2. Lexical Tokens

The following rules are used to define an underlying lexical

analyzer, which feeds tokens to the higher-level parsers. This

section defines the tokens used in structured header field bodies.

Note: Readers of this standard need to pay special attention to how

these lexical tokens are used in both the lower-level and

higher-level syntax later in the document. Particularly, the white

space tokens and the comment tokens defined in section 3.2.3 get used

in the lower-level tokens defined here, and those lower-level tokens

are in turn used as parts of the higher-level tokens defined later.

Therefore, the white space and comments may be allowed in the

higher-level tokens even though they may not explicitly appear in a

particular definition.

3.2.1. Primitive Tokens

The following are primitive tokens referred to elsewhere in this

standard, but not otherwise defined in [RFC2234]. Some of them will

not appear anywhere else in the syntax, but they are convenient to

refer to in other parts of this document.

Note: The "specials" below are just such an example. Though the

specials token does not appear anywhere else in this standard, it is

useful for implementers who use tools that lexically analyze

messages. Each of the characters in specials can be used to indicate

a tokenization point in lexical analysis.

NO-WS-CTL = %d1-8 / ; US-ASCII control characters

%d11 / ; that do not include the

%d12 / ; carriage return, line feed,

%d14-31 / ; and white space characters

%d127

text = %d1-9 / ; Characters excluding CR and LF

%d11 /

%d12 /

%d14-127 /

obs-text

specials = "(" / ")" / ; Special characters used in

"<" / ">" / ; other parts of the syntax

"[" / "]" /

":" / ";" /

"@" / "\" /

"," / "." /

DQUOTE

No special semantics are attached to these tokens. They are simply

single characters.

3.2.2. Quoted characters

Some characters are reserved for special interpretation, such as

delimiting lexical tokens. To permit use of these characters as

uninterpreted data, a quoting mechanism is provided.

quoted-pair = ("\" text) / obs-qp

Where any quoted-pair appears, it is to be interpreted as the text

character alone. That is to say, the "\" character that appears as

part of a quoted-pair is semantically "invisible".

Note: The "\" character may appear in a message where it is not part

of a quoted-pair. A "\" character that does not appear in a

quoted-pair is not semantically invisible. The only places in this

standard where quoted-pair currently appears are ccontent, qcontent,

dcontent, no-fold-quote, and no-fold-literal.

3.2.3. Folding white space and comments

White space characters, including white space used in folding

(described in section 2.2.3), may appear between many elements in

header field bodies. Also, strings of characters that are treated as

comments may be included in structured field bodies as characters

enclosed in parentheses. The following defines the folding white

space (FWS) and comment constructs.

Strings of characters enclosed in parentheses are considered comments

so long as they do not appear within a "quoted-string", as defined in

section 3.2.5. Comments may nest.

There are several places in this standard where comments and FWS may

be freely inserted. To accommodate that syntax, an additional token

for "CFWS" is defined for places where comments and/or FWS can occur.

However, where CFWS occurs in this standard, it MUST NOT be inserted

in such a way that any line of a folded header field is made up

entirely of WSP characters and nothing else.

FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space

obs-FWS

ctext = NO-WS-CTL / ; Non white space controls

%d33-39 / ; The rest of the US-ASCII

%d42-91 / ; characters not including "(",

%d93-126 ; ")", or "\"

ccontent = ctext / quoted-pair / comment

comment = "(" *([FWS] ccontent) [FWS] ")"

CFWS = *([FWS] comment) (([FWS] comment) / FWS)

Throughout this standard, where FWS (the folding white space token)

appears, it indicates a place where header folding, as discussed in

section 2.2.3, may take place. Wherever header folding appears in a

message (that is, a header field body containing a CRLF followed by

any WSP), header unfolding (removal of the CRLF) is performed before

any further lexical analysis is performed on that header field

according to this standard. That is to say, any CRLF that appears in

FWS is semantically "invisible."

A comment is normally used in a structured field body to provide some

human readable informational text. Since a comment is allowed to

contain FWS, folding is permitted within the comment. Also note that

since quoted-pair is allowed in a comment, the parentheses and

backslash characters may appear in a comment so long as they appear

as a quoted-pair. Semantically, the enclosing parentheses are not

part of the comment; the comment is what is contained between the two

parentheses. As stated earlier, the "\" in any quoted-pair and the

CRLF in any FWS that appears within the comment are semantically

"invisible" and therefore not part of the comment either.

Runs of FWS, comment or CFWS that occur between lexical tokens in a

structured field header are semantically interpreted as a single

space character.

3.2.4. Atom

Several productions in structured header field bodies are simply

strings of certain basic characters. Such productions are called

atoms.

Some of the structured header field bodies also allow the period

character (".", ASCII value 46) within runs of atext. An additional

"dot-atom" token is defined for those purposes.

atext = ALPHA / DIGIT / ; Any character except controls,

"!" / "#" / ; SP, and specials.

"$" / "%" / ; Used for atoms

"&" / "'" /

"*" / "+" /

"-" / "/" /

"=" / "?" /

"^" / "_" /

"`" / "{" /

"|" / "}" /

"~"

atom = [CFWS] 1*atext [CFWS]

dot-atom = [CFWS] dot-atom-text [CFWS]

dot-atom-text = 1*atext *("." 1*atext)

Both atom and dot-atom are interpreted as a single unit, comprised of

the string of characters that make it up. Semantically, the optional

comments and FWS surrounding the rest of the characters are not part

of the atom; the atom is only the run of atext characters in an atom,

or the atext and "." characters in a dot-atom.

3.2.5. Quoted strings

Strings of characters that include characters other than those

allowed in atoms may be represented in a quoted string format, where

the characters are surrounded by quote (DQUOTE, ASCII value 34)

characters.

qtext = NO-WS-CTL / ; Non white space controls

%d33 / ; The rest of the US-ASCII

%d35-91 / ; characters not including "\"

%d93-126 ; or the quote character

qcontent = qtext / quoted-pair

quoted-string = [CFWS]

DQUOTE *([FWS] qcontent) [FWS] DQUOTE

[CFWS]

A quoted-string is treated as a unit. That is, quoted-string is

identical to atom, semantically. Since a quoted-string is allowed to

contain FWS, folding is permitted. Also note that since quoted-pair

is allowed in a quoted-string, the quote and backslash characters may

appear in a quoted-string so long as they appear as a quoted-pair.

Semantically, neither the optional CFWS outside of the quote

characters nor the quote characters themselves are part of the

quoted-string; the quoted-string is what is contained between the two

quote characters. As stated earlier, the "\" in any quoted-pair and

the CRLF in any FWS/CFWS that appears within the quoted-string are

semantically "invisible" and therefore not part of the quoted-string

either.

3.2.6. Miscellaneous tokens

Three additional tokens are defined, word and phrase for combinations

of atoms and/or quoted-strings, and unstructured for use in

unstructured header fields and in some places within structured

header fields.

word = atom / quoted-string

phrase = 1*word / obs-phrase

utext = NO-WS-CTL / ; Non white space controls

%d33-126 / ; The rest of US-ASCII

obs-utext

unstructured = *([FWS] utext) [FWS]

3.3. Date and Time Specification

Date and time occur in several header fields. This section specifies

the syntax for a full date and time specification. Though folding

white space is permitted throughout the date-time specification, it

is RECOMMENDED that a single space be used in each place that FWS

appears (whether it is required or optional); some older

implementations may not interpret other occurrences of folding white

space correctly.

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

day-of-week = ([FWS] day-name) / obs-day-of-week

day-name = "Mon" / "Tue" / "Wed" / "Thu" /

"Fri" / "Sat" / "Sun"

date = day month year

year = 4*DIGIT / obs-year

month = (FWS month-name FWS) / obs-month

month-name = "Jan" / "Feb" / "Mar" / "Apr" /

"May" / "Jun" / "Jul" / "Aug" /

"Sep" / "Oct" / "Nov" / "Dec"

day = ([FWS] 1*2DIGIT) / obs-day

time = time-of-day FWS zone

time-of-day = hour ":" minute [ ":" second ]

hour = 2DIGIT / obs-hour

minute = 2DIGIT / obs-minute

second = 2DIGIT / obs-second

zone = (( "+" / "-" ) 4DIGIT) / obs-zone

The day is the numeric day of the month. The year is any numeric

year 1900 or later.

The time-of-day specifies the number of hours, minutes, and

optionally seconds since midnight of the date indicated.

The date and time-of-day SHOULD express local time.

The zone specifies the offset from Coordinated Universal Time (UTC,

formerly referred to as "Greenwich Mean Time") that the date and

time-of-day represent. The "+" or "-" indicates whether the

time-of-day is ahead of (i.e., east of) or behind (i.e., west of)

Universal Time. The first two digits indicate the number of hours

difference from Universal Time, and the last two digits indicate the

number of minutes difference from Universal Time. (Hence, +hhmm

means +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm)

minutes). The form "+0000" SHOULD be used to indicate a time zone at

Universal Time. Though "-0000" also indicates Universal Time, it is

used to indicate that the time was generated on a system that may be

in a local time zone other than Universal Time and therefore

indicates that the date-time contains no information about the local

time zone.

A date-time specification MUST be semantically valid. That is, the

day-of-the-week (if included) MUST be the day implied by the date,

the numeric day-of-month MUST be between 1 and the number of days

allowed for the specified month (in the specified year), the

time-of-day MUST be in the range 00:00:00 through 23:59:60 (the

number of seconds allowing for a leap second; see [STD12]), and the

zone MUST be within the range -9959 through +9959.

3.4. Address Specification

Addresses occur in several message header fields to indicate senders

and recipients of messages. An address may either be an individual

mailbox, or a group of mailboxes.

address = mailbox / group

mailbox = name-addr / addr-spec

name-addr = [display-name] angle-addr

angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr

group = display-name ":" [mailbox-list / CFWS] ";"

[CFWS]

display-name = phrase

mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list

address-list = (address *("," address)) / obs-addr-list

A mailbox receives mail. It is a conceptual entity which does not

necessarily pertain to file storage. For example, some sites may

choose to print mail on a printer and deliver the output to the

addressee's desk. Normally, a mailbox is comprised of two parts: (1)

an optional display name that indicates the name of the recipient

(which could be a person or a system) that could be displayed to the

user of a mail application, and (2) an addr-spec address enclosed in

angle brackets ("<" and ">"). There is also an alternate simple form

of a mailbox where the addr-spec address appears alone, without the

recipient's name or the angle brackets. The Internet addr-spec

address is described in section 3.4.1.

Note: Some legacy implementations used the simple form where the

addr-spec appears without the angle brackets, but included the name

of the recipient in parentheses as a comment following the addr-spec.

Since the meaning of the information in a comment is unspecified,

implementations SHOULD use the full name-addr form of the mailbox,

instead of the legacy form, to specify the display name associated

with a mailbox. Also, because some legacy implementations interpret

the comment, comments generally SHOULD NOT be used in address fields

to avoid confusing such implementations.

When it is desirable to treat several mailboxes as a single unit

(i.e., in a distribution list), the group construct can be used. The

group construct allows the sender to indicate a named group of

recipients. This is done by giving a display name for the group,

followed by a colon, followed by a comma separated list of any number

of mailboxes (including zero and one), and ending with a semicolon.

Because the list of mailboxes can be empty, using the group construct

is also a simple way to communicate to recipients that the message

was sent to one or more named sets of recipients, without actually

providing the individual mailbox address for each of those

recipients.

3.4.1. Addr-spec specification

An addr-spec is a specific Internet identifier that contains a

locally interpreted string followed by the at-sign character ("@",

ASCII value 64) followed by an Internet domain. The locally

interpreted string is either a quoted-string or a dot-atom. If the

string can be represented as a dot-atom (that is, it contains no

characters other than atext characters or "." surrounded by atext

characters), then the dot-atom form SHOULD be used and the

quoted-string form SHOULD NOT be used. Comments and folding white

space SHOULD NOT be used around the "@" in the addr-spec.

addr-spec = local-part "@" domain

local-part = dot-atom / quoted-string / obs-local-part

domain = dot-atom / domain-literal / obs-domain

domain-literal = [CFWS] "[" *([FWS] dcontent) [FWS] "]" [CFWS]

dcontent = dtext / quoted-pair

dtext = NO-WS-CTL / ; Non white space controls

%d33-90 / ; The rest of the US-ASCII

%d94-126 ; characters not including "[",

; "]", or "\"

The domain portion identifies the point to which the mail is

delivered. In the dot-atom form, this is interpreted as an Internet

domain name (either a host name or a mail exchanger name) as

described in [STD3, STD13, STD14]. In the domain-literal form, the

domain is interpreted as the literal Internet address of the

particular host. In both cases, how addressing is used and how

messages are transported to a particular host is covered in the mail

transport document [RFC2821]. These mechanisms are outside of the

scope of this document.

The local-part portion is a domain dependent string. In addresses,

it is simply interpreted on the particular host as a name of a

particular mailbox.

3.5 Overall message syntax

A message consists of header fields, optionally followed by a message

body. Lines in a message MUST be a maximum of 998 characters

excluding the CRLF, but it is RECOMMENDED that lines be limited to 78

characters excluding the CRLF. (See section 2.1.1 for explanation.)

In a message body, though all of the characters listed in the text

rule MAY be used, the use of US-ASCII control characters (values 1

through 8, 11, 12, and 14 through 31) is discouraged since their

interpretation by receivers for display is not guaranteed.

message = (fields / obs-fields)

[CRLF body]

body = *(*998text CRLF) *998text

The header fields carry most of the semantic information and are

defined in section 3.6. The body is simply a series of lines of text

which are uninterpreted for the purposes of this standard.

3.6. Field definitions

The header fields of a message are defined here. All header fields

have the same general syntactic structure: A field name, followed by

a colon, followed by the field body. The specific syntax for each

header field is defined in the subsequent sections.

Note: In the ABNF syntax for each field in subsequent sections, each

field name is followed by the required colon. However, for brevity

sometimes the colon is not referred to in the textual description of

the syntax. It is, nonetheless, required.

It is important to note that the header fields are not guaranteed to

be in a particular order. They may appear in any order, and they

have been known to be reordered occasionally when transported over

the Internet. However, for the purposes of this standard, header

fields SHOULD NOT be reordered when a message is transported or

transformed. More importantly, the trace header fields and resent

header fields MUST NOT be reordered, and SHOULD be kept in blocks

prepended to the message. See sections 3.6.6 and 3.6.7 for more

information.

The only required header fields are the origination date field and

the originator address field(s). All other header fields are

syntactically optional. More information is contained in the table

following this definition.

fields = *(trace

*(resent-date /

resent-from /

resent-sender /

resent-to /

resent-cc /

resent-bcc /

resent-msg-id))

*(orig-date /

from /

sender /

reply-to /

to /

cc /

bcc /

message-id /

in-reply-to /

references /

subject /

comments /

keywords /

optional-field)

The following table indicates limits on the number of times each

field may occur in a message header as well as any special

limitations on the use of those fields. An asterisk next to a value

in the minimum or maximum column indicates that a special restriction

appears in the Notes column.

Field Min number Max number Notes

trace 0 unlimited Block prepended - see

3.6.7

resent-date 0* unlimited* One per block, required

if other resent fields

present - see 3.6.6

resent-from 0 unlimited* One per block - see

3.6.6

resent-sender 0* unlimited* One per block, MUST

occur with multi-address

resent-from - see 3.6.6

resent-to 0 unlimited* One per block - see

3.6.6

resent-cc 0 unlimited* One per block - see

3.6.6

resent-bcc 0 unlimited* One per block - see

3.6.6

resent-msg-id 0 unlimited* One per block - see

3.6.6

orig-date 1 1

from 1 1 See sender and 3.6.2

sender 0* 1 MUST occur with multi-

address from - see 3.6.2

reply-to 0 1

to 0 1

cc 0 1

bcc 0 1

message-id 0* 1 SHOULD be present - see

3.6.4

in-reply-to 0* 1 SHOULD occur in some

replies - see 3.6.4

references 0* 1 SHOULD occur in some

replies - see 3.6.4

subject 0 1

comments 0 unlimited

keywords 0 unlimited

optional-field 0 unlimited

The exact interpretation of each field is described in subsequent

sections.

3.6.1. The origination date field

The origination date field consists of the field name "Date" followed

by a date-time specification.

orig-date = "Date:" date-time CRLF

The origination date specifies the date and time at which the creator

of the message indicated that the message was complete and ready to

enter the mail delivery system. For instance, this might be the time

that a user pushes the "send" or "submit" button in an application

program. In any case, it is specifically not intended to convey the

time that the message is actually transported, but rather the time at

which the human or other creator of the message has put the message

into its final form, ready for transport. (For example, a portable

computer user who is not connected to a network might queue a message

for delivery. The origination date is intended to contain the date

and time that the user queued the message, not the time when the user

connected to the network to send the message.)

3.6.2. Originator fields

The originator fields of a message consist of the from field, the

sender field (when applicable), and optionally the reply-to field.

The from field consists of the field name "From" and a

comma-separated list of one or more mailbox specifications. If the

from field contains more than one mailbox specification in the

mailbox-list, then the sender field, containing the field name

"Sender" and a single mailbox specification, MUST appear in the

message. In either case, an optional reply-to field MAY also be

included, which contains the field name "Reply-To" and a

comma-separated list of one or more addresses.

from = "From:" mailbox-list CRLF

sender = "Sender:" mailbox CRLF

reply-to = "Reply-To:" address-list CRLF

The originator fields indicate the mailbox(es) of the source of the

message. The "From:" field specifies the author(s) of the message,

that is, the mailbox(es) of the person(s) or system(s) responsible

for the writing of the message. The "Sender:" field specifies the

mailbox of the agent responsible for the actual transmission of the

message. For example, if a secretary were to send a message for

another person, the mailbox of the secretary would appear in the

"Sender:" field and the mailbox of the actual author would appear in

the "From:" field. If the originator of the message can be indicated

by a single mailbox and the author and transmitter are identical, the

"Sender:" field SHOULD NOT be used. Otherwise, both fields SHOULD

appear.

The originator fields also provide the information required when

replying to a message. When the "Reply-To:" field is present, it

indicates the mailbox(es) to which the author of the message suggests

that replies be sent. In the absence of the "Reply-To:" field,

replies SHOULD by default be sent to the mailbox(es) specified in the

"From:" field unless otherwise specified by the person composing the

reply.

In all cases, the "From:" field SHOULD NOT contain any mailbox that

does not belong to the author(s) of the message. See also section

3.6.3 for more information on forming the destination addresses for a

reply.

3.6.3. Destination address fields

The destination fields of a message consist of three possible fields,

each of the same form: The field name, which is either "To", "Cc", or

"Bcc", followed by a comma-separated list of one or more addresses

(either mailbox or group syntax).

to = "To:" address-list CRLF

cc = "Cc:" address-list CRLF

bcc = "Bcc:" (address-list / [CFWS]) CRLF

The destination fields specify the recipients of the message. Each

destination field may have one or more addresses, and each of the

addresses indicate the intended recipients of the message. The only

difference between the three fields is how each is used.

The "To:" field contains the address(es) of the primary recipient(s)

of the message.

The "Cc:" field (where the "Cc" means "Carbon Copy" in the sense of

making a copy on a typewriter using carbon paper) contains the

addresses of others who are to receive the message, though the

content of the message may not be directed at them.

The "Bcc:" field (where the "Bcc" means "Blind Carbon Copy") contains

addresses of recipients of the message whose addresses are not to be

revealed to other recipients of the message. There are three ways in

which the "Bcc:" field is used. In the first case, when a message

containing a "Bcc:" field is prepared to be sent, the "Bcc:" line is

removed even though all of the recipients (including those specified

in the "Bcc:" field) are sent a copy of the message. In the second

case, recipients specified in the "To:" and "Cc:" lines each are sent

a copy of the message with the "Bcc:" line removed as above, but the

recipients on the "Bcc:" line get a separate copy of the message

containing a "Bcc:" line. (When there are multiple recipient

addresses in the "Bcc:" field, some implementations actually send a

separate copy of the message to each recipient with a "Bcc:"

containing only the address of that particular recipient.) Finally,

since a "Bcc:" field may contain no addresses, a "Bcc:" field can be

sent without any addresses indicating to the recipients that blind

copies were sent to someone. Which method to use with "Bcc:" fields

is implementation dependent, but refer to the "Security

Considerations" section of this document for a discussion of each.

When a message is a reply to another message, the mailboxes of the

authors of the original message (the mailboxes in the "From:" field)

or mailboxes specified in the "Reply-To:" field (if it exists) MAY

appear in the "To:" field of the reply since these would normally be

the primary recipients of the reply. If a reply is sent to a message

that has destination fields, it is often desirable to send a copy of

the reply to all of the recipients of the message, in addition to the

author. When such a reply is formed, addresses in the "To:" and

"Cc:" fields of the original message MAY appear in the "Cc:" field of

the reply, since these are normally secondary recipients of the

reply. If a "Bcc:" field is present in the original message,

addresses in that field MAY appear in the "Bcc:" field of the reply,

but SHOULD NOT appear in the "To:" or "Cc:" fields.

Note: Some mail applications have automatic reply commands that

include the destination addresses of the original message in the

destination addresses of the reply. How those reply commands behave

is implementation dependent and is beyond the scope of this document.

In particular, whether or not to include the original destination

addresses when the original message had a "Reply-To:" field is not

addressed here.

3.6.4. Identification fields

Though optional, every message SHOULD have a "Message-ID:" field.

Furthermore, reply messages SHOULD have "In-Reply-To:" and

"References:" fields as appropriate, as described below.

The "Message-ID:" field contains a single unique message identifier.

The "References:" and "In-Reply-To:" field each contain one or more

unique message identifiers, optionally separated by CFWS.

The message identifier (msg-id) is similar in syntax to an angle-addr

construct without the internal CFWS.

message-id = "Message-ID:" msg-id CRLF

in-reply-to = "In-Reply-To:" 1*msg-id CRLF

references = "References:" 1*msg-id CRLF

msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS]

id-left = dot-atom-text / no-fold-quote / obs-id-left

id-right = dot-atom-text / no-fold-literal / obs-id-right

no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE

no-fold-literal = "[" *(dtext / quoted-pair) "]"

The "Message-ID:" field provides a unique message identifier that

refers to a particular version of a particular message. The

uniqueness of the message identifier is guaranteed by the host that

generates it (see below). This message identifier is intended to be

machine readable and not necessarily meaningful to humans. A message

identifier pertains to exactly one instantiation of a particular

message; subsequent revisions to the message each receive new message

identifiers.

Note: There are many instances when messages are "changed", but those

changes do not constitute a new instantiation of that message, and

therefore the message would not get a new message identifier. For

example, when messages are introduced into the transport system, they

are often prepended with additional header fields such as trace

fields (described in section 3.6.7) and resent fields (described in

section 3.6.6). The addition of such header fields does not change

the identity of the message and therefore the original "Message-ID:"

field is retained. In all cases, it is the meaning that the sender

of the message wishes to convey (i.e., whether this is the same

message or a different message) that determines whether or not the

"Message-ID:" field changes, not any particular syntactic difference

that appears (or does not appear) in the message.

The "In-Reply-To:" and "References:" fields are used when creating a

reply to a message. They hold the message identifier of the original

message and the message identifiers of other messages (for example,

in the case of a reply to a message which was itself a reply). The

"In-Reply-To:" field may be used to identify the message (or

messages) to which the new message is a reply, while the

"References:" field may be used to identify a "thread" of

conversation.

When creating a reply to a message, the "In-Reply-To:" and

"References:" fields of the resultant message are constructed as

follows:

The "In-Reply-To:" field will contain the contents of the "Message-

ID:" field of the message to which this one is a reply (the "parent

message"). If there is more than one parent message, then the "In-

Reply-To:" field will contain the contents of all of the parents'

"Message-ID:" fields. If there is no "Message-ID:" field in any of

the parent messages, then the new message will have no "In-Reply-To:"

field.

The "References:" field will contain the contents of the parent's

"References:" field (if any) followed by the contents of the parent's

"Message-ID:" field (if any). If the parent message does not contain

a "References:" field but does have an "In-Reply-To:" field

containing a single message identifier, then the "References:" field

will contain the contents of the parent's "In-Reply-To:" field

followed by the contents of the parent's "Message-ID:" field (if

any). If the parent has none of the "References:", "In-Reply-To:",

or "Message-ID:" fields, then the new message will have no

"References:" field.

Note: Some implementations parse the "References:" field to display

the "thread of the discussion". These implementations assume that

each new message is a reply to a single parent and hence that they

can walk backwards through the "References:" field to find the parent

of each message listed there. Therefore, trying to form a

"References:" field for a reply that has multiple parents is

discouraged and how to do so is not defined in this document.

The message identifier (msg-id) itself MUST be a globally unique

identifier for a message. The generator of the message identifier

MUST guarantee that the msg-id is unique. There are several

algorithms that can be used to accomplish this. Since the msg-id has

a similar syntax to angle-addr (identical except that comments and

folding white space are not allowed), a good method is to put the

domain name (or a domain literal IP address) of the host on which the

message identifier was created on the right hand side of the "@", and

put a combination of the current absolute date and time along with

some other currently unique (perhaps sequential) identifier available

on the system (for example, a process id number) on the left hand

side. Using a date on the left hand side and a domain name or domain

literal on the right hand side makes it possible to guarantee

uniqueness since no two hosts use the same domain name or IP address

at the same time. Though other algorithms will work, it is

RECOMMENDED that the right hand side contain some domain identifier

(either of the host itself or otherwise) such that the generator of

the message identifier can guarantee the uniqueness of the left hand

side within the scope of that domain.

Semantically, the angle bracket characters are not part of the

msg-id; the msg-id is what is contained between the two angle bracket

characters.

3.6.5. Informational fields

The informational fields are all optional. The "Keywords:" field

contains a comma-separated list of one or more words or

quoted-strings. The "Subject:" and "Comments:" fields are

unstructured fields as defined in section 2.2.1, and therefore may

contain text or folding w

&lt;PRE&gt;Network Working Group P. Resnick, Editor Request for Comments: 2822 QUALCOMM Incorporated Obsoletes: 822 April 2001 Category: Standards Track Internet Message Format Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the &quot;Internet Official Protocol Standards&quot; (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited. Copyright Notice Copyright (C) The Internet Society (2001). All Rights Reserved. Abstract This standard specifies a syntax for text messages that are sent between computer users, within the framework of &quot;electronic mail&quot; messages. This standard supersedes the one specified in Request For Comments (RFC) 822, &quot;Standard for the Format of ARPA Internet Text Messages&quot;, updating it to reflect current practice and incorporating incremental changes that were specified in other RFCs. Table of Contents 1. Introduction ............................................... 3 1.1. Scope .................................................... 3 1.2. Notational conventions ................................... 4 1.2.1. Requirements notation .................................. 4 1.2.2. Syntactic notation ..................................... 4 1.3. Structure of this document ............................... 4 2. Lexical Analysis of Messages ............................... 5 2.1. General Description ...................................... 5 2.1.1. Line Length Limits ..................................... 6 2.2. Header Fields ............................................ 7 2.2.1. Unstructured Header Field Bodies ....................... 7 2.2.2. Structured Header Field Bodies ......................... 7 2.2.3. Long Header Fields ..................................... 7 2.3. Body ..................................................... 8 3. Syntax ..................................................... 9 3.1. Introduction ............................................. 9 3.2. Lexical Tokens ........................................... 9 3.2.1. Primitive Tokens ....................................... 9 3.2.2. Quoted characters ......................................10 3.2.3. Folding white space and comments .......................11 3.2.4. Atom ...................................................12 3.2.5. Quoted strings .........................................13 3.2.6. Miscellaneous tokens ...................................13 3.3. Date and Time Specification ..............................14 3.4. Address Specification ....................................15 3.4.1. Addr-spec specification ................................16 3.5 Overall message syntax ....................................17 3.6. Field definitions ........................................18 3.6.1. The origination date field .............................20 3.6.2. Originator fields ......................................21 3.6.3. Destination address fields .............................22 3.6.4. Identification fields ..................................23 3.6.5. Informational fields ...................................26 3.6.6. Resent fields ..........................................26 3.6.7. Trace fields ...........................................28 3.6.8. Optional fields ........................................29 4. Obsolete Syntax ............................................29 4.1. Miscellaneous obsolete tokens ............................30 4.2. Obsolete folding white space .............................31 4.3. Obsolete Date and Time ...................................31 4.4. Obsolete Addressing ......................................33 4.5. Obsolete header fields ...................................33 4.5.1. Obsolete origination date field ........................34 4.5.2. Obsolete originator fields .............................34 4.5.3. Obsolete destination address fields ....................34 4.5.4. Obsolete identification fields .........................35 4.5.5. Obsolete informational fields ..........................35 4.5.6. Obsolete resent fields .................................35 4.5.7. Obsolete trace fields ..................................36 4.5.8. Obsolete optional fields ...............................36 5. Security Considerations ....................................36 6. Bibliography ...............................................37 7. Editor&#039;s Address ...........................................38 8. Acknowledgements ...........................................39 Appendix A. Example messages ..................................41 A.1. Addressing examples ......................................41 A.1.1. A message from one person to another with simple addressing .............................................41 A.1.2. Different types of mailboxes ...........................42 A.1.3. Group addresses ........................................43 A.2. Reply messages ...........................................43 A.3. Resent messages ..........................................44 A.4. Messages with trace fields ...............................46 A.5. White space, comments, and other oddities ................47 A.6. Obsoleted forms ..........................................47 A.6.1. Obsolete addressing ....................................48 A.6.2. Obsolete dates .........................................48 A.6.3. Obsolete white space and comments ......................48 Appendix B. Differences from earlier standards ................49 Appendix C. Notices ...........................................50 Full Copyright Statement ......................................51 1. Introduction 1.1. Scope This standard specifies a syntax for text messages that are sent between computer users, within the framework of &quot;electronic mail&quot; messages. This standard supersedes the one specified in Request For Comments (RFC) 822, &quot;Standard for the Format of ARPA Internet Text Messages&quot; [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc822.html&quot; mce_href=&quot;/rfcs/rfc822.html&quot;&gt;RFC822&lt;/A&gt;], updating it to reflect current practice and incorporating incremental changes that were specified in other RFCs [STD3]. This standard specifies a syntax only for text messages. In particular, it makes no provision for the transmission of images, audio, or other sorts of structured data in electronic mail messages. There are several extensions published, such as the MIME document series [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2045.html&quot; mce_href=&quot;/rfcs/rfc2045.html&quot;&gt;RFC2045&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2046.html&quot; mce_href=&quot;/rfcs/rfc2046.html&quot;&gt;RFC2046&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2049.html&quot; mce_href=&quot;/rfcs/rfc2049.html&quot;&gt;RFC2049&lt;/A&gt;], which describe mechanisms for the transmission of such data through electronic mail, either by extending the syntax provided here or by structuring such messages to conform to this syntax. Those mechanisms are outside of the scope of this standard. In the context of electronic mail, messages are viewed as having an envelope and contents. The envelope contains whatever information is needed to accomplish transmission and delivery. (See [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2821.html&quot; mce_href=&quot;/rfcs/rfc2821.html&quot;&gt;RFC2821&lt;/A&gt;] for a discussion of the envelope.) The contents comprise the object to be delivered to the recipient. This standard applies only to the format and some of the semantics of message contents. It contains no specification of the information in the envelope. However, some message systems may use information from the contents to create the envelope. It is intended that this standard facilitate the acquisition of such information by programs. This specification is intended as a definition of what message content format is to be passed between systems. Though some message systems locally store messages in this format (which eliminates the need for translation between formats) and others use formats that differ from the one specified in this standard, local storage is outside of the scope of this standard. Note: This standard is not intended to dictate the internal formats used by sites, the specific message system features that they are expected to support, or any of the characteristics of user interface programs that create or read messages. In addition, this standard does not specify an encoding of the characters for either transport or storage; that is, it does not specify the number of bits used or how those bits are specifically transferred over the wire or stored on disk. 1.2. Notational conventions 1.2.1. Requirements notation This document occasionally uses terms that appear in capital letters. When the terms &quot;MUST&quot;, &quot;SHOULD&quot;, &quot;RECOMMENDED&quot;, &quot;MUST NOT&quot;, &quot;SHOULD NOT&quot;, and &quot;MAY&quot; appear capitalized, they are being used to indicate particular requirements of this specification. A discussion of the meanings of these terms appears in [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2119.html&quot; mce_href=&quot;/rfcs/rfc2119.html&quot;&gt;RFC2119&lt;/A&gt;]. 1.2.2. Syntactic notation This standard uses the Augmented Backus-Naur Form (ABNF) notation specified in [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2234.html&quot; mce_href=&quot;/rfcs/rfc2234.html&quot;&gt;RFC2234&lt;/A&gt;] for the formal definitions of the syntax of messages. Characters will be specified either by a decimal value (e.g., the value %d65 for uppercase A and %d97 for lowercase A) or by a case-insensitive literal value enclosed in quotation marks (e.g., &quot;A&quot; for either uppercase or lowercase A). See [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2234.html&quot; mce_href=&quot;/rfcs/rfc2234.html&quot;&gt;RFC2234&lt;/A&gt;] for the full description of the notation. 1.3. Structure of this document This document is divided into several sections. This section, section 1, is a short introduction to the document. Section 2 lays out the general description of a message and its constituent parts. This is an overview to help the reader understand some of the general principles used in the later portions of this document. Any examples in this section MUST NOT be taken as specification of the formal syntax of any part of a message. Section 3 specifies formal ABNF rules for the structure of each part of a message (the syntax) and describes the relationship between those parts and their meaning in the context of a message (the semantics). That is, it describes the actual rules for the structure of each part of a message (the syntax) as well as a description of the parts and instructions on how they ought to be interpreted (the semantics). This includes analysis of the syntax and semantics of subparts of messages that have specific structure. The syntax included in section 3 represents messages as they MUST be created. There are also notes in section 3 to indicate if any of the options specified in the syntax SHOULD be used over any of the others. Both sections 2 and 3 describe messages that are legal to generate for purposes of this standard. Section 4 of this document specifies an &quot;obsolete&quot; syntax. There are references in section 3 to these obsolete syntactic elements. The rules of the obsolete syntax are elements that have appeared in earlier revisions of this standard or have previously been widely used in Internet messages. As such, these elements MUST be interpreted by parsers of messages in order to be conformant to this standard. However, since items in this syntax have been determined to be non-interoperable or to cause significant problems for recipients of messages, they MUST NOT be generated by creators of conformant messages. Section 5 details security considerations to take into account when implementing this standard. Section 6 is a bibliography of references in this document. Section 7 contains the editor&#039;s address. Section 8 contains acknowledgements. Appendix A lists examples of different sorts of messages. These examples are not exhaustive of the types of messages that appear on the Internet, but give a broad overview of certain syntactic forms. Appendix B lists the differences between this standard and earlier standards for Internet messages. Appendix C has copyright and intellectual property notices. 2. Lexical Analysis of Messages 2.1. General Description At the most basic level, a message is a series of characters. A message that is conformant with this standard is comprised of characters with values in the range 1 through 127 and interpreted as US-ASCII characters [ASCII]. For brevity, this document sometimes refers to this range of characters as simply &quot;US-ASCII characters&quot;. Note: This standard specifies that messages are made up of characters in the US-ASCII range of 1 through 127. There are other documents, specifically the MIME document series [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2045.html&quot; mce_href=&quot;/rfcs/rfc2045.html&quot;&gt;RFC2045&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2046.html&quot; mce_href=&quot;/rfcs/rfc2046.html&quot;&gt;RFC2046&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2047.html&quot; mce_href=&quot;/rfcs/rfc2047.html&quot;&gt;RFC2047&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2048.html&quot; mce_href=&quot;/rfcs/rfc2048.html&quot;&gt;RFC2048&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2049.html&quot; mce_href=&quot;/rfcs/rfc2049.html&quot;&gt;RFC2049&lt;/A&gt;], that extend this standard to allow for values outside of that range. Discussion of those mechanisms is not within the scope of this standard. Messages are divided into lines of characters. A line is a series of characters that is delimited with the two characters carriage-return and line-feed; that is, the carriage return (CR) character (ASCII value 13) followed immediately by the line feed (LF) character (ASCII value 10). (The carriage-return/line-feed pair is usually written in this document as &quot;CRLF&quot;.) A message consists of header fields (collectively called &quot;the header of the message&quot;) followed, optionally, by a body. The header is a sequence of lines of characters with special syntax as defined in this standard. The body is simply a sequence of characters that follows the header and is separated from the header by an empty line (i.e., a line with nothing preceding the CRLF). 2.1.1. Line Length Limits There are two limits that this standard places on the number of characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF. The 998 character limit is due to limitations in many implementations which send, receive, or store Internet Message Format messages that simply cannot handle more than 998 characters on a line. Receiving implementations would do well to handle an arbitrarily large number of characters in a line for robustness sake. However, there are so many implementations which (in compliance with the transport requirements of [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2821.html&quot; mce_href=&quot;/rfcs/rfc2821.html&quot;&gt;RFC2821&lt;/A&gt;]) do not accept messages containing more than 1000 character including the CR and LF per line, it is important for implementations not to create such messages. The more conservative 78 character recommendation is to accommodate the many implementations of user interfaces that display these messages which may truncate, or disastrously wrap, the display of more than 78 characters per line, in spite of the fact that such implementations are non-conformant to the intent of this specification (and that of [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2821.html&quot; mce_href=&quot;/rfcs/rfc2821.html&quot;&gt;RFC2821&lt;/A&gt;] if they actually cause information to be lost). Again, even though this limitation is put on messages, it is encumbant upon implementations which display messages to handle an arbitrarily large number of characters in a line (certainly at least up to the 998 character limit) for the sake of robustness. 2.2. Header Fields Header fields are lines composed of a field name, followed by a colon (&quot;:&quot;), followed by a field body, and terminated by CRLF. A field name MUST be composed of printable US-ASCII characters (i.e., characters that have values between 33 and 126, inclusive), except colon. A field body may be composed of any US-ASCII characters, except for CR and LF. However, a field body may contain CRLF when used in header &quot;folding&quot; and &quot;unfolding&quot; as described in section 2.2.3. All field bodies MUST conform to the syntax described in sections 3 and 4 of this standard. 2.2.1. Unstructured Header Field Bodies Some field bodies in this standard are defined simply as &quot;unstructured&quot; (which is specified below as any US-ASCII characters, except for CR and LF) with no further restrictions. These are referred to as unstructured field bodies. Semantically, unstructured field bodies are simply to be treated as a single line of characters with no further processing (except for header &quot;folding&quot; and &quot;unfolding&quot; as described in section 2.2.3). 2.2.2. Structured Header Field Bodies Some field bodies in this standard have specific syntactical structure more restrictive than the unstructured field bodies described above. These are referred to as &quot;structured&quot; field bodies. Structured field bodies are sequences of specific lexical tokens as described in sections 3 and 4 of this standard. Many of these tokens are allowed (according to their syntax) to be introduced or end with comments (as described in section 3.2.3) as well as the space (SP, ASCII value 32) and horizontal tab (HTAB, ASCII value 9) characters (together known as the white space characters, WSP), and those WSP characters are subject to header &quot;folding&quot; and &quot;unfolding&quot; as described in section 2.2.3. Semantic analysis of structured field bodies is given along with their syntax. 2.2.3. Long Header Fields Each header field is logically a single line of characters comprising the field name, the colon, and the field body. For convenience however, and to deal with the 998/78 character limitations per line, the field body portion of a header field can be split into a multiple line representation; this is called &quot;folding&quot;. The general rule is that wherever this standard allows for folding white space (not simply WSP characters), a CRLF may be inserted before any WSP. For example, the header field: Subject: This is a test can be represented as: Subject: This is a test Note: Though structured field bodies are defined in such a way that folding can take place between many of the lexical tokens (and even within some of the lexical tokens), folding SHOULD be limited to placing the CRLF at higher-level syntactic breaks. For instance, if a field body is defined as comma-separated values, it is recommended that folding occur after the comma separating the structured items in preference to other places where the field could be folded, even if it is allowed elsewhere. The process of moving from this folded multiple-line representation of a header field to its single line representation is called &quot;unfolding&quot;. Unfolding is accomplished by simply removing any CRLF that is immediately followed by WSP. Each header field should be treated in its unfolded form for further syntactic and semantic evaluation. 2.3. Body The body of a message is simply lines of US-ASCII characters. The only two limitations on the body are as follows: - CR and LF MUST only occur together as CRLF; they MUST NOT appear independently in the body. - Lines of characters in the body MUST be limited to 998 characters, and SHOULD be limited to 78 characters, excluding the CRLF. Note: As was stated earlier, there are other standards documents, specifically the MIME documents [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2045.html&quot; mce_href=&quot;/rfcs/rfc2045.html&quot;&gt;RFC2045&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2046.html&quot; mce_href=&quot;/rfcs/rfc2046.html&quot;&gt;RFC2046&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2048.html&quot; mce_href=&quot;/rfcs/rfc2048.html&quot;&gt;RFC2048&lt;/A&gt;, &lt;A href=&quot;http://community.pmail.com/rfcs/rfc2049.html&quot; mce_href=&quot;/rfcs/rfc2049.html&quot;&gt;RFC2049&lt;/A&gt;] that extend this standard to allow for different sorts of message bodies. Again, these mechanisms are beyond the scope of this document. 3. Syntax 3.1. Introduction The syntax as given in this section defines the legal syntax of Internet messages. Messages that are conformant to this standard MUST conform to the syntax in this section. If there are options in this section where one option SHOULD be generated, that is indicated either in the prose or in a comment next to the syntax. For the defined expressions, a short description of the syntax and use is given, followed by the syntax in ABNF, followed by a semantic analysis. Primitive tokens that are used but otherwise unspecified come from [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2234.html&quot; mce_href=&quot;/rfcs/rfc2234.html&quot;&gt;RFC2234&lt;/A&gt;]. In some of the definitions, there will be nonterminals whose names start with &quot;obs-&quot;. These &quot;obs-&quot; elements refer to tokens defined in the obsolete syntax in section 4. In all cases, these productions are to be ignored for the purposes of generating legal Internet messages and MUST NOT be used as part of such a message. However, when interpreting messages, these tokens MUST be honored as part of the legal syntax. In this sense, section 3 defines a grammar for generation of messages, with &quot;obs-&quot; elements that are to be ignored, while section 4 adds grammar for interpretation of messages. 3.2. Lexical Tokens The following rules are used to define an underlying lexical analyzer, which feeds tokens to the higher-level parsers. This section defines the tokens used in structured header field bodies. Note: Readers of this standard need to pay special attention to how these lexical tokens are used in both the lower-level and higher-level syntax later in the document. Particularly, the white space tokens and the comment tokens defined in section 3.2.3 get used in the lower-level tokens defined here, and those lower-level tokens are in turn used as parts of the higher-level tokens defined later. Therefore, the white space and comments may be allowed in the higher-level tokens even though they may not explicitly appear in a particular definition. 3.2.1. Primitive Tokens The following are primitive tokens referred to elsewhere in this standard, but not otherwise defined in [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2234.html&quot; mce_href=&quot;/rfcs/rfc2234.html&quot;&gt;RFC2234&lt;/A&gt;]. Some of them will not appear anywhere else in the syntax, but they are convenient to refer to in other parts of this document. Note: The &quot;specials&quot; below are just such an example. Though the specials token does not appear anywhere else in this standard, it is useful for implementers who use tools that lexically analyze messages. Each of the characters in specials can be used to indicate a tokenization point in lexical analysis. NO-WS-CTL = %d1-8 / ; US-ASCII control characters %d11 / ; that do not include the %d12 / ; carriage return, line feed, %d14-31 / ; and white space characters %d127 text = %d1-9 / ; Characters excluding CR and LF %d11 / %d12 / %d14-127 / obs-text specials = &quot;(&quot; / &quot;)&quot; / ; Special characters used in &quot;&amp;lt;&quot; / &quot;&amp;gt;&quot; / ; other parts of the syntax &quot;[&quot; / &quot;]&quot; / &quot;:&quot; / &quot;;&quot; / &quot;@&quot; / &quot;\&quot; / &quot;,&quot; / &quot;.&quot; / DQUOTE No special semantics are attached to these tokens. They are simply single characters. 3.2.2. Quoted characters Some characters are reserved for special interpretation, such as delimiting lexical tokens. To permit use of these characters as uninterpreted data, a quoting mechanism is provided. quoted-pair = (&quot;\&quot; text) / obs-qp Where any quoted-pair appears, it is to be interpreted as the text character alone. That is to say, the &quot;\&quot; character that appears as part of a quoted-pair is semantically &quot;invisible&quot;. Note: The &quot;\&quot; character may appear in a message where it is not part of a quoted-pair. A &quot;\&quot; character that does not appear in a quoted-pair is not semantically invisible. The only places in this standard where quoted-pair currently appears are ccontent, qcontent, dcontent, no-fold-quote, and no-fold-literal. 3.2.3. Folding white space and comments White space characters, including white space used in folding (described in section 2.2.3), may appear between many elements in header field bodies. Also, strings of characters that are treated as comments may be included in structured field bodies as characters enclosed in parentheses. The following defines the folding white space (FWS) and comment constructs. Strings of characters enclosed in parentheses are considered comments so long as they do not appear within a &quot;quoted-string&quot;, as defined in section 3.2.5. Comments may nest. There are several places in this standard where comments and FWS may be freely inserted. To accommodate that syntax, an additional token for &quot;CFWS&quot; is defined for places where comments and/or FWS can occur. However, where CFWS occurs in this standard, it MUST NOT be inserted in such a way that any line of a folded header field is made up entirely of WSP characters and nothing else. FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space obs-FWS ctext = NO-WS-CTL / ; Non white space controls %d33-39 / ; The rest of the US-ASCII %d42-91 / ; characters not including &quot;(&quot;, %d93-126 ; &quot;)&quot;, or &quot;\&quot; ccontent = ctext / quoted-pair / comment comment = &quot;(&quot; *([FWS] ccontent) [FWS] &quot;)&quot; CFWS = *([FWS] comment) (([FWS] comment) / FWS) Throughout this standard, where FWS (the folding white space token) appears, it indicates a place where header folding, as discussed in section 2.2.3, may take place. Wherever header folding appears in a message (that is, a header field body containing a CRLF followed by any WSP), header unfolding (removal of the CRLF) is performed before any further lexical analysis is performed on that header field according to this standard. That is to say, any CRLF that appears in FWS is semantically &quot;invisible.&quot; A comment is normally used in a structured field body to provide some human readable informational text. Since a comment is allowed to contain FWS, folding is permitted within the comment. Also note that since quoted-pair is allowed in a comment, the parentheses and backslash characters may appear in a comment so long as they appear as a quoted-pair. Semantically, the enclosing parentheses are not part of the comment; the comment is what is contained between the two parentheses. As stated earlier, the &quot;\&quot; in any quoted-pair and the CRLF in any FWS that appears within the comment are semantically &quot;invisible&quot; and therefore not part of the comment either. Runs of FWS, comment or CFWS that occur between lexical tokens in a structured field header are semantically interpreted as a single space character. 3.2.4. Atom Several productions in structured header field bodies are simply strings of certain basic characters. Such productions are called atoms. Some of the structured header field bodies also allow the period character (&quot;.&quot;, ASCII value 46) within runs of atext. An additional &quot;dot-atom&quot; token is defined for those purposes. atext = ALPHA / DIGIT / ; Any character except controls, &quot;!&quot; / &quot;#&quot; / ; SP, and specials. &quot;$&quot; / &quot;%&quot; / ; Used for atoms &quot;&amp;amp;&quot; / &quot;&#039;&quot; / &quot;*&quot; / &quot;+&quot; / &quot;-&quot; / &quot;/&quot; / &quot;=&quot; / &quot;?&quot; / &quot;^&quot; / &quot;_&quot; / &quot;`&quot; / &quot;{&quot; / &quot;|&quot; / &quot;}&quot; / &quot;~&quot; atom = [CFWS] 1*atext [CFWS] dot-atom = [CFWS] dot-atom-text [CFWS] dot-atom-text = 1*atext *(&quot;.&quot; 1*atext) Both atom and dot-atom are interpreted as a single unit, comprised of the string of characters that make it up. Semantically, the optional comments and FWS surrounding the rest of the characters are not part of the atom; the atom is only the run of atext characters in an atom, or the atext and &quot;.&quot; characters in a dot-atom. 3.2.5. Quoted strings Strings of characters that include characters other than those allowed in atoms may be represented in a quoted string format, where the characters are surrounded by quote (DQUOTE, ASCII value 34) characters. qtext = NO-WS-CTL / ; Non white space controls %d33 / ; The rest of the US-ASCII %d35-91 / ; characters not including &quot;\&quot; %d93-126 ; or the quote character qcontent = qtext / quoted-pair quoted-string = [CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS] A quoted-string is treated as a unit. That is, quoted-string is identical to atom, semantically. Since a quoted-string is allowed to contain FWS, folding is permitted. Also note that since quoted-pair is allowed in a quoted-string, the quote and backslash characters may appear in a quoted-string so long as they appear as a quoted-pair. Semantically, neither the optional CFWS outside of the quote characters nor the quote characters themselves are part of the quoted-string; the quoted-string is what is contained between the two quote characters. As stated earlier, the &quot;\&quot; in any quoted-pair and the CRLF in any FWS/CFWS that appears within the quoted-string are semantically &quot;invisible&quot; and therefore not part of the quoted-string either. 3.2.6. Miscellaneous tokens Three additional tokens are defined, word and phrase for combinations of atoms and/or quoted-strings, and unstructured for use in unstructured header fields and in some places within structured header fields. word = atom / quoted-string phrase = 1*word / obs-phrase utext = NO-WS-CTL / ; Non white space controls %d33-126 / ; The rest of US-ASCII obs-utext unstructured = *([FWS] utext) [FWS] 3.3. Date and Time Specification Date and time occur in several header fields. This section specifies the syntax for a full date and time specification. Though folding white space is permitted throughout the date-time specification, it is RECOMMENDED that a single space be used in each place that FWS appears (whether it is required or optional); some older implementations may not interpret other occurrences of folding white space correctly. date-time = [ day-of-week &quot;,&quot; ] date FWS time [CFWS] day-of-week = ([FWS] day-name) / obs-day-of-week day-name = &quot;Mon&quot; / &quot;Tue&quot; / &quot;Wed&quot; / &quot;Thu&quot; / &quot;Fri&quot; / &quot;Sat&quot; / &quot;Sun&quot; date = day month year year = 4*DIGIT / obs-year month = (FWS month-name FWS) / obs-month month-name = &quot;Jan&quot; / &quot;Feb&quot; / &quot;Mar&quot; / &quot;Apr&quot; / &quot;May&quot; / &quot;Jun&quot; / &quot;Jul&quot; / &quot;Aug&quot; / &quot;Sep&quot; / &quot;Oct&quot; / &quot;Nov&quot; / &quot;Dec&quot; day = ([FWS] 1*2DIGIT) / obs-day time = time-of-day FWS zone time-of-day = hour &quot;:&quot; minute [ &quot;:&quot; second ] hour = 2DIGIT / obs-hour minute = 2DIGIT / obs-minute second = 2DIGIT / obs-second zone = (( &quot;+&quot; / &quot;-&quot; ) 4DIGIT) / obs-zone The day is the numeric day of the month. The year is any numeric year 1900 or later. The time-of-day specifies the number of hours, minutes, and optionally seconds since midnight of the date indicated. The date and time-of-day SHOULD express local time. The zone specifies the offset from Coordinated Universal Time (UTC, formerly referred to as &quot;Greenwich Mean Time&quot;) that the date and time-of-day represent. The &quot;+&quot; or &quot;-&quot; indicates whether the time-of-day is ahead of (i.e., east of) or behind (i.e., west of) Universal Time. The first two digits indicate the number of hours difference from Universal Time, and the last two digits indicate the number of minutes difference from Universal Time. (Hence, +hhmm means +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm) minutes). The form &quot;+0000&quot; SHOULD be used to indicate a time zone at Universal Time. Though &quot;-0000&quot; also indicates Universal Time, it is used to indicate that the time was generated on a system that may be in a local time zone other than Universal Time and therefore indicates that the date-time contains no information about the local time zone. A date-time specification MUST be semantically valid. That is, the day-of-the-week (if included) MUST be the day implied by the date, the numeric day-of-month MUST be between 1 and the number of days allowed for the specified month (in the specified year), the time-of-day MUST be in the range 00:00:00 through 23:59:60 (the number of seconds allowing for a leap second; see [STD12]), and the zone MUST be within the range -9959 through +9959. 3.4. Address Specification Addresses occur in several message header fields to indicate senders and recipients of messages. An address may either be an individual mailbox, or a group of mailboxes. address = mailbox / group mailbox = name-addr / addr-spec name-addr = [display-name] angle-addr angle-addr = [CFWS] &quot;&amp;lt;&quot; addr-spec &quot;&amp;gt;&quot; [CFWS] / obs-angle-addr group = display-name &quot;:&quot; [mailbox-list / CFWS] &quot;;&quot; [CFWS] display-name = phrase mailbox-list = (mailbox *(&quot;,&quot; mailbox)) / obs-mbox-list address-list = (address *(&quot;,&quot; address)) / obs-addr-list A mailbox receives mail. It is a conceptual entity which does not necessarily pertain to file storage. For example, some sites may choose to print mail on a printer and deliver the output to the addressee&#039;s desk. Normally, a mailbox is comprised of two parts: (1) an optional display name that indicates the name of the recipient (which could be a person or a system) that could be displayed to the user of a mail application, and (2) an addr-spec address enclosed in angle brackets (&quot;&amp;lt;&quot; and &quot;&amp;gt;&quot;). There is also an alternate simple form of a mailbox where the addr-spec address appears alone, without the recipient&#039;s name or the angle brackets. The Internet addr-spec address is described in section 3.4.1. Note: Some legacy implementations used the simple form where the addr-spec appears without the angle brackets, but included the name of the recipient in parentheses as a comment following the addr-spec. Since the meaning of the information in a comment is unspecified, implementations SHOULD use the full name-addr form of the mailbox, instead of the legacy form, to specify the display name associated with a mailbox. Also, because some legacy implementations interpret the comment, comments generally SHOULD NOT be used in address fields to avoid confusing such implementations. When it is desirable to treat several mailboxes as a single unit (i.e., in a distribution list), the group construct can be used. The group construct allows the sender to indicate a named group of recipients. This is done by giving a display name for the group, followed by a colon, followed by a comma separated list of any number of mailboxes (including zero and one), and ending with a semicolon. Because the list of mailboxes can be empty, using the group construct is also a simple way to communicate to recipients that the message was sent to one or more named sets of recipients, without actually providing the individual mailbox address for each of those recipients. 3.4.1. Addr-spec specification An addr-spec is a specific Internet identifier that contains a locally interpreted string followed by the at-sign character (&quot;@&quot;, ASCII value 64) followed by an Internet domain. The locally interpreted string is either a quoted-string or a dot-atom. If the string can be represented as a dot-atom (that is, it contains no characters other than atext characters or &quot;.&quot; surrounded by atext characters), then the dot-atom form SHOULD be used and the quoted-string form SHOULD NOT be used. Comments and folding white space SHOULD NOT be used around the &quot;@&quot; in the addr-spec. addr-spec = local-part &quot;@&quot; domain local-part = dot-atom / quoted-string / obs-local-part domain = dot-atom / domain-literal / obs-domain domain-literal = [CFWS] &quot;[&quot; *([FWS] dcontent) [FWS] &quot;]&quot; [CFWS] dcontent = dtext / quoted-pair dtext = NO-WS-CTL / ; Non white space controls %d33-90 / ; The rest of the US-ASCII %d94-126 ; characters not including &quot;[&quot;, ; &quot;]&quot;, or &quot;\&quot; The domain portion identifies the point to which the mail is delivered. In the dot-atom form, this is interpreted as an Internet domain name (either a host name or a mail exchanger name) as described in [STD3, STD13, STD14]. In the domain-literal form, the domain is interpreted as the literal Internet address of the particular host. In both cases, how addressing is used and how messages are transported to a particular host is covered in the mail transport document [&lt;A href=&quot;http://community.pmail.com/rfcs/rfc2821.html&quot; mce_href=&quot;/rfcs/rfc2821.html&quot;&gt;RFC2821&lt;/A&gt;]. These mechanisms are outside of the scope of this document. The local-part portion is a domain dependent string. In addresses, it is simply interpreted on the particular host as a name of a particular mailbox. 3.5 Overall message syntax A message consists of header fields, optionally followed by a message body. Lines in a message MUST be a maximum of 998 characters excluding the CRLF, but it is RECOMMENDED that lines be limited to 78 characters excluding the CRLF. (See section 2.1.1 for explanation.) In a message body, though all of the characters listed in the text rule MAY be used, the use of US-ASCII control characters (values 1 through 8, 11, 12, and 14 through 31) is discouraged since their interpretation by receivers for display is not guaranteed. message = (fields / obs-fields) [CRLF body] body = *(*998text CRLF) *998text The header fields carry most of the semantic information and are defined in section 3.6. The body is simply a series of lines of text which are uninterpreted for the purposes of this standard. 3.6. Field definitions The header fields of a message are defined here. All header fields have the same general syntactic structure: A field name, followed by a colon, followed by the field body. The specific syntax for each header field is defined in the subsequent sections. Note: In the ABNF syntax for each field in subsequent sections, each field name is followed by the required colon. However, for brevity sometimes the colon is not referred to in the textual description of the syntax. It is, nonetheless, required. It is important to note that the header fields are not guaranteed to be in a particular order. They may appear in any order, and they have been known to be reordered occasionally when transported over the Internet. However, for the purposes of this standard, header fields SHOULD NOT be reordered when a message is transported or transformed. More importantly, the trace header fields and resent header fields MUST NOT be reordered, and SHOULD be kept in blocks prepended to the message. See sections 3.6.6 and 3.6.7 for more information. The only required header fields are the origination date field and the originator address field(s). All other header fields are syntactically optional. More information is contained in the table following this definition. fields = *(trace *(resent-date / resent-from / resent-sender / resent-to / resent-cc / resent-bcc / resent-msg-id)) *(orig-date / from / sender / reply-to / to / cc / bcc / message-id / in-reply-to / references / subject / comments / keywords / optional-field) The following table indicates limits on the number of times each field may occur in a message header as well as any special limitations on the use of those fields. An asterisk next to a value in the minimum or maximum column indicates that a special restriction appears in the Notes column. Field Min number Max number Notes trace 0 unlimited Block prepended - see 3.6.7 resent-date 0* unlimited* One per block, required if other resent fields present - see 3.6.6 resent-from 0 unlimited* One per block - see 3.6.6 resent-sender 0* unlimited* One per block, MUST occur with multi-address resent-from - see 3.6.6 resent-to 0 unlimited* One per block - see 3.6.6 resent-cc 0 unlimited* One per block - see 3.6.6 resent-bcc 0 unlimited* One per block - see 3.6.6 resent-msg-id 0 unlimited* One per block - see 3.6.6 orig-date 1 1 from 1 1 See sender and 3.6.2 sender 0* 1 MUST occur with multi- address from - see 3.6.2 reply-to 0 1 to 0 1 cc 0 1 bcc 0 1 message-id 0* 1 SHOULD be present - see 3.6.4 in-reply-to 0* 1 SHOULD occur in some replies - see 3.6.4 references 0* 1 SHOULD occur in some replies - see 3.6.4 subject 0 1 comments 0 unlimited keywords 0 unlimited optional-field 0 unlimited The exact interpretation of each field is described in subsequent sections. 3.6.1. The origination date field The origination date field consists of the field name &quot;Date&quot; followed by a date-time specification. orig-date = &quot;Date:&quot; date-time CRLF The origination date specifies the date and time at which the creator of the message indicated that the message was complete and ready to enter the mail delivery system. For instance, this might be the time that a user pushes the &quot;send&quot; or &quot;submit&quot; button in an application program. In any case, it is specifically not intended to convey the time that the message is actually transported, but rather the time at which the human or other creator of the message has put the message into its final form, ready for transport. (For example, a portable computer user who is not connected to a network might queue a message for delivery. The origination date is intended to contain the date and time that the user queued the message, not the time when the user connected to the network to send the message.) 3.6.2. Originator fields The originator fields of a message consist of the from field, the sender field (when applicable), and optionally the reply-to field. The from field consists of the field name &quot;From&quot; and a comma-separated list of one or more mailbox specifications. If the from field contains more than one mailbox specification in the mailbox-list, then the sender field, containing the field name &quot;Sender&quot; and a single mailbox specification, MUST appear in the message. In either case, an optional reply-to field MAY also be included, which contains the field name &quot;Reply-To&quot; and a comma-separated list of one or more addresses. from = &quot;From:&quot; mailbox-list CRLF sender = &quot;Sender:&quot; mailbox CRLF reply-to = &quot;Reply-To:&quot; address-list CRLF The originator fields indicate the mailbox(es) of the source of the message. The &quot;From:&quot; field specifies the author(s) of the message, that is, the mailbox(es) of the person(s) or system(s) responsible for the writing of the message. The &quot;Sender:&quot; field specifies the mailbox of the agent responsible for the actual transmission of the message. For example, if a secretary were to send a message for another person, the mailbox of the secretary would appear in the &quot;Sender:&quot; field and the mailbox of the actual author would appear in the &quot;From:&quot; field. If the originator of the message can be indicated by a single mailbox and the author and transmitter are identical, the &quot;Sender:&quot; field SHOULD NOT be used. Otherwise, both fields SHOULD appear. The originator fields also provide the information required when replying to a message. When the &quot;Reply-To:&quot; field is present, it indicates the mailbox(es) to which the author of the message suggests that replies be sent. In the absence of the &quot;Reply-To:&quot; field, replies SHOULD by default be sent to the mailbox(es) specified in the &quot;From:&quot; field unless otherwise specified by the person composing the reply. In all cases, the &quot;From:&quot; field SHOULD NOT contain any mailbox that does not belong to the author(s) of the message. See also section 3.6.3 for more information on forming the destination addresses for a reply. 3.6.3. Destination address fields The destination fields of a message consist of three possible fields, each of the same form: The field name, which is either &quot;To&quot;, &quot;Cc&quot;, or &quot;Bcc&quot;, followed by a comma-separated list of one or more addresses (either mailbox or group syntax). to = &quot;To:&quot; address-list CRLF cc = &quot;Cc:&quot; address-list CRLF bcc = &quot;Bcc:&quot; (address-list / [CFWS]) CRLF The destination fields specify the recipients of the message. Each destination field may have one or more addresses, and each of the addresses indicate the intended recipients of the message. The only difference between the three fields is how each is used. The &quot;To:&quot; field contains the address(es) of the primary recipient(s) of the message. The &quot;Cc:&quot; field (where the &quot;Cc&quot; means &quot;Carbon Copy&quot; in the sense of making a copy on a typewriter using carbon paper) contains the addresses of others who are to receive the message, though the content of the message may not be directed at them. The &quot;Bcc:&quot; field (where the &quot;Bcc&quot; means &quot;Blind Carbon Copy&quot;) contains addresses of recipients of the message whose addresses are not to be revealed to other recipients of the message. There are three ways in which the &quot;Bcc:&quot; field is used. In the first case, when a message containing a &quot;Bcc:&quot; field is prepared to be sent, the &quot;Bcc:&quot; line is removed even though all of the recipients (including those specified in the &quot;Bcc:&quot; field) are sent a copy of the message. In the second case, recipients specified in the &quot;To:&quot; and &quot;Cc:&quot; lines each are sent a copy of the message with the &quot;Bcc:&quot; line removed as above, but the recipients on the &quot;Bcc:&quot; line get a separate copy of the message containing a &quot;Bcc:&quot; line. (When there are multiple recipient addresses in the &quot;Bcc:&quot; field, some implementations actually send a separate copy of the message to each recipient with a &quot;Bcc:&quot; containing only the address of that particular recipient.) Finally, since a &quot;Bcc:&quot; field may contain no addresses, a &quot;Bcc:&quot; field can be sent without any addresses indicating to the recipients that blind copies were sent to someone. Which method to use with &quot;Bcc:&quot; fields is implementation dependent, but refer to the &quot;Security Considerations&quot; section of this document for a discussion of each. When a message is a reply to another message, the mailboxes of the authors of the original message (the mailboxes in the &quot;From:&quot; field) or mailboxes specified in the &quot;Reply-To:&quot; field (if it exists) MAY appear in the &quot;To:&quot; field of the reply since these would normally be the primary recipients of the reply. If a reply is sent to a message that has destination fields, it is often desirable to send a copy of the reply to all of the recipients of the message, in addition to the author. When such a reply is formed, addresses in the &quot;To:&quot; and &quot;Cc:&quot; fields of the original message MAY appear in the &quot;Cc:&quot; field of the reply, since these are normally secondary recipients of the reply. If a &quot;Bcc:&quot; field is present in the original message, addresses in that field MAY appear in the &quot;Bcc:&quot; field of the reply, but SHOULD NOT appear in the &quot;To:&quot; or &quot;Cc:&quot; fields. Note: Some mail applications have automatic reply commands that include the destination addresses of the original message in the destination addresses of the reply. How those reply commands behave is implementation dependent and is beyond the scope of this document. In particular, whether or not to include the original destination addresses when the original message had a &quot;Reply-To:&quot; field is not addressed here. 3.6.4. Identification fields Though optional, every message SHOULD have a &quot;Message-ID:&quot; field. Furthermore, reply messages SHOULD have &quot;In-Reply-To:&quot; and &quot;References:&quot; fields as appropriate, as described below. The &quot;Message-ID:&quot; field contains a single unique message identifier. The &quot;References:&quot; and &quot;In-Reply-To:&quot; field each contain one or more unique message identifiers, optionally separated by CFWS. The message identifier (msg-id) is similar in syntax to an angle-addr construct without the internal CFWS. message-id = &quot;Message-ID:&quot; msg-id CRLF in-reply-to = &quot;In-Reply-To:&quot; 1*msg-id CRLF references = &quot;References:&quot; 1*msg-id CRLF msg-id = [CFWS] &quot;&amp;lt;&quot; id-left &quot;@&quot; id-right &quot;&amp;gt;&quot; [CFWS] id-left = dot-atom-text / no-fold-quote / obs-id-left id-right = dot-atom-text / no-fold-literal / obs-id-right no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE no-fold-literal = &quot;[&quot; *(dtext / quoted-pair) &quot;]&quot; The &quot;Message-ID:&quot; field provides a unique message identifier that refers to a particular version of a particular message. The uniqueness of the message identifier is guaranteed by the host that generates it (see below). This message identifier is intended to be machine readable and not necessarily meaningful to humans. A message identifier pertains to exactly one instantiation of a particular message; subsequent revisions to the message each receive new message identifiers. Note: There are many instances when messages are &quot;changed&quot;, but those changes do not constitute a new instantiation of that message, and therefore the message would not get a new message identifier. For example, when messages are introduced into the transport system, they are often prepended with additional header fields such as trace fields (described in section 3.6.7) and resent fields (described in section 3.6.6). The addition of such header fields does not change the identity of the message and therefore the original &quot;Message-ID:&quot; field is retained. In all cases, it is the meaning that the sender of the message wishes to convey (i.e., whether this is the same message or a different message) that determines whether or not the &quot;Message-ID:&quot; field changes, not any particular syntactic difference that appears (or does not appear) in the message. The &quot;In-Reply-To:&quot; and &quot;References:&quot; fields are used when creating a reply to a message. They hold the message identifier of the original message and the message identifiers of other messages (for example, in the case of a reply to a message which was itself a reply). The &quot;In-Reply-To:&quot; field may be used to identify the message (or messages) to which the new message is a reply, while the &quot;References:&quot; field may be used to identify a &quot;thread&quot; of conversation. When creating a reply to a message, the &quot;In-Reply-To:&quot; and &quot;References:&quot; fields of the resultant message are constructed as follows: The &quot;In-Reply-To:&quot; field will contain the contents of the &quot;Message- ID:&quot; field of the message to which this one is a reply (the &quot;parent message&quot;). If there is more than one parent message, then the &quot;In- Reply-To:&quot; field will contain the contents of all of the parents&#039; &quot;Message-ID:&quot; fields. If there is no &quot;Message-ID:&quot; field in any of the parent messages, then the new message will have no &quot;In-Reply-To:&quot; field. The &quot;References:&quot; field will contain the contents of the parent&#039;s &quot;References:&quot; field (if any) followed by the contents of the parent&#039;s &quot;Message-ID:&quot; field (if any). If the parent message does not contain a &quot;References:&quot; field but does have an &quot;In-Reply-To:&quot; field containing a single message identifier, then the &quot;References:&quot; field will contain the contents of the parent&#039;s &quot;In-Reply-To:&quot; field followed by the contents of the parent&#039;s &quot;Message-ID:&quot; field (if any). If the parent has none of the &quot;References:&quot;, &quot;In-Reply-To:&quot;, or &quot;Message-ID:&quot; fields, then the new message will have no &quot;References:&quot; field. Note: Some implementations parse the &quot;References:&quot; field to display the &quot;thread of the discussion&quot;. These implementations assume that each new message is a reply to a single parent and hence that they can walk backwards through the &quot;References:&quot; field to find the parent of each message listed there. Therefore, trying to form a &quot;References:&quot; field for a reply that has multiple parents is discouraged and how to do so is not defined in this document. The message identifier (msg-id) itself MUST be a globally unique identifier for a message. The generator of the message identifier MUST guarantee that the msg-id is unique. There are several algorithms that can be used to accomplish this. Since the msg-id has a similar syntax to angle-addr (identical except that comments and folding white space are not allowed), a good method is to put the domain name (or a domain literal IP address) of the host on which the message identifier was created on the right hand side of the &quot;@&quot;, and put a combination of the current absolute date and time along with some other currently unique (perhaps sequential) identifier available on the system (for example, a process id number) on the left hand side. Using a date on the left hand side and a domain name or domain literal on the right hand side makes it possible to guarantee uniqueness since no two hosts use the same domain name or IP address at the same time. Though other algorithms will work, it is RECOMMENDED that the right hand side contain some domain identifier (either of the host itself or otherwise) such that the generator of the message identifier can guarantee the uniqueness of the left hand side within the scope of that domain. Semantically, the angle bracket characters are not part of the msg-id; the msg-id is what is contained between the two angle bracket characters. 3.6.5. Informational fields The informational fields are all optional. The &quot;Keywords:&quot; field contains a comma-separated list of one or more words or quoted-strings. The &quot;Subject:&quot; and &quot;Comments:&quot; fields are unstructured fields as defined in section 2.2.1, and therefore may contain text or folding white space. subject = &quot;Subject:&quot; unstructured CRLF comments = &quot;Comments:&quot; unstructured CRLF keywords = &quot;Keywords:&quot; phrase *(&quot;,&quot; phrase) CRLF These three fields are intended to have only human-readable content with information about the message. The &quot;Subject:&quot; field is the most common and contains a short string identifying the topic of the message. When used in a reply, the field body MAY start with the string &quot;Re: &quot; (from the Latin &quot;res&quot;, in the matter of) followed by the contents of the &quot;Subject:&quot; field body of the original message. If this is done, only one instance of the literal string &quot;Re: &quot; ought to be used since use of other strings or more than one instance can lead to undesirable consequences. The &quot;Comments:&quot; field contains any additional comments on the text of the body of the message. The &quot;Keywords:&quot; field contains a comma-separated list of important words and phrases that might be useful for the recipient. 3.6.6. Resent fields Resent fields SHOULD be added to any message that is reintroduced by a user into the transport system. A separate set of resent fields SHOULD be added each time this is done. All of the resent fields corresponding to a particular resending of the message SHOULD be together. Each new set of resent fields is prepended to the message; that is, the most recent set of resent fields appear earlier in the message. No other fields in the message are changed when resent fields are added. Each of the resent fields corresponds to a particular field elsewhere in the syntax. For instance, the &quot;Resent-Date:&quot; field corresponds to the &quot;Date:&quot; field and the &quot;Resent-To:&quot; field corresponds to the &quot;To:&quot; field. In each case, the syntax for the field body is identical to the syntax given previously for the corresponding field. When resent fields are used, the &quot;Resent-From:&quot; and &quot;Resent-Date:&quot; fields MUST be sent. The &quot;Resent-Message-ID:&quot; field SHOULD be sent. &quot;Resent-Sender:&quot; SHOULD NOT be used if &quot;Resent-Sender:&quot; would be identical to &quot;Resent-From:&quot;. resent-date = &quot;Resent-Date:&quot; date-time CRLF resent-from = &quot;Resent-From:&quot; mailbox-list CRLF resent-sender = &quot;Resent-Sender:&quot; mailbox CRLF resent-to = &quot;Resent-To:&quot; address-list CRLF resent-cc = &quot;Resent-Cc:&quot; address-list CRLF resent-bcc = &quot;Resent-Bcc:&quot; (address-list / [CFWS]) CRLF resent-msg-id = &quot;Resent-Message-ID:&quot; msg-id CRLF Resent fields are used to identify a message as having been reintroduced into the transport system by a user. The purpose of using resent fields is to have the message appear to the final recipient as if it were sent directly by the original sender, with all of the original fields remaining the same. Each set of resent fields correspond to a particular resending event. That is, if a message is resent multiple times, each set of resent fields gives identifying information for each individual time. Resent fields are strictly informational. They MUST NOT be used in the normal processing of replies or other such automatic actions on messages. Note: Reintroducing a message into the transport system and using resent fields is a different operation from &quot;forwarding&quot;. &quot;Forwarding&quot; has two meanings: One sense of forwarding is that a mail reading program can be told by a user to forward a copy of a message to another person, making the forwarded message the body of the new message. A forwarded message in this sense does not appear to have come from the original sender, but is an entirely new message from the forwarder of the message. On the other hand, forwarding is also used to mean when a mail transport program gets a message and forwards it on to a different destination for final delivery. Resent header fields are not intended for use with either type of forwarding. The resent originator fields indicate the mailbox of the person(s) or system(s) that resent the message. As with the regular originator fields, there are two forms: a simple &quot;Resent-From:&quot; form which contains the mailbox of the individual doing the resending, and the more complex form, when one individual (identified in the &quot;Resent-Sender:&quot; field) resends a message on behalf of one or more others (identified in the &quot;Resent-From:&quot; field). Note: When replying to a resent message, replies behave just as they would with any other message, using the original &quot;From:&quot;, &quot;Reply-To:&quot;, &quot;Message-ID:&quot;, and other fields. The resent fields are only informational and MUST NOT be used in the normal processing of replies. The &quot;Resent-Date:&quot; indicates the date and time at which the resent message is dispatched by the resender of the message. Like the &quot;Date:&quot; field, it is not the date and time that the message was actually transported. The &quot;Resent-To:&quot;, &quot;Resent-Cc:&quot;, and &quot;Resent-Bcc:&quot; fields function identically to the &quot;To:&quot;, &quot;Cc:&quot;, and &quot;Bcc:&quot; fields respectively, except that they indicate the recipients of the resent message, not the recipients of the original message. The &quot;Resent-Message-ID:&quot; field provides a u
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft