As per Relevance of the word delivery, we have this rfc below:











Network Working Group K.
Request for Comments: 1894 University of
Category: Standards Track G.
Octel Network
January 1996


An Extensible Message Format for Delivery Status

Status of this

This document specifies an Internet standards track protocol for
Internet community, and requests discussion and suggestions
improvements. Please refer to the current edition of the "
Official Protocol Standards" (STD 1) for the standardization
and status of this protocol. Distribution of this memo is unlimited



This memo defines a MIME content-type that may be used by a
transfer agent (MTA) or electronic mail gateway to report the
of an attempt to deliver a message to one or more recipients.
content-type is intended as a machine-processable replacement for
various types of delivery status notifications currently used
Internet electronic mail

Because many messages are sent between the Internet and
messaging systems (such as X.400 or the so-called "LAN-based
systems), the DSN protocol is designed to be useful in a multi
protocol messaging environment. To this end, the protocol
in this memo provides for the carriage of "foreign" addresses
error codes, in addition to those normally used in Internet mail
Additional attributes may also be defined to support "tunneling"
foreign notifications through Internet mail

Any questions, comments, and reports of defects or ambiguities
this specification may be sent to the mailing list for the
working group of the IETF, using the
. Requests to subscribe to the
list should be addressed to .
Implementors of this specification are encouraged to subscribe to
mailing list, so that they will quickly be informed of any
which might hinder interoperability

NOTE: This document is a Proposed Standard. If and when
protocol is submitted for Draft Standard status, any normative
(phrases containing SHOULD, SHOULD NOT, MUST, MUST NOT, or MAY)
this document will be re-evaluated in light of



Moore & Vaudreuil Standards Track [Page 1]

RFC 1894 Delivery Status Notifications January 1996


experience, and are thus subject to change

1.

This memo defines a MIME [1] content-type for delivery
notifications (DSNs). A DSN can be used to notify the sender of
message of any of several conditions: failed delivery,
delivery, successful delivery, or the gatewaying of a message into
environment that may not support DSNs. The "message/delivery-status
content-type defined herein is intended for use within the
of the "multipart/report" content type defined in [2].

This memo defines only the format of the notifications. An
to the Simple Message Transfer Protocol (SMTP) [3] to fully
such notifications is the subject of a separate memo [4].

1.1

The DSNs defined in this memo are expected to serve several purposes

(a) Inform human beings of the status of message delivery processing,
well as the reasons for any delivery problems or outright failures
in a manner which is largely independent of human language

(b) Allow mail user agents to keep track of the delivery status
messages sent, by associating returned DSNs with earlier
transmissions

(c) Allow mailing list exploders to automatically maintain
subscriber lists when delivery attempts repeatedly fail

(d) Convey delivery and non-delivery notifications resulting
attempts to deliver messages to "foreign" mail systems via
gateway

(e) Allow "foreign" notifications to be tunneled through a MIME-
message system and back into the original messaging system
issued the original notification, or even to a third
system

(f) Allow language-independent, yet reasonably precise, indications
the reason for the failure of a message to be delivered (once
codes of sufficient precision are defined);

(g) Provide sufficient information to remote MTA maintainers (
"trouble tickets") so that they can understand the nature
reported errors. This feature is used in the case that failure
deliver a message is due to the malfunction of a remote MTA and



Moore & Vaudreuil Standards Track [Page 2]

RFC 1894 Delivery Status Notifications January 1996


sender wants to report the problem to the remote MTA administrator

1.2

These purposes place the following constraints on the
protocol

(a) It must be readable by humans as well as being machine-parsable

(b) It must provide enough information to allow message senders (or
user agents) to unambiguously associate a DSN with the message
was sent and the original recipient address for which the DSN
issued (if such information is available), even if the message
forwarded to another recipient address

(c) It must be able to preserve the reason for the success or failure
a delivery attempt in a remote messaging system, using
"language" (mailbox addresses and status codes) of that
system

(d) It must also be able to describe the reason for the success
failure of a delivery attempt, independent of any particular
language or of the "language" of any particular mail system

(e) It must preserve enough information to allow the maintainer of
remote MTA to understand (and if possible, reproduce) the
that caused a delivery failure at that MTA

(f) For any notifications issued by foreign mail systems, which
translated by a mail gateway to the DSN format, the DSN
preserve the "type" of the foreign addresses and error codes,
that these may be correctly interpreted by gateways

A DSN contains a set of per-message fields which identify the
and the transaction during which the message was submitted,
with other fields that apply to all delivery attempts described
the DSN. The DSN also includes a set of per-recipient fields
convey the result of the attempt to deliver the message to each
one or more recipients

1.3

A message may be transmitted through several message transfer
(MTAs) on its way to a recipient. For a variety of reasons
recipient addresses may be rewritten during this process, so each
may potentially see a different recipient address. Depending on
purpose for which a DSN is used, different formats of a
recipient address will be needed



Moore & Vaudreuil Standards Track [Page 3]

RFC 1894 Delivery Status Notifications January 1996


Several DSN fields are defined in terms of the view from a
MTA in the transmission. The MTAs are assigned the following names

(a) Original

The Original MTA is the one to which the message is submitted
delivery by the sender of the message

(b) Reporting

For any DSN, the Reporting MTA is the one which is reporting
results of delivery attempts described in the DSN

If the delivery attempts described occurred in a "foreign" (non
Internet) mail system, and the DSN was produced by translating
foreign notice into DSN format, the Reporting MTA will still
the "foreign" MTA where the delivery attempts occurred

(c) Received-From

The Received-From MTA is the MTA from which the Reporting
received the message, and accepted responsibility for delivery of
message

(d) Remote

If an MTA determines that it must relay a message to one or
recipients, but the message cannot be transferred to its "next hop
MTA, or if the "next hop" MTA refuses to accept responsibility
delivery of the message to one or more of its intended recipients
the relaying MTA may need to issue a DSN on behalf of the
for whom the message cannot be delivered. In this case the
MTA is the Reporting MTA, and the "next hop" MTA is known as
Remote MTA

















Moore & Vaudreuil Standards Track [Page 4]

RFC 1894 Delivery Status Notifications January 1996


Figure 1 illustrates the relationship between the various MTAs


+-----+ +--------+ +---------+ +---------+ +------+
| | | | |Received-| | | | |
| | => |Original| => ... => | From | => |Reporting| ===> |Remote
| user| | MTA | | MTA | | MTA | |agent| +--------+ +---------+ +----v----+ +------+
| | |
| | <-------------------------------------------+
+-----+ (DSN returned to sender by Reporting MTA


Figure 1. Original, Received-From, Reporting and Remote


Each of these MTAs may provide information which is useful in a DSN

+ Ideally, the DSN will contain the address of each recipient
originally specified to the Original MTA by the sender of the message
This version of the address is needed (rather than a
address or some modified version of the original address) so that
sender may compare the recipient address in the DSN with the
in the sender's records (e.g. an address book for an individual,
list of subscribers for a mailing list) and take appropriate action

Similarly, the DSN might contain an "envelope identifier" that
known to both the sender's user agent and the Original MTA at the
of message submission, and which, if included in the DSN, can be
by the sender to keep track of which messages were or were
delivered

+ If a message was (a) forwarded to a different address than
specified by the sender, (b) gatewayed to a different mail system
that used by the sender, or (c) subjected to address rewriting
transmission, the "final" form of the recipient address (i.e. the
seen by the Reporting MTA) will be different than the
(sender-specified) recipient address. Just as the sender's user
(or the sender) prefers the original recipient address, so the "final
address is needed when reporting a problem to the postmaster of
site where message delivery failed, because only the final
address will allow her to reproduce the conditions that caused
failure

+ A "failed" DSN should contain the most accurate explanation for
delivery failure that is available. For ease of interpretation,
information should be a format which is independent of the
transport system that issued the DSN. However, if a foreign



Moore & Vaudreuil Standards Track [Page 5]

RFC 1894 Delivery Status Notifications January 1996


code is translated into some transport-independent format,
information may be lost. It is therefore desirable to provide both
transport-independent status code and a mechanism for
transport-specific codes. Depending on the circumstances
produced delivery failure, the transport-specific code might
obtained from either the Reporting MTA or the Remote MTA

Since different values for "recipient address" and "delivery
code" are needed according to the circumstance in which a DSN will
used, and since the MTA that issues the DSN cannot anticipate
circumstances, the DSN format described here may contain both
original and final forms of a recipient address, and both
transport-independent and a transport-specific indication of
status

Extension fields may also be added by the Reporting MTA as needed
provide additional information for use in a trouble ticket or
preserve information for tunneling of foreign delivery
through Internet DSNs

The Original, Reporting, and Remote MTAs may exist in very
environments and use dissimilar transport protocols, MTA names
address formats, and delivery status codes. DSNs therefore do
assume any particular format for mailbox addresses, MTA names,
transport-specific status codes. Instead, the various DSN
that carry such quantities consist of a "type" subfield followed by
subfield whose contents are ordinary text characters, and the
of which is indicated by the "type" subfield. This allows a DSN
convey these quantities regardless of format

2. Format of a Delivery Status

A DSN is a MIME message with a top-level content-type
multipart/report (defined in [2]). When a multipart/report
is used to transmit a DSN

(a) The report-type parameter of the multipart/report content
"delivery-status".

(b) The first component of the multipart/report contains a human
readable explanation of the DSN, as described in [2].

(c) The second component of the multipart/report is of content-
message/delivery-status, described in section 2.1 of this document

(d) If the original message or a portion of the message is to
returned to the sender, it appears as the third component of
multipart/report



Moore & Vaudreuil Standards Track [Page 6]

RFC 1894 Delivery Status Notifications January 1996


NOTE: For delivery status notifications gatewayed from
systems, the headers of the original message may not be available
In this case the third component of the DSN may be omitted, or
may contain "simulated" RFC 822 headers which contain
information. In particular, it is very desirable to preserve
subject, date, and message-id (or equivalent) fields from
original message

The DSN MUST be addressed (in both the message header and
transport envelope) to the return address from the transport
which accompanied the original message for which the DSN
generated. (For a message that arrived via SMTP, the envelope
address appears in the MAIL FROM command.)

The From field of the message header of the DSN SHOULD contain
address of a human who is responsible for maintaining the mail
at the Reporting MTA site (e.g. Postmaster), so that a reply to
DSN will reach that person. Exception: if a DSN is translated from
foreign delivery report, and the gateway performing the
cannot determine the appropriate address, the From field of the
MAY be the address of a human who is responsible for maintaining
gateway

The envelope sender address of the DSN SHOULD be chosen to
that no delivery status reports will be issued in response to the
itself, and MUST be chosen so that DSNs will not generate mail loops
Whenever an SMTP transaction is used to send a DSN, the MAIL
command MUST use a NULL return address, i.e. "MAIL FROM:<>".

A particular DSN describes the delivery status for exactly
message. However, an MTA MAY report on the delivery status
several recipients of the same message in a single DSN. Due to
nature of the mail transport system (where responsibility
delivery of a message to its recipients may be split among
MTAs, and delivery to any particular recipient may be delayed),
multiple DSNs may be still be issued in response to a single
submission














Moore & Vaudreuil Standards Track [Page 7]

RFC 1894 Delivery Status Notifications January 1996


2.1 The message/delivery-status content-

The message/delivery-status content-type is defined as follows

MIME type name:
MIME subtype name: delivery-
Optional parameters:
Encoding considerations: "7bit" encoding is sufficient
MUST be used to maintain
when viewed by non-MIME
readers
Security considerations: discussed in section 4 of this memo

The message/delivery-status report type for use in
multipart/report is "delivery-status".

The body of a message/delivery-status consists of one or
"fields" formatted according to the ABNF of RFC 822 header "fields
(see [6]). The per-message fields appear first, followed by a
line. Following the per-message fields are one or more groups
per-recipient fields. Each group of per-recipient fields is
by a blank line. Using the ABNF of RFC 822, the syntax of
message/delivery-status content is as follows

delivery-status-content =
per-message-fields 1*( CRLF per-recipient-fields )

The per-message fields are described in section 2.2. The per
recipient fields are described in section 2.3.


2.1.1 General conventions for DSN

Since these fields are defined according to the rules of RFC 822,
same conventions for continuation lines and comments apply
Notification fields may be continued onto multiple lines by
each additional line with a SPACE or HTAB. Text which appears
parentheses is considered a comment and not part of the contents
that notification field. Field names are case-insensitive, so
names of notification fields may be spelled in any combination
upper and lower case letters. Comments in DSN fields may use
"encoded-word" construct defined in [7].

A number of DSN fields are defined to have a portion of a field
of "xtext". "xtext" is used to allow encoding sequences of
which contain values outside the range [1-127 decimal] of
ASCII characters, and also to allow comments to be inserted in
data. Any octet may be encoded as "+" followed by two upper



Moore & Vaudreuil Standards Track [Page 8]

RFC 1894 Delivery Status Notifications January 1996


hexadecimal digits. (The "+" character MUST be encoded as "+2B".)
With certain exceptions, octets that correspond to ASCII
may be represented as themselves. SPACE and HTAB characters
ignored. Comments may be included by enclosing them in parenthesis
Except within comments, encoded-words such as defined in [7] may
be used in xtext

"xtext" is formally defined as follows

xtext = *( xchar / hexchar / linear-white-space / comment )

xchar = any ASCII CHAR between "!" (33) and "~" (126) inclusive
except for "+", "\" and "(".

"hexchar"s are intended to encode octets that cannot be
as plain text, either because they are reserved, or because they
non-printable. However, any octet value may be represented by
"hexchar".

hexchar = ASCII "+" immediately followed by two upper
hexadecimal

When encoding an octet sequence as xtext

+ Any ASCII CHAR between "!" and "~" inclusive, except for "+", "\",
and "(", MAY be encoded as itself. (Some CHARs in this range
also be encoded as "hexchar"s, at the implementor's discretion.)

+ ASCII CHARs that fall outside the range above must be encoded
"hexchar".

+ Line breaks (CR LF SPACE) MAY be inserted as necessary to keep
lengths from becoming excessive

+ Comments MAY be added to clarify the meaning for human readers

2.1.2 "*-type"

Several DSN fields consist of a "-type" subfield, followed by
semicolon, followed by "*text". For these fields, the keyword
in the address-type, diagnostic-type, or MTA-name-type
indicates the expected format of the address, status-code, or MTA
name which follows








Moore & Vaudreuil Standards Track [Page 9]

RFC 1894 Delivery Status Notifications January 1996


The "-type" subfields are defined as follows

(a) An "address-type" specifies the format of a mailbox address.
example, Internet mail addresses use the "rfc822" address-type

address-type =

(b) A "diagnostic-type" specifies the format of a status code.
example, when a DSN field contains a reply code reported via
Simple Mail Transfer Protocol [3], the "smtp" diagnostic-type
used

diagnostic-type =

(c) An "MTA-name-type" specifies the format of an MTA name.
example, for an SMTP server on an Internet host, the MTA name is
domain name of that host, and the "dns" MTA-name-type is used

mta-name-type =

Values for address-type, diagnostic-type, and MTA-name-type
case-insensitive. Thus address-type values of "RFC822" and "rfc822"
are equivalent

The Internet Assigned Numbers Authority (IANA) will maintain
registry of address-types, diagnostic-types, and MTA-name-types
along with descriptions of the meanings and acceptable values
each, or a reference to a one or more specifications that
such descriptions. (The "rfc822" address-type, "smtp" diagnostic
type, and "dns" MTA-name-type are defined in [4].)
forms for address-type, diagnostic-type, and MTA-name-type appear
section 8 of this document

IANA will not accept registrations for any address-type, diagnostic
type, or MTA-name-type name that begins with "X-". These type
are reserved for experimental use

2.1.3 Lexical tokens imported from RFC 822

The following lexical tokens, defined in [6], are used in the
grammar for DSNs: atom, CHAR, comment, CR, CRLF, DIGIT, LF, linear
white-space, SPACE, text. The date-time lexical token is defined
[8].








Moore & Vaudreuil Standards Track [Page 10]

RFC 1894 Delivery Status Notifications January 1996


2.2 Per-Message DSN

Some fields of a DSN apply to all of the delivery attempts
by that DSN. These fields may appear at most once in any DSN.
fields are used to correlate the DSN with the original
transaction and to provide additional information which may be
to gateways

per-message-fields =
[ original-envelope-id-field CRLF ]
reporting-mta-field
[ dsn-gateway-field CRLF ]
[ received-from-mta-field CRLF ]
[ arrival-date-field CRLF ]
*( extension-field CRLF )

2.2.1 The Original-Envelope-Id

The optional Original-Envelope-Id field contains an "
identifier" which uniquely identifies the transaction during
the message was submitted, and was either (a) specified by the
and supplied to the sender's MTA, or (b) generated by the sender'
MTA and made available to the sender when the message was submitted
Its purpose is to allow the sender (or her user agent) to
the returned DSN with the specific transaction in which the
was sent

If such an envelope identifier was present in the envelope
accompanied the message when it arrived at the Reporting MTA,
SHOULD be supplied in the Original-Envelope-Id field of any
issued as a result of an attempt to deliver the message. Except
a DSN is issued by the sender's MTA, an MTA MUST NOT supply
field unless there is an envelope-identifier field in the
which accompanied this message on its arrival at the Reporting MTA

The Original-Envelope-Id field is defined as follows

original-envelope-id-field =
"Original-Envelope-Id" ":" envelope-

envelope-id = *

There may be at most one Original-Envelope-Id field per DSN

The envelope-id is CASE-SENSITIVE. The DSN MUST preserve
original case and spelling of the envelope-id





Moore & Vaudreuil Standards Track [Page 11]

RFC 1894 Delivery Status Notifications January 1996


NOTE: The Original-Envelope-Id is NOT the same as the Message-Id
the message header. The Message-Id identifies the content of
message, while the Original-Envelope-Id identifies the transaction
which the message is sent

2.2.2 The Reporting-MTA DSN

reporting-mta-field =
"Reporting-MTA" ":" mta-name-type ";" mta-

mta-name = *

The Reporting-MTA field is defined as follows

A DSN describes the results of attempts to deliver, relay, or
a message to one or more recipients. In all cases, the Reporting-
is the MTA which attempted to perform the delivery, relay, or
operation described in the DSN. This field is required

Note that if an SMTP client attempts to relay a message to an
server and receives an error reply to a RCPT command, the client
responsible for generating the DSN, and the client's domain name
appear in the Reporting-MTA field. (The server's domain name
appear in the Remote-MTA field.)

Note that the Reporting-MTA is not necessarily the MTA which
issued the DSN. For example, if an attempt to deliver a
outside of the Internet resulted in a nondelivery notification
was gatewayed back into Internet mail, the Reporting-MTA field of
resulting DSN would be that of the MTA that originally reported
delivery failure, not that of the gateway which converted the
notification into a DSN. See Figure 2.



















Moore & Vaudreuil Standards Track [Page 12]

RFC 1894 Delivery Status Notifications January 1996


sender's environment recipient's
............................ ..........................................
: :
(1) : : (2)
+-----+ +--------+ +--------+ +---------+ +---------+ +------+
| | | | | | |Received-| | | | |
| |=>|Original|=>| |->| From |->|Reporting|-->|Remote
| user| | MTA | | | | MTA | | MTA | |agent| +--------+ |Gateway | +---------+ +----v----+ +------+
| | | | |
| | <============| |<-------------------+
+-----+ | |(4) (3)
+--------+
: :
...........................: :.........................................

Figure 2. DSNs in the presence of

(1) message is gatewayed into recipient's
(2) attempt to relay message
(3) reporting-mta (in recipient's environment) returns

(4) gateway translates foreign notification into a



The mta-name portion of the Reporting-MTA field is
according to the conventions indicated by the mta-name-type subfield
If an MTA functions as a gateway between dissimilar mail
and thus is known by multiple names depending on the environment,
mta-name subfield SHOULD contain the name used by the
from which the message was accepted by the Reporting-MTA

Because the exact spelling of an MTA name may be significant in
particular environment, MTA names are CASE-SENSITIVE

2.2.3 The DSN-Gateway

The DSN-Gateway field indicates the name of the gateway or MTA
translated a foreign (non-Internet) delivery status notification
this DSN. This field MUST appear in any DSN which was translated
a gateway from a foreign system into DSN format, and MUST NOT
otherwise

dsn-gateway-field = "DSN-Gateway" ":" mta-name-type ";" mta-






Moore & Vaudreuil Standards Track [Page 13]

RFC 1894 Delivery Status Notifications January 1996


For gateways into Internet mail, the MTA-name-type will normally
"smtp", and the mta-name will be the Internet domain name of
gateway

2.2.4 The Received-From-MTA DSN

The optional Received-From-MTA field indicates the name of the
from which the message was received

received-from-mta-field =
"Received-From-MTA" ":" mta-name-type ";" mta-

If the message was received from an Internet host via SMTP,
contents of the mta-name subfield SHOULD be the Internet domain
supplied in the HELO or EHLO command, and the network address used
the SMTP client SHOULD be included as a comment enclosed
parentheses. (In this case, the MTA-name-type will be "smtp".)

The mta-name portion of the Received-From-MTA field is
according to the conventions indicated by the MTA-name-type subfield

Since case is significant in some mail systems, the exact spelling
including case, of the MTA name SHOULD be preserved

2.2.5 The Arrival-Date DSN

The optional Arrival-Date field indicates the date and time at
the message arrived at the Reporting MTA. If the Last-Attempt-
field is also provided in a per-recipient field, this can be used
determine the interval between when the message arrived at
Reporting MTA and when the report was issued for that recipient

arrival-date-field = "Arrival-Date" ":" date-

The date and time are expressed in RFC 822 'date-time' format,
modified by [8]. Numeric timezones ([+/-]HHMM format) MUST be used

2.3 Per-Recipient DSN

A DSN contains information about attempts to deliver a message to
or more recipients. The delivery information for any
recipient is contained in a group of contiguous per-recipient fields
Each group of per-recipient fields is preceded by a blank line








Moore & Vaudreuil Standards Track [Page 14]

RFC 1894 Delivery Status Notifications January 1996


The syntax for the group of per-recipient fields is as follows


per-recipient-fields =
[ original-recipient-field CRLF ]
final-recipient-field
action-field
status-field
[ remote-mta-field CRLF ]
[ diagnostic-code-field CRLF ]
[ last-attempt-date-field CRLF ]
[ will-retry-until-field CRLF ]
*( extension-field CRLF )

2.3.1 Original-Recipient

The Original-Recipient field indicates the original recipient
as specified by the sender of the message for which the DSN is
issued

original-recipient-field =
"Original-Recipient" ":" address-type ";" generic-

generic-address = *

The address-type field indicates the type of the original
address. If the message originated within the Internet,
address-type field field will normally be "rfc822", and the
will be according to the syntax specified in [6]. The
"unknown" should be used if the Reporting MTA cannot determine
type of the original recipient address from the message envelope

This field is optional. It should be included only if the sender
specified recipient address was present in the message envelope,
as by the SMTP extensions defined in [4]. This address is the
as that provided by the sender and can be used to
correlate DSN reports and message transactions

2.3.2 Final-Recipient

The Final-Recipient field indicates the recipient for which this
of per-recipient fields applies. This field MUST be present in
set of per-recipient data








Moore & Vaudreuil Standards Track [Page 15]

RFC 1894 Delivery Status Notifications January 1996


The syntax of the field is as follows

final-recipient-field =
"Final-Recipient" ":" address-type ";" generic-

The generic-address subfield of the Final-Recipient field
contain the mailbox address of the recipient (from the
envelope) as it was when the message was accepted for delivery by
Reporting MTA

The Final-Recipient address may differ from the address
provided by the sender, because it may have been transformed
forwarding and gatewaying into an totally unrecognizable mess
However, in the absence of the optional Original-Recipient field,
Final-Recipient field and any returned content may be the
information available with which to correlate the DSN with
particular message submission

The address-type subfield indicates the type of address expected
the reporting MTA in that context. Recipient addresses obtained
SMTP will normally be of address-type "rfc822".

NOTE: The Reporting MTA is not expected to ensure that the
actually conforms to the syntax conventions of the address-type
Instead, it MUST report exactly the address received in the envelope
unless that address contains characters such as CR or LF which
not appear in a DSN field

Since mailbox addresses (including those used in the Internet) may
case sensitive, the case of alphabetic characters in the address
be preserved

2.3.3 Action

The Action field indicates the action performed by the Reporting-
as a result of its attempt to deliver the message to this
address. This field MUST be present for each recipient named in
DSN

The syntax for the action-field is

action-field = "Action" ":" action-

action-value =
"failed" / "delayed" / "delivered" / "relayed" / "expanded






Moore & Vaudreuil Standards Track [Page 16]

RFC 1894 Delivery Status Notifications January 1996


The action-value may be spelled in any combination of upper and
case characters

"failed" indicates that the message could not be delivered to
recipient. The Reporting MTA has abandoned any attempts
deliver the message to this recipient. No
notifications should be expected

"delayed" indicates that the Reporting MTA has so far been unable
deliver or relay the message, but it will continue
attempt to do so. Additional notification messages may
issued as the message is further delayed or
delivered, or if delivery attempts are later abandoned

"delivered" indicates that the message was successfully delivered
the recipient address specified by the sender,
includes "delivery" to a mailing list exploder. It
not indicate that the message has been read. This is
terminal state and no further DSN for this recipient
be expected

"relayed" indicates that the message has been relayed or
into an environment that does not accept responsibility
generating DSNs upon successful delivery. This action
value SHOULD NOT be used unless the sender has
notification of successful delivery for this recipient

"expanded" indicates that the message has been successfully
to the recipient address as specified by the sender,
forwarded by the Reporting-MTA beyond that destination
multiple additional recipient addresses. An action-
of "expanded" differs from "delivered" in that "expanded
is not a terminal state. Further "failed" and/or "delayed
notifications may be provided

Using the terms "mailing list" and "alias" as defined
[4], section 7.2.7: An action-value of "expanded" is
to be used when the message is delivered to a multiple
recipient "alias". An action-value of "expanded"
NOT be used with a DSN issued on delivery of a message to
"mailing list".

NOTE ON ACTION VS. STATUS CODES: Although the 'action' field
seem to be redundant with the 'status' field, this is not the case
In particular, a "temporary failure" ("4") status code could be
with an action-value of either "delayed" or "failed". For example
assume that an SMTP client repeatedly tries to relay a message to
mail exchanger for a recipient, but fails because a query to a



Moore & Vaudreuil Standards Track [Page 17]

RFC 1894 Delivery Status Notifications January 1996


name server timed out. After a few hours, it might issue a "delayed
DSN to inform the sender that the message had not yet been delivered
After a few days, the MTA might abandon its attempt to deliver
message and return a "failed" DSN. The status code (which
begin with a "4" to indicate "temporary failure") would be the
for both DSNs

Another example for which the action and status codes may
contradictory: If an MTA or mail gateway cannot deliver a
because doing so would entail conversions resulting in
unacceptable loss of information, it would issue a DSN with
'action' field of "failure" and a status code of 'XXX'. If
message had instead been relayed, but with some loss of information
it might generate a DSN with the same XXX status-code, but with
action field of "relayed".

2.3.4 Status

The per-recipient Status field contains a transport-
status code which indicates the delivery status of the message
that recipient. This field MUST be present for each delivery
which is described by a DSN

The syntax of the status field is

status-field = "Status" ":" status-

status-code = DIGIT "." 1*3DIGIT "." 1*3

; White-space characters and comments are NOT allowed within
; status-code, though a comment enclosed in parentheses MAY
; the last numeric subfield of the status-code. Each
; subfield within the status-code MUST be expressed
; leading zero digits

Status codes thus consist of three numerical fields separated by ".".
The first sub-field indicates whether the delivery attempt
successful (2 = success, 4 = persistent temporary failure, 5 =
permanent failure). The second sub-field indicates the
source of any delivery anomalies, and the third sub-field denotes
precise error condition, if known

The initial set of status-codes is defined in [5].








Moore & Vaudreuil Standards Track [Page 18]

RFC 1894 Delivery Status Notifications January 1996


2.3.5 Remote-MTA

The value associated with the Remote-MTA DSN field is a
ASCII representation of the name of the "remote" MTA that
delivery status to the "reporting" MTA

remote-mta-field = "Remote-MTA" ":" mta-name-type ";" mta-

NOTE: The Remote-MTA field preserves the "while talking to
information that was provided in some pre-existing
reports

This field is optional. It MUST NOT be included if no remote MTA
involved in the attempted delivery of the message to that recipient

2.3.6 Diagnostic-Code

For a "failed" or "delayed" recipient, the Diagnostic-Code DSN
contains the actual diagnostic code issued by the mail transport
Since such codes vary from one mail transport to another,
diagnostic-type subfield is needed to specify which type
diagnostic code is represented

diagnostic-code-field =
"Diagnostic-Code" ":" diagnostic-type ";" *

NOTE: The information in the Diagnostic-Code field may be
redundant with that from the Status field. The Status field
needed so that any DSN, regardless of origin, may be understood
any user agent or gateway that parses DSNs. Since the Status
will sometimes be less precise than the actual transport
code, the Diagnostic-Code field is provided to retain the
information. Such information may be useful in a trouble ticket
to the administrator of the Reporting MTA, or when tunneling
nondelivery reports through DSNs

If the Diagnostic Code was obtained from a Remote MTA during
attempt to relay the message to that MTA, the Remote-MTA field
be present. When interpreting a DSN, the presence of a Remote-
field indicates that the Diagnostic Code was issued by the
MTA. The absence of a Remote-MTA indicates that the Diagnostic
was issued by the Reporting MTA

In addition to the Diagnostic-Code itself, additional
description of the diagnostic, MAY appear in a comment enclosed
parentheses





Moore & Vaudreuil Standards Track [Page 19]

RFC 1894 Delivery Status Notifications January 1996


This field is optional, because some mail systems supply
additional information beyond that which is returned in the 'action
and 'status' fields. However, this field SHOULD be included
transport-specific diagnostic information is available

2.3.7 Last-Attempt-Date

The Last-Attempt-Date field gives the date and time of the
attempt to relay, gateway, or deliver the message (whether
or unsuccessful) by the Reporting MTA. This is not necessarily
same as the value of the Date field from the header of the
used to transmit this delivery status notification: In cases
the DSN was generated by a gateway, the Date field in the
header contains the time the DSN was sent by the gateway and the
Last-Attempt-Date field contains the time the last delivery
occurred

last-attempt-date-field = "Last-Attempt-Date" ":" date-

This field is optional. It MUST NOT be included if the actual
and time of the last delivery attempt are not available (which
be the case if the DSN were being issued by a gateway).

The date and time are expressed in RFC 822 'date-time' format,
modified by [8]. Numeric timezones ([+/-]HHMM format) MUST be used

3.2.1.5 final-log-id

The "final-log-id" field gives the final-log-id of the message
was used by the final-mta. This can be useful as an index to
final-mta's log entry for that delivery attempt

final-log-id-field = "Final-Log-ID" ":" *

This field is optional

2.3.8 Will-Retry-Until

For DSNs of type "delayed", the Will-Retry-Until field gives the
after which the Reporting MTA expects to abandon all attempts
deliver the message to that recipient. The Will-Retry-Until field
optional for "delay" DSNs, and MUST NOT appear in other DSNs

will-retry-until-field = "Will-Retry-Until" ":" date-

The date and time are expressed in RFC 822 'date-time' format,
modified by [8]. Numeric timezones ([+/-]HHMM format) MUST be used




Moore & Vaudreuil Standards Track [Page 20]

RFC 1894 Delivery Status Notifications January 1996


2.4 Extension

Additional per-message or per-recipient DSN fields may be defined
the future by later revisions or extensions to this specification
Extension-field names beginning with "X-" will never be defined
standard fields; such names are reserved for experimental use.
field names NOT beginning with "X-" MUST be registered with
Internet Assigned Numbers Authority (IANA) and published in an RFC

Extension DSN fields may be defined for the following reasons

(a) To allow additional information from foreign delivery
reports to be tunneled through Internet DSNs. The names of
DSN fields should begin with an indication of the
environment name (e.g. X400-Physical-Forwarding-Address).

(b) To allow the transmission of diagnostic information which
specific to a particular mail transport protocol. The names
such DSN fields should begin with an indication of the
transport being used (e.g. SMTP-Remote-Recipient-Address).
fields should be used for diagnostic purposes only and not
user agents or mail gateways

(c) To allow transmission of diagnostic information which is
to a particular message transfer agent (MTA). The names of
DSN fields should begin with an indication of the
implementation which produced the DSN. (e.g. Foomail-Queue-ID).

MTA implementors are encouraged to provide adequate information,
extension fields if necessary, to allow an MTA maintainer
understand the nature of correctable delivery failures and how to
them. For example, if message delivery attempts are logged, the
might include information which allows the MTA maintainer to
find the log entry for a failed delivery attempt

If an MTA developer does not wish to register the meanings of
extension fields, "X-" fields may be used for this purpose. To
name collisions, the name of the MTA implementation should follow
"X-", (e.g. "X-Foomail-Log-ID").

3. Conformance and Usage

An MTA or gateway conforms to this specification if it generates
according to the protocol defined in this memo. For MTAs
gateways that do not support requests for positive
notification (such as in [4]), it is sufficient that delivery
reports use this protocol




Moore & Vaudreuil Standards Track [Page 21]

RFC 1894 Delivery Status Notifications January 1996


A minimal implementation of this specification need generate only
Reporting-MTA per-message field, and the Final-Recipient, Action,
Status fields for each attempt to deliver a message to a
described by the DSN. Generation of the other fields,
appropriate, is strongly recommended

MTAs and gateways MUST NOT generate the Original-Recipient field of
DSN unless the mail transfer protocol provides the address
specified by the sender at the time of submission. (Ordinary
does not make that guarantee, but the SMTP extension defined in [4]
permits such information to be carried in the envelope if it
available.)

Each sender-specified recipient address SHOULD result in at most
"delivered" or "failed" DSN for that recipient. If a positive DSN
requested (e.g. one using NOTIFY=SUCCESS in SMTP) for a
that is forwarded to multiple recipients of an "alias" (as defined
[4], section 7.2.7), the forwarding MTA SHOULD normally issue
"expanded" DSN for the originally-specified recipient and
propagate the request for a DSN to the forwarding addresses
Alternatively, the forwarding MTA MAY relay the request for a DSN
exactly one of the forwarding addresses and not propagate the
to the others

By contrast, successful submission of a message to a mailing
exploder is considered final delivery of the message. Upon
of a message to a recipient address corresponding to a mailing
exploder, the Reporting MTA SHOULD issue an appropriate DSN
as if the recipient address were that of an ordinary mailbox

NOTE: This is actually intended to make DSNs usable by mailing
themselves. Any message sent to a mailing list subscriber
have its envelope return address pointing to the list maintainer [
RFC 1123, section 5.3.7(E)]. Since DSNs are sent to the
return address, all DSNs resulting from delivery to the recipients
a mailing list will be sent to the list maintainer. The
maintainer may elect to mechanically process DSNs upon receipt,
thus automatically delete invalid addresses from the list. (
section 7 of this memo.)

This specification places no restrictions on the processing of
received by user agents or distribution lists

4. Security

The following security considerations apply when using DSNs





Moore & Vaudreuil Standards Track [Page 22]

RFC 1894 Delivery Status Notifications January 1996


4.1

DSNs may be forged as easily as ordinary Internet electronic mail
User agents and automatic mail handling facilities (such as
distribution list exploders) that wish to make automatic use of
should take appropriate precautions to minimize the potential
from denial-of-service attacks

Security threats related to forged DSNs include the sending of

(a) A falsified delivery notification when the message is not
to the indicated recipient
(b) A falsified non-delivery notification when the message was in
delivered to the indicated recipient
(c) A falsified Final-Recipient address
(d) A falsified Remote-MTA identification
(e) A falsified relay notification when the message is "dead ended".
(f) Unsolicited

4.2

Another dimension of security is confidentiality. There may be
in which a message recipient is autoforwarding messages but does
wish to divulge the address to which the messages are autoforwarded
The desire for such confidentiality will probably be heightened
"wireless mailboxes", such as pagers, become more widely used
autoforward addresses

MTA authors are encouraged to provide a mechanism which enables
end user to preserve the confidentiality of a forwarding address
Depending on the degree of confidentiality required, and the
of the environment to which a message were being forwarded,
might be accomplished by one or more of

(a) issuing a "relayed" DSN (if a positive DSN was requested) when
message is forwarded to a confidential forwarding address,
disabling requests for positive DSNs for the forwarded message

(b) declaring the message to be delivered, issuing a "delivered" DSN
re-sending the message to the confidential forwarding address,
arranging for no DSNs to be issued for the re-sent message

(c) omitting "Remote-*" or extension fields of a DSN whenever they
otherwise contain confidential information (such as a
forwarding address),

(d) for messages forwarded to a confidential address, setting
envelope return address (e.g. SMTP MAIL FROM address) to the



Moore & Vaudreuil Standards Track [Page 23]

RFC 1894 Delivery Status Notifications January 1996


reverse-path ("<>") (so that no DSNs would be sent from a
MTA to the original sender),

(e) for messages forwarded to a confidential address, disabling
notifications for the forwarded message (e.g. if the "next-hop"
uses ESMTP and supports the DSN extension, by using the NOTIFY=
parameter to the RCPT command),

(f) when forwarding mail to a confidential address, having
forwarding MTA rewrite the envelope return address for the
message and attempt delivery of that message as if the
MTA were the originator. On its receipt of final delivery status
the forwarding MTA would issue a DSN to the original sender

In general, any optional DSN field may be omitted if the
MTA site determines that inclusion of the field would impose
great a compromise of site confidentiality. The need for
confidentiality must be balanced against the utility of the
information in trouble reports and DSNs gatewayed to
environments

Implementors are cautioned that many existing MTAs will
nondelivery notifications to a return address in the message
(rather than to the one in the envelope), in violation of SMTP
other protocols. If a message is forwarded through such an MTA,
reasonable action on the part of the forwarding MTA will prevent
downstream MTA from compromising the forwarding address. Likewise
if the recipient's MTA automatically responds to messages based on
request in the message header (such as the nonstandard, but
used, Return-Receipt-To extension header), it will also
the forwarding address

4.3 Non-

Within the framework of today's internet mail, the DSNs defined
this memo provide valuable information to the mail user; however
even a "failed" DSN can not be relied upon as a guarantee that
message was not received by the recipient. Even if DSNs are
actively forged, conditions exist under which a message can
delivered despite the fact that a failure DSN was issued











Moore & Vaudreuil Standards Track [Page 24]

RFC 1894 Delivery Status Notifications January 1996


For example, a race condition in the SMTP protocol allows for
duplication of messages if the connection is dropped following
completed DATA command, but before a response is seen by the
client. This will cause the SMTP client to retransmit the message
even though the SMTP server has already accepted it.[9] If one
those delivery attempts succeeds and the other one fails, a "failed
DSN could be issued even though the message actually reached
recipient











































Moore & Vaudreuil Standards Track [Page 25]

RFC 1894 Delivery Status Notifications January 1996


5. Appendix - collected

NOTE: The following lexical tokens are defined in RFC 822: atom
CHAR, comment, CR, CRLF, DIGIT, LF, linear-white-space, SPACE, text
The date-time lexical token is defined in [8].

action-field = "Action" ":" action-

action-value =
"failed" / "delayed" / "delivered" / "relayed" / "expanded

address-type =

arrival-date-field = "Arrival-Date" ":" date-

delivery-status-content =
per-message-fields 1*( CRLF per-recipient-fields )

diagnostic-code-field =
"Diagnostic-Code" ":" diagnostic-type ";" *

diagnostic-type =

dsn-gateway-field = "DSN-Gateway" ":" mta-name-type ";" mta-

envelope-id = *

extension-field = extension-field-name ":" *

extension-field-name =

final-recipient-field =
"Final-Recipient" ":" address-type ";" generic-

generic-address = *

last-attempt-date-field = "Last-Attempt-Date" ":" date-

mta-name = *

mta-name-type =

original-envelope-id-field =
"Original-Envelope-Id" ":" envelope-

original-recipient-field =
"Original-Recipient" ":" address-type ";" generic-




Moore & Vaudreuil Standards Track [Page 26]

RFC 1894 Delivery Status Notifications January 1996


per-message-fields =
[ original-envelope-id-field CRLF ]
reporting-mta-field
[ dsn-gateway-field CRLF ]
[ received-from-mta-field CRLF ]
[ arrival-date-field CRLF ]
*( extension-field CRLF )

per-recipient-fields =
[ original-recipient-field CRLF ]
final-recipient-field
action-field
status-field
[ remote-mta-field CRLF ]
[ diagnostic-code-field CRLF ]
[ last-attempt-date-field CRLF ]
[ will-retry-until-field CRLF ]
*( extension-field CRLF )

received-from-mta-field =
"Received-From-MTA" ":" mta-name-type ";" mta-

remote-mta-field = "Remote-MTA" ":" mta-name-type ";" mta-

reporting-mta-field =
"Reporting-MTA" ":" mta-name-type ";" mta-

status-code = DIGIT "." 1*3DIGIT "." 1*3

; White-space characters and comments are NOT allowed within
; status-code, though a comment enclosed in parentheses MAY
; the last numeric subfield of the status-code. Each
; subfield within the status-code MUST be expressed
; leading zero digits

status-field = "Status" ":" status-

will-retry-until-field = "Will-Retry-Until" ":" date-













Moore & Vaudreuil Standards Track [Page 27]

RFC 1894 Delivery Status Notifications January 1996


6. Appendix - Guidelines for gatewaying

NOTE: This section provides non-binding recommendations for
construction of mail gateways that wish to provide semi-
delivery reports between the Internet and another electronic
system. Specific DSN gateway requirements for a particular pair
mail systems may be defined by other documents

6.1 Gatewaying from other mail systems to

A mail gateway may issue a DSN to convey the contents of a "foreign
delivery or non-delivery notification over Internet mail. When
are appropriate mappings from the foreign notification elements
DSN fields, the information may be transmitted in those DSN fields
Additional information (such as might be useful in a trouble
or needed to tunnel the foreign notification through the Internet
may be defined in extension DSN fields. (Such fields should be
names that identify the foreign mail protocol, e.g. X400-* for X.400
NDN or DN protocol elements

The gateway must attempt to supply reasonable values for
Reporting-MTA, Final-Recipient, Action, and Status fields.
will normally be obtained by translating the values from the
delivery or non-delivery notification into their Internet-
equivalents. However, some loss of information is to be expected
For example, the set of status-codes defined for DSNs may not
adequate to fully convey the delivery diagnostic code from
foreign system. The gateway should assign the most precise
which describes the failure condition, falling back on "generic
codes such as 2.0.0 (success), 4.0.0 (temporary failure), and 5.0.0
(permanent failure) when necessary. The actual foreign
code should be retained in the Diagnostic-Code field (with
appropriate diagnostic-type value) for use in trouble tickets
tunneling

The sender-specified recipient address, and the original envelope-id
if present in the foreign transport envelope, should be preserved
the Original-Recipient and Original-Envelope-ID fields

The gateway should also attempt to preserve the "final"
addresses and MTA names from the foreign system. Whenever possible
foreign protocol elements should be encoded as meaningful
ASCII strings

For DSNs produced from foreign delivery or nondelivery notifications
the name of the gateway MUST appear in the DSN-Gateway field of
DSN




Moore & Vaudreuil Standards Track [Page 28]

RFC 1894 Delivery Status Notifications January 1996


6.2 Gatewaying from DSNs to other mail

It may be possible to gateway DSNs from the Internet into a
mail system. The primary purpose of such gatewaying is to
delivery status information in a form that is usable by
destination system. A secondary purpose is to allow "tunneling"
DSNs through foreign mail systems, in case the DSN may be
back into the Internet

In general, the recipient of the DSN (i.e., the sender of
original message) will want to know, for each recipient: the
available approximation to the original recipient address,
delivery status (success, failure, or temporary failure), and
failed deliveries, a diagnostic code that describes the reason
the failure

If possible, the gateway should attempt to preserve the Original
Recipient address and Original-Envelope-ID (if present), in
resulting foreign delivery status report

When