RFC1891
RFC1891
Moore
Request for Comments: 1891 University of Tennessee
Category: Standards Track January 1996
1. Abstract
2. Introduction
Experience with large mail distribution lists [3] indicates that such
messages are often insufficient to diagnose problems, or even to
determine at which host or for which recipients a problem occurred.
In addition, the lack of a standardized format for delivery
notifications in Internet mail makes it difficult to exchange such
notifications with other message handling systems.
(a) is reliable, in the sense that any DSN request will either be
honored at the time of final delivery, or result in a response
that indicates that the request cannot be honored,
(2) the EHLO keyword value associated with this extension is "DSN",
the meaning of which is defined in section 4 of this memo;
(4) two optional parameters are added to the RCPT command, and two
optional parameters are added to the MAIL command:
The remainder of this memo specifies how support for the extension
effects the behavior of a message transfer agent.
An SMTP client wishing to request a DSN for a message may issue the
EHLO command to start an SMTP session, to determine if the server
supports any of several service extensions. If the server responds
with code 250 to the EHLO command, and the response includes the EHLO
This address need not be the same as the mailbox specified in the
RCPT command. For example, if a message was originally addressed
to A@B.C and later forwarded to A@D.E, after such forwarding has
taken place, the RCPT command will specify a mailbox of A@D.E.
However, the original recipient address remains A@B.C.
The extended RCPT and MAIL commands are issued by a client when it
wishes to request a DSN from the server, under certain conditions,
for a particular recipient. The extended RCPT and MAIL commands are
identical to the RCPT and MAIL commands defined in [1], except that
one or more of the following parameters appear after the sender or
recipient address, respectively. The general syntax for extended
SMTP commands is defined in [4].
NOTE: Although RFC 822 ABNF is used to describe the syntax of these
parameters, they are not, in the language of that document,
"structured field bodies". Therefore, while parentheses MAY appear
within an emstp-value, they are not recognized as comment delimiters.
The syntax for "esmtp-value" in [4] does not allow SP, "=", control
characters, or characters outside the traditional ASCII range of 1-
127 decimal to be transmitted in an esmtp-value. Because the ENVID
and ORCPT parameters may need to convey values outside this range,
the esmtp-values for these parameters are encoded as "xtext".
"xtext" is formally defined as follows:
xchar = any ASCII CHAR between "!" (33) and "~" (126) inclusive,
except for "+" and "=".
+ Any ASCII CHAR between "!" and "~" inclusive, except for "+" and "=",
MAY be encoded as itself. (A CHAR in this range MAY instead be
encoded as a "hexchar", at the implementor's discretion.)
+ ASCII CHARs that fall outside the range above must be encoded as
"hexchar".
Notes:
For compatibility with SMTP clients that do not use the NOTIFY
facility, the absence of a NOTIFY parameter in a RCPT command may be
interpreted as either NOTIFY=FAILURE or NOTIFY=FAILURE,DELAY.
addr-type = atom
The FULL and HDRS keywords may be spelled in any combination of upper
and lower case letters.
Note that the RET parameter only applies to DSNs that indicate
delivery failure for at least one recipient. If a DSN contains no
indications of delivery failure, only the headers of the message
should be returned.
The RET and ENVID parameters MUST NOT appear more than once each in
any single MAIL command. If more than one of either of these
parameters appears in a MAIL command, the ESMTP server SHOULD respond
with "501 syntax error in parameters or arguments".
The NOTIFY and ORCPT parameters MUST NOT appear more than once in any
RCPT command. If more than one of either of these parameters appears
in a RCPT command, the ESMTP server SHOULD respond with "501 syntax
error in parameters or arguments".
6. Conformance requirements
system. The DSN extension to SMTP may be used to allow UAs to convey
the sender's requests as to when DSNs should be issued. A UA which
claims to conform to this specification must meet certain
requirements as described below.
NOTE: A DSN MUST NOT be returned to the sender for any message for
which the return address from the SMTP MAIL command was NULL ("<>"),
even if the sender's address is available from other sources (e.g.
the message header). However, the MTA which would otherwise issue a
DSN SHOULD inform the local postmaster of delivery failures through
some appropriate mechanism that will not itself result in the
generation of DSNs.
(a) Any ENVID parameter included in the MAIL command when a message was
received, MUST also appear on the MAIL command with which the
message is relayed, with the same associated esmtp-value. If no
ENVID parameter was included in the MAIL command when the message
was received, the ENVID parameter MUST NOT be supplied when the
message is relayed.
(b) Any RET parameter included in the MAIL command when a message was
received, MUST also appear on the MAIL command with which the
message is relayed, with the same associated esmtp-value. If no RET
parameter was included in the MAIL command when the message was
received, the RET parameter MUST NOT supplied when the message is
relayed.
(c) If the NOTIFY parameter was supplied for a recipient when the
message was received, the RCPT command issued when the message is
relayed MUST also contain the NOTIFY parameter along with its
associated esmtp-value. If the NOTIFY parameter was not supplied
for a recipient when the message was received, the NOTIFY parameter
MUST NOT be supplied for that recipient when the message is relayed.
(d) If any ORCPT parameter was present in the RCPT command for a
recipient when the message was received, an ORCPT parameter with the
identical original-recipient-address MUST appear in the RCPT command
issued for that recipient when relaying the message. (For example,
the MTA therefore MUST NOT change the case of any alphabetic
characters in an ORCPT parameter.)
The following rules govern the behavior of a conforming MTA (in the
role of client), when relaying a message which was received via the
SMTP protocol, to an SMTP server that does not support the Delivery
Status Notification service extension:
(a) ENVID, NOTIFY, RET, or ORCPT parameters MUST NOT be issued when
relaying the message.
(b) If the NOTIFY parameter was supplied for a recipient, with an esmtp-
value containing the keyword SUCCESS, and the SMTP server returns a
success (2xx) reply-code in response to the RCPT command, the client
MUST issue a "relayed" DSN for that recipient.
(c) If the NOTIFY parameter was supplied for a recipient with an esmtp-
value containing the keyword FAILURE, and the SMTP server returns a
permanent failure (5xx) reply-code in response to the RCPT command,
the client MUST issue a "failed" DSN for that recipient.
(d) If the NOTIFY parameter was supplied for a recipient with an esmtp-
value of NEVER, the client MUST NOT issue a DSN for that recipient,
regardless of the reply-code returned by the SMTP server. However,
if the server returned a failure (5xx) reply-code, the client MAY
inform the local postmaster of the delivery failure via an
appropriate mechanism that will not itself result in the generation
of DSNs.
(e) If a NOTIFY parameter was not supplied for a recipient, and the SMTP
server returns a success (2xx) reply-code in response to a RCPT
command, the client MUST NOT issue any DSN for that recipient.
(f) If a NOTIFY parameter was not supplied for a recipient, and the SMTP
server returns a permanent failure (5xx) reply-code in response to a
RCPT command, the client MUST issue a "failed" DSN for that
recipient.
"Delivery" means that the message has been placed in the recipient's
mailbox. For messages which are transmitted to a mailbox for later
retrieval via IMAP [6], POP [7] or a similar message access protocol,
"delivery" occurs when the message is made available to the IMAP
(POP, etc.) service, rather than when the message is retrieved by the
recipient's user agent.
(a) If the NOTIFY parameter was supplied for that recipient, with an
esmtp-value containing the SUCCESS keyword, the MTA MUST issue a
"delivered" DSN for that recipient.
(b) If the NOTIFY parameter was supplied for that recipient which did
not contain the SUCCESS keyword, the MTA MUST NOT issue a DSN for
that recipient.
(c) If the NOTIFY parameter was not supplied for that recipient, the MTA
MUST NOT issue a DSN.
(b) If a NOTIFY parameter was supplied with the SUCCESS keyword, but the
destination environment cannot return an appropriate notification on
successful delivery, the MTA SHOULD issue a "relayed" DSN for that
recipient.
(d) If the NOTIFY parameter was not supplied for a particular recipient,
a DSN SHOULD NOT be issued by the gateway. The gateway SHOULD
attempt to ensure that appropriate notification will be provided by
the foreign mail environment if eventual delivery failure occurs,
and that no notification will be issued on successful delivery.
(a) If the NOTIFY parameter was supplied for a recipient and its value
included the DELAY keyword, a "delayed" DSN MAY be issued.
(c) If the NOTIFY parameter was supplied which did not contain the DELAY
keyword, a "delayed" DSN MUST NOT be issued.
(a) If a NOTIFY parameter was supplied for the recipient with an esmtp-
keyword containing the value FAILURE, a "failed" DSN MUST be issued
by the MTA.
(b) If a NOTIFY parameter was supplied for the recipient which did not
contain the value FAILURE, a DSN MUST NOT be issued for that
recipient. However, the MTA MAY inform the local postmaster of the
delivery failure via some appropriate mechanism which does not
itself result in the generation of DSNs.
(b) The ENVID, NOTIFY, RET, and ORCPT parameters which accompany the
redistributed message MUST NOT be derived from those of the original
message.
(c) The NOTIFY and RET parameters MAY be specified by the local
postmaster or the list administrator. If ORCPT parameters are
supplied during redistribution to the list subscribers, they SHOULD
(a) Any ENVID, NOTIFY, RET, or ORCPT parameters are NOT propagated when
relaying the message to any of the forwarding addresses. If the
NOTIFY parameter for the alias contained the SUCCESS keyword, the
MTA issues a "relayed" DSN. (In effect, the MTA treats the message
as if it were being relayed into an environment that does not
support DSNs.)
(b) Any ENVID, NOTIFY, RET, or ORCPT parameters (or the equivalent
requests if the message is gatewayed) are propagated to EXACTLY one
of the forwarding addresses. No DSN is issued. (This is
appropriate when aliasing is used to forward a message to a
"vacation" auto-responder program in addition to the local mailbox.)
(c) Any ENVID, RET, or ORCPT parameters are propagated to all forwarding
addresses associated with that alias. The NOTIFY parameter is
propagated to the forwarding addresses, except that it any SUCCESS
keyword is removed. If the original NOTIFY parameter for the alias
contained the SUCCESS keyword, an "expanded" DSN is issued for the
alias. If the NOTIFY parameter for the alias did not contain the
SUCCESS keyword, no DSN is issued for the alias.
The maximum sizes for the ENVID and ORCPT parameters are intended to
be adequate for the transmission of "foreign" envelope identifier and
original recipient addresses. However, user agents which use SMTP as
a message submission protocol SHOULD NOT generate ENVID parameters
which are longer than 38 characters in length.
The DSN sender address (in the SMTP MAIL command) MUST be a null
reverse-path ("<>"), as required by section 5.3.3 of [9]. The DSN
recipient address (in the RCPT command) is copied from the MAIL
command which accompanied the message for which the DSN is being
issued. When transmitting a DSN via SMTP, the RET parameter MUST NOT
be used. The NOTIFY parameter MAY be used, but its value MUST be
NEVER. The ENVID parameter (with a newly generated envelope-id)
and/or ORCPT parameter MAY be used.
When generating a DSN for a message which was received via the SMTP
protocol, a conforming MTA will generate the following fields of the
message/delivery-status body part:
(d) If the ORCPT parameter was provided for this recipient, the
Original-Recipient field MUST be supplied, with its value taken from
the ORCPT parameter. If no ORCPT parameter was provided for this
recipient, the Original-Recipient field MUST NOT appear.
(g) The Status field MUST be supplied, using a status-code from [10].
If there is no specific code which suitably describes a delivery
failure, either 4.0.0 (temporary failure), or 5.0.0 (permanent
failure) MUST be used.
(h) For DSNs resulting from attempts to relay a message to one or more
recipients via SMTP, the Remote-MTA field MUST be supplied for each
of those recipients. The mta-name-type subfields of those Remote-
MTA fields will be "dns".
(i) For DSNs resulting from attempts to relay a message to one or more
recipients via SMTP, the Diagnostic-Code MUST be supplied for each
of those recipients. The diagnostic-type subfield will be "smtp".
See section 9.2(a) of this document for a description of the "smtp"
diagnostic-code.
(j) For DSNs resulting from attempts to relay a message to one or more
recipients via SMTP, an SMTP-Remote-Recipient extension field MAY be
supplied for each recipient, which contains the address of that
recpient which was presented to the remote SMTP server.
8. Acknowledgments
The following type names are defined for use in DSN fields generated
by conforming SMTP-based MTAs:
[route] addr-spec
where "route" and "addr-spec" are defined in [2], and the "domain"
portions of both "route" and "addr-spec" are fully-qualified domain
names that are registered in the DNS. However, an MTA MUST NOT
modify an address obtained from the message envelope to force it to
conform to syntax rules.
550-mailbox unavailable
550 user has moved with no forwarding address
(c) A list of valid diagnostic codes of this type and the meaning of
each code.
(b) A description of the syntax of MTA names of this type, using BNF,
regular expressions, ASN.1, or other non-ambiguous language.
sub-domain = atom
NOTE: Formatting rules for RFCs require that no line be longer than
72 characters. Therefore, in the following examples, some SMTP
commands longer than 72 characters are printed on two lines, with the
first line ending in "\". In an actual SMTP transaction, such a
command would be sent as a single line (i.e. with no embedded CRLFs),
and without the "\" character that appears in these examples.
10.1 Submission
Alice's user agent sends the message to the SMTP server at Pure-
Heart.ORG. Note that while this example uses SMTP as a mail
submission protocol, other protocols could also be used.
To: Alice@Pure-Heart.ORG
From: postmaster@mail.Big-Bucks.COM
Subject: Delivery Notification (success) for Bob@Big-Bucks.COM
Content-Type: multipart/report; report-type=delivery-status;
boundary=abcde
MIME-Version: 1.0
--abcde
Content-type: text/plain; charset=us-ascii
--abcde
Content-type: message/delivery-status
Original-Recipient: rfc822;Bob@Big-Bucks.COM
Final-Recipient: rfc822;Bob@Big-Bucks.COM
Action: delivered
Status: 2.0.0
--abcde
Content-type: message/rfc822
--abcde--
To: Alice@Pure-Heart.ORG
From: postmaster@Pure-Heart.ORG
Subject: Delivery Notification (failure) for Carol@Ivory.EDU
Content-Type: multipart/report; report-type=delivery-status;
boundary=bcdef
MIME-Version: 1.0
--bcdef
Content-type: text/plain; charset=us-ascii
--bcdef
Content-type: message/delivery-status
Original-Recipient: rfc822;Carol@Ivory.EDU
Final-Recipient: rfc822;Carol@Ivory.EDU
SMTP-Remote-Recipient: Carol@Ivory.EDU
Diagnostic-Code: smtp; 550 error - no such recipient
Action: failed
Status: 5.0.0
--bcdef
Content-type: message/rfc822
--bcdef--
Although the mail gateway Ivory.EDU supports the DSN SMTP extension,
the LAN mail system attached to its other side does not generate
positive delivery confirmations. So Ivory.EDU issues a "relayed"
DSN:
To: Alice@Pure-Heart.ORG
From: postmaster@Ivory.EDU
Subject: mail relayed for Dana@Ivory.EDU
Content-Type: multipart/report; report-type=delivery-status;
boundary=cdefg
MIME-Version: 1.0
--cdefg
Content-type: text/plain; charset=us-ascii
ymail!Dana
--cdefg
Content-type: message/delivery-status
Original-Recipient: rfc822;Dana@Ivory.EDU
Final-Recipient: rfc822;Dana@Ivory.EDU
Action: relayed
Status: 2.0.0
--cdefg
Content-type: message/rfc822
--cdefg--
To: Alice@BigHeart.ORG
From: Postmaster@Boondoggle.GOV
Subject: Delivery failure for Sam@Boondoggle.GOV
Content-Type: multipart/report; report-type=delivery-status;
boundary=defgh
MIME-Version: 1.0
--defgh
Your message, originally addressed to George@Tax-ME.GOV, and forwarded
from there to Sam@Boondoggle.GOV could not be delivered, for the
following reason:
--defgh
Content-type: message/delivery-status
Reporting-MTA: Boondoggle.GOV
Original-Envelope-ID: QQ314159
Original-Recipient: rfc822;George@Tax-ME.GOV
Final-Recipient: rfc822;Sam@Boondoggle.GOV
Action: failed
Status: 4.2.2 (disk quota exceeded)
--defgh
Content-type: message/rfc822
--defgh--
11. References
[1] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821,
USC/Information Sciences Institute, August 1982.
[2] Crocker, D., "Standard for the Format of ARPA Internet Text
Messages", STD 11, RFC 822, UDEL, August 1982.
[4] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D. Crocker,
"SMTP Service Extensions", RFC 1651, MCI, Innosoft, Dover Beach
Consulting, Inc., Network Management Associates, Inc., Silicon
Graphics, Inc., July 1994.
[5] Moore, K., and G. Vaudreuil, "An Extensible Message Format for
Delivery Status Notifications", RFC 1894, University of Tennessee,
Octel Network Services, January 1996.
[6] Crispin, M., "Internet Message Access Protocol - Version 4", RFC
1730, University of Washington, 20 December 1994.
[7] Myers, J., and M. Rose, "Post Office Protocol - Version 3", RFC
1725, Carnegie Mellon, Dover Beach Consulting, November 1994.
[10] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 1893,
Octel Network Services, January 1996.
Keith Moore
University of Tennessee
107 Ayres Hall
Knoxville, TN 37996-1301
USA
EMail: moore@cs.utk.edu