Network Working Group K. Moore Request for Comments: 3464 University of Tennessee Obsoletes: 1894 G. Vaudreuil Category: Standards Track Lucent Technologies January 2003 An Extensible Message Format for Delivery Status Notifications 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 (2003). All Rights Reserved.
AbstractThis memo defines a Multipurpose Internet Mail Extensions (MIME) content-type that may be used by a message transfer agent (MTA) or electronic mail gateway to report the result of an attempt to deliver a message to one or more recipients. This content-type is intended as a machine-processable replacement for the various types of delivery status notifications currently used in Internet electronic mail. Because many messages are sent between the Internet and other messaging systems (such as X.400 or the so-called "Local Area Network (LAN)-based" systems), the Delivery Status Notification (DSN) protocol is designed to be useful in a multi-protocol messaging environment. To this end, the protocol described in this memo provides for the carriage of "foreign" addresses and error codes, in addition to those normally used in Internet mail. Additional attributes may also be defined to support "tunneling" of foreign notifications through Internet mail.
1. Introduction ....................................................3 1.1 Purposes .....................................................3 1.2 Requirements .................................................4 1.3 Terminology ..................................................5 2. Format of a Delivery Status Notification ........................7 2.1 The message/delivery-status content-type .....................9 2.1.1 General conventions for DSN fields ........................9 2.1.2 "*-type" sub-fields .......................................9 2.1.3 Lexical tokens imported from RFC 822 .....................10 2.2 Per-Message DSN Fields ......................................11 2.2.1 The Original-Envelope-Id field ...........................11 2.2.2 The Reporting-MTA DSN field ..............................12 2.2.3 The DSN-Gateway field ....................................13 2.2.4 The Received-From-MTA DSN field ..........................14 2.2.5 The Arrival-Date DSN field ...............................14 2.3 Per-Recipient DSN fields ....................................14 2.3.1 Original-Recipient field .................................15 2.3.2 Final-Recipient field ....................................15 2.3.3 Action field .............................................16 2.3.4 Status field .............................................18 2.3.5 Remote-MTA field .........................................19 2.3.6 Diagnostic-Code field ....................................19 2.3.7 Last-Attempt-Date field ..................................20 2.3.8 final-log-id field .......................................20 2.3.9 Will-Retry-Until field ...................................20 2.4 Extension fields ............................................21 3. Conformance and Usage Requirements .............................22 4. Security Considerations ........................................23 4.1 Forgery .....................................................23 4.2 Confidentiality .............................................23 4.3 Non-Repudiation .............................................25 5. Normative References ...........................................25 6. Acknowledgments ................................................26 Appendix A - Collected Grammar ....................................27 Appendix B - Guidelines for Gatewaying DSNS .......................29 Gatewaying from other mail systems to DSNs ......................29 Gatewaying from DSNs to other mail systems ......................30 Appendix C - Guidelines for Use of DSNS By Mailing List Exploders .30 Appendix D - IANA Registration Forms for DSN Types ................31 IANA registration form for address-type .........................32 IANA registration form for diagnostic-type ......................32 IANA registration form for MTA-name-type ........................32 Appendix E - Examples .............................................33 Simple DSN ......................................................34 Multi-Recipient DSN .............................................35 DSN from gateway to foreign system ..............................36
Delayed DSN .....................................................37 Appendix F - Changes from RFC 1894 ................................38 Authors' Addresses ................................................39 Full Copyright Statement ..........................................40 MIME1] content-type for Delivery Status Notifications (DSNs). A DSN can be used to notify the sender of a message of any of several conditions: failed delivery, delayed delivery, successful delivery, or the gatewaying of a message into an environment that may not support DSNs. The "message/delivery-status" content-type defined herein is intended for use within the framework of the "multipart/report" content type defined in [REPORT]. This memo defines only the format of the notifications. An extension to the Simple Message Transfer Protocol (SMTP) [SMTP] to fully support such notifications is the subject of a separate memo [DRPT]. Document Conventions The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14, RFC 2119 [RFC2119].
(e) Allow "foreign" notifications to be tunneled through a MIME- capable message system and back into the original messaging system that issued the original notification, or even to a third messaging system; (f) Allow language-independent and medium-independent, yet reasonably precise, indications of the reason for the failure of a message to be delivered; and (g) Provide sufficient information to remote MTA maintainers (via "trouble tickets") so that they can understand the nature of reported errors. This feature is used in the case that failure to deliver a message is due to the malfunction of a remote MTA and the sender wants to report the problem to the remote MTA administrator.
A DSN contains a set of per-message fields that identify the message and the transaction during which the message was submitted, along with other fields that apply to all delivery attempts described by the DSN. The DSN also includes a set of per-recipient fields to convey the result of the attempt to deliver the message to each of one or more recipients.
delivered. In this case the relaying MTA is the Reporting MTA, and the "next hop" MTA is known as the Remote MTA. Figure 1 illustrates the relationship between the various MTAs. +-----+ +--------+ +---------+ +---------+ +------+ | | | | |Received-| | | | | | | => |Original| => ... => | From | => |Reporting| ===> |Remote| | user| | MTA | | MTA | | MTA | <No! | MTA | |agent| +--------+ +---------+ +----v----+ +------+ | | | | | <-------------------------------------------+ +-----+ (DSN returned to sender by Reporting MTA) Figure 1. Original, Received-From, Reporting and Remote MTAs Each of these MTAs may provide information that is useful in a DSN: + Ideally, the DSN will contain the address of each recipient as originally specified to the Original MTA by the sender of the message. This version of the address is needed (rather than a forwarding address or some modified version of the original address) so that the sender may compare the recipient address in the DSN with the address in the sender's records (e.g., an address book for an individual, the list of subscribers for a mailing list) and take appropriate action. Similarly, the DSN might contain an "envelope identifier" that was known to both the sender's user agent and the Original MTA at the time of message submission, and which, if included in the DSN, can be used by the sender to keep track of which messages were or were not delivered. + If a message was (a) forwarded to a different address than that specified by the sender, (b) gatewayed to a different mail system than that used by the sender, or (c) subjected to address rewriting during transmission, the "final" form of the recipient address (i.e., the one seen by the Reporting MTA) will be different than the original (sender-specified) recipient address. Just as the sender's user agent (or the sender) prefers the original recipient address, so the "final" address is needed when reporting a problem to the postmaster of the site where message delivery failed, because only the final recipient address will allow her to reproduce the conditions that caused the failure.
+ A "failed" DSN should contain the most accurate explanation for the delivery failure that is available. For ease of interpretation, this information should be a format that is independent of the mail transport system that issued the DSN. However, if a foreign error code is translated into some transport-independent format, some information may be lost. It is therefore desirable to provide both a transport-independent status code and a mechanism for reporting transport-specific codes. Depending on the circumstances that produced delivery failure, the transport-specific code might be obtained from either the Reporting MTA or the Remote MTA. Since different values for "recipient address" and "delivery status code" are needed according to the circumstance in which a DSN will be used, and since the MTA that issues the DSN cannot anticipate those circumstances, the DSN format described here may contain both the original and final forms of a recipient address, and both a transport-independent and a transport-specific indication of delivery status. Extension fields may also be added by the Reporting MTA as needed to provide additional information for use in a trouble ticket or to preserve information for tunneling of foreign delivery reports through Internet DSNs. The Original, Reporting, and Remote MTAs may exist in very different environments and use dissimilar transport protocols, MTA names, address formats, and delivery status codes. DSNs therefore do not assume any particular format for mailbox addresses, MTA names, or transport-specific status codes. Instead, the various DSN fields that carry such quantities consist of a "type" sub-field followed by a sub-field whose contents are ordinary text characters, and the format of which is indicated by the "type" sub-field. This allows a DSN to convey these quantities regardless of format. REPORT]). When a multipart/report content is used to transmit a DSN: (a) The report-type parameter of the multipart/report content is "delivery-status". (b) The first component of the multipart/report contains a human- readable explanation of the DSN, as described in [REPORT].
(c) The second component of the multipart/report is of content-type message/delivery-status, described in section 2.1 of this document. (d) If the original message or a portion of the message is to be returned to the sender, it appears as the third component of the multipart/report. NOTE: For delivery status notifications gatewayed from foreign systems, the headers of the original message may not be available. In this case the third component of the DSN may be omitted, or it may contain "simulated" RFC 822 headers that contain equivalent information. In particular, it is very desirable to preserve the subject, date, and message-id (or equivalent) fields from the original message. The DSN MUST be addressed (in both the message header and the transport envelope) to the return address from the transport envelope which accompanied the original message for which the DSN was generated. (For a message that arrived via SMTP, the envelope return address appears in the MAIL FROM command.) The From field of the message header of the DSN SHOULD contain the address of a human who is responsible for maintaining the mail system at the Reporting MTA site (e.g., Postmaster), so that a reply to the DSN will reach that person. Exception: if a DSN is translated from a foreign delivery report, and the gateway performing the translation cannot determine the appropriate address, the From field of the DSN MAY be the address of a human who is responsible for maintaining the gateway. The envelope sender address of the DSN SHOULD be chosen to ensure that no delivery status reports will be issued in response to the DSN 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 FROM command MUST use a NULL return address, i.e., "MAIL FROM:<>". A particular DSN describes the delivery status for exactly one message. However, an MTA MAY report on the delivery status for several recipients of the same message in a single DSN. Due to the nature of the mail transport system (where responsibility for delivery of a message to its recipients may be split among several MTAs, and delivery to any particular recipient may be delayed), multiple DSNs may still be issued in response to a single message submission.
section 4 of this memo. The message/delivery-status report type for use in the multipart/report is "delivery-status". The body of a message/delivery-status consists of one or more "fields" formatted according to the ABNF of RFC 822 header "fields" (see [RFC822]). The per-message fields appear first, followed by a blank line. Following the per-message fields are one or more groups of per-recipient fields. Each group of per-recipient fields is preceded by a blank line. Using the ABNF of RFC 822, the syntax of the 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. RFC 822, the same conventions for continuation lines and comments apply. Notification fields may be continued onto multiple lines by beginning each additional line with a SPACE or HTAB. Text that appears in parentheses is considered a comment and not part of the contents of that notification field. Field names are case-insensitive, so the names of notification fields may be spelled in any combination of upper and lower case letters. Comments in DSN fields may use the "encoded-word" construct defined in [MIME3].
The "-type" sub-fields are defined as follows: (a) An "address-type" specifies the format of a mailbox address. For example, Internet mail addresses use the "rfc822" address-type. address-type = atom (b) A "diagnostic-type" specifies the format of a status code. For example, when a DSN field contains a reply code reported via the Simple Mail Transfer Protocol [SMTP], the "smtp" diagnostic-type is used. diagnostic-type = atom (c) An "MTA-name-type" specifies the format of an MTA name. For example, for an SMTP server on an Internet host, the MTA name is the domain name of that host, and the "dns" MTA-name-type is used. mta-name-type = atom Values for address-type, diagnostic-type, and MTA-name-type are case-insensitive. Thus address-type values of "RFC822" and "rfc822" are equivalent. The Internet Assigned Numbers Authority (IANA) will maintain a registry of address-types, diagnostic-types, and MTA-name-types, along with descriptions of the meanings and acceptable values of each, or a reference to one or more specifications that provide such descriptions. (The "rfc822" address-type, "smtp" diagnostic-type, and "dns" MTA-name-type are defined in [DRPT].) Registration forms for address-type, diagnostic-type, and MTA-name-type appear in Appendix D. IANA will not accept registrations for any address-type, diagnostic-type, or MTA-name-type name that begins with "X-". These type names are reserved for experimental use. RFC822], are used in the ABNF grammar for DSNs: atom, CHAR, comment, CR, CRLF, DIGIT, LF, linear-white-space, SPACE, text. The date-time lexical token is defined in [HOSTREQ].
NOTE: The Original-Envelope-Id is NOT the same as the Message-Id from the message header. The Message-Id identifies the content of the message, while the Original-Envelope-Id identifies the transaction in which the message is sent. Figure 2.
sender's environment recipient's environment ............................ .......................................... : : (1) : : (2) +-----+ +--------+ +--------+ +---------+ +---------+ +------+ | | | | | | |Received-| | | | | | |=>|Original|=>| |->| From |->|Reporting|-->|Remote| | user| | MTA | | | | MTA | | MTA |<No| MTA | |agent| +--------+ |Gateway | +---------+ +----v----+ +------+ | | | | | | | <============| |<-------------------+ +-----+ | |(4) (3) +--------+ : : ...........................: :......................................... Figure 2. DSNs in the presence of gateways (1) message is gatewayed into recipient's environment (2) attempt to relay message fails (3) reporting-mta (in recipient's environment) returns non-delivery notification (4) gateway translates foreign notification into a DSN The mta-name portion of the Reporting-MTA field is formatted according to the conventions indicated by the mta-name-type sub-field. If an MTA functions as a gateway between dissimilar mail environments and thus is known by multiple names depending on the environment, the mta-name sub-field SHOULD contain the name used by the environment from which the message was accepted by the Reporting-MTA. Because the exact spelling of an MTA name may be significant in a particular environment, MTA names are CASE-SENSITIVE.
The syntax for the group of per-recipient fields is as follows: per-recipient-fields = [ original-recipient-field CRLF ] final-recipient-field CRLF action-field CRLF status-field CRLF [ remote-mta-field CRLF ] [ diagnostic-code-field CRLF ] [ last-attempt-date-field CRLF ] [ final-log-id-field CRLF ] [ will-retry-until-field CRLF ] *( extension-field CRLF ) RFC822]. The value "unknown" should be used if the Reporting MTA cannot determine the 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, such as by the SMTP extensions defined in [DRPT]. This address is the same as that provided by the sender and can be used to automatically correlate DSN reports and message transactions.
The syntax of the field is as follows: final-recipient-field = "Final-Recipient" ":" address-type ";" generic-address The generic-address sub-field of the Final-Recipient field MUST contain the mailbox address of the recipient (from the transport envelope), as it was when the Reporting MTA accepted the message for delivery. The Final-Recipient address may differ from the address originally provided by the sender, because it may have been transformed during forwarding and gatewaying into a totally unrecognizable mess. However, in the absence of the optional Original-Recipient field, the Final-Recipient field and any returned content may be the only information available with which to correlate the DSN with a particular message submission. The address-type sub-field indicates the type of address expected by the reporting MTA in that context. Recipient addresses obtained via SMTP will normally be of address-type "rfc822". NOTE: The Reporting MTA is not expected to ensure that the address 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 are not allowed in a DSN field. Since mailbox addresses (including those used in the Internet) may be case sensitive, the case of alphabetic characters in the address MUST be preserved.
"failed" indicates that the message could not be delivered to the recipient. The Reporting MTA has abandoned any attempts to deliver the message to this recipient. No further notifications should be expected. "delayed" indicates that the Reporting MTA has so far been unable to deliver or relay the message, but it will continue to attempt to do so. Additional notification messages may be issued as the message is further delayed or successfully delivered, or if delivery attempts are later abandoned. "delivered" indicates that the message was successfully delivered to the recipient address specified by the sender, which includes "delivery" to a mailing list exploder. It does not indicate that the message has been read. This is a terminal state and no further DSN for this recipient should be expected. "relayed" indicates that the message has been relayed or gatewayed into an environment that does not accept responsibility for generating DSNs upon successful delivery. This action-value SHOULD NOT be used unless the sender has requested notification of successful delivery for this recipient. "expanded" indicates that the message has been successfully delivered to the recipient address as specified by the sender, and forwarded by the Reporting-MTA beyond that destination to multiple additional recipient addresses. An action-value 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 in [DRPT], section 7.2.7: An action-value of "expanded" is only to be used when the message is delivered to a multiple-recipient "alias". An action-value of "expanded" SHOULD NOT be used with a DSN issued on delivery of a message to a "mailing list". NOTE ON ACTION VS. STATUS CODES: Although the 'action' field might seem to be redundant with the 'status' field, this is not the case. In particular, a "temporary failure" ("4") status code could be used with an action-value of either "delayed" or "failed". For example, assume that an SMTP client repeatedly tries to relay a message to the mail exchanger for a recipient, but fails because a query to a domain 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 the message and return a "failed" DSN. The status code (which would begin with a "4" to indicate "temporary failure") would be the same for both DSNs. Another example for which the action and status codes may appear contradictory: If an MTA or mail gateway cannot deliver a message because doing so would entail conversions resulting in an unacceptable loss of information, it would issue a DSN with the 'action' field of "failure" and a status code of 'XXX'. If the message had instead been relayed, but with some loss of information, it might generate a DSN with the same XXX status- code, but with an action field of "relayed". STATUS].
This field is optional, because some mail systems supply no additional information beyond that which is returned in the 'action' and 'status' fields. However, this field SHOULD be included if transport-specific diagnostic information is available. RFC 822 'date-time' format, as modified by [HOSTREQ]. Numeric timezones ([+/-]HHMM format) MUST be used.
DRPT]), it is sufficient that delivery failure reports use this protocol. A minimal implementation of this specification need generate only the Reporting-MTA per-message field, and the Final-Recipient, Action, and Status fields for each attempt to deliver a message to a recipient described by the DSN. Generation of the other fields, when appropriate, is strongly recommended. MTAs and gateways MUST NOT generate the Original-Recipient field of a DSN unless the mail transfer protocol provides the address originally specified by the sender at the time of submission. (Ordinary SMTP does not make that guarantee, but the SMTP extension defined in [DRPT] permits such information to be carried in the envelope if it is available.) Each sender-specified recipient address SHOULD result in at most one "delivered" or "failed" DSN for that recipient. If a positive DSN is requested (e.g., one using NOTIFY=SUCCESS in SMTP) for a recipient that is forwarded to multiple recipients of an "alias" (as defined in [DRPT], section 7.2.7), the forwarding MTA SHOULD normally issue a "expanded" DSN for the originally-specified recipient and not propagate the request for a DSN to the forwarding addresses. Alternatively, the forwarding MTA MAY relay the request for a DSN to exactly one of the forwarding addresses and not propagate the request to the others. By contrast, successful submission of a message to a mailing list exploder is considered final delivery of the message. Upon delivery of a message to a recipient address corresponding to a mailing list exploder, the Reporting MTA SHOULD issue an appropriate DSN exactly as if the recipient address were that of an ordinary mailbox. NOTE: This is actually intended to make DSNs usable by mailing lists themselves. Any message sent to a mailing list subscriber should have its envelope return address pointing to the list maintainer [see RFC 1123, section 5.3.7(E)]. Since DSNs are sent to the envelope return address, all DSNs resulting from delivery to the recipients of a mailing list will be sent to the list maintainer. The list maintainer may elect to mechanically process DSNs upon receipt, and thus automatically delete invalid addresses from the list. (See section 7 of this memo.)
This specification places no restrictions on the processing of DSNs received by user agents or distribution lists.
(a) issuing a "relayed" DSN (if a positive DSN was requested) when a message is forwarded to a confidential forwarding address, and 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, and arranging for no DSNs to be issued for the re-sent message, (c) omitting "Remote-*" or extension fields of a DSN whenever they would otherwise contain confidential information (such as a confidential forwarding address), (d) for messages forwarded to a confidential address, setting the envelope return address (e.g., SMTP MAIL FROM address) to the NULL reverse-path ("<>") (so that no DSNs would be sent from a downstream MTA to the original sender), (e) for messages forwarded to a confidential address, disabling delivery notifications for the forwarded message (e.g., if the "next-hop" MTA uses ESMTP and supports the DSN extension, by using the NOTIFY=NEVER parameter to the RCPT command), or (f) when forwarding mail to a confidential address, having the forwarding MTA rewrite the envelope return address for the forwarded message and attempt delivery of that message as if the forwarding 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 Reporting MTA site determines that inclusion of the field would impose too great a compromise of site confidentiality. The need for such confidentiality must be balanced against the utility of the omitted information in trouble reports and DSNs gatewayed to foreign environments. Implementers are cautioned that many existing MTAs will send non- delivery notifications to a return address in the message header (rather than to the one in the envelope), in violation of SMTP and other protocols. If a message is forwarded through such an MTA, no reasonable action on the part of the forwarding MTA will prevent the downstream MTA from compromising the forwarding address. Likewise, if the recipient's MTA automatically responds to messages based on a request in the message header (such as the nonstandard, but widely used, Return-Receipt-To extension header), it will also compromise the forwarding address.
SMTPDUP]. If one of those delivery attempts succeeds and the other one fails, a "failed" DSN could be issued even though the message actually reached the recipient. [DRPT] Moore, K., "SMTP Service Extension for Delivery Status Notifications", RFC 3461, January 2003. [DSN] Moore, K. and G. Vaudreuil, "An Extensible Message Format for Delivery Status Notifications", RFC 1894, January 1996. [HOSTREQ] Braden, R. (ed.), "Requirements for Internet Hosts - Application and Support", STD 3, RFC 1123, October 1989. [MIME1] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996. [MIME3] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text", RFC 2047, November 1996. [REPORT] Vaudreuil, G., "The Multipart/Report Content Type for the Reporting of Mail System Administrative Messages", RFC 3462, January 2003. [RFC822] Crocker, D., "Standard for the format of ARPA Internet Text Messages", STD 11, RFC 822, August 1982. [SMTP] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821, August 1982.
[SMTPDUP] Partridge, C., "Duplicate Messages and SMTP", RFC 1047, February 1988. [STATUS] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 3463, January 2003. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. RFC 1894, of which this document is a revision, and their suggestions for improvement: Eric Allman, Harald Alvestrand, Allan Cargille, Jim Conklin, Peter Cowen, Dave Crocker, Roger Fajman, Ned Freed, Marko Kaittola, Steve Kille, John Klensin, John Gardiner Myers, Mark Nahabedian, Julian Onions, Jacob Palme, Jean Charles Roy, and Gregory Sheehan.
RFC 822: atom, CHAR, comment, CR, CRLF, DIGIT, LF, linear-white-space, SPACE, text. The date-time lexical token is defined in [HOSTREQ]. action-field = "Action" ":" action-value action-value = "failed" / "delayed" / "delivered" / "relayed" / "expanded" address-type = atom arrival-date-field = "Arrival-Date" ":" date-time delivery-status-content = per-message-fields 1*( CRLF per-recipient-fields ) diagnostic-code-field = "Diagnostic-Code" ":" diagnostic-type ";" *text diagnostic-type = atom dsn-gateway-field = "DSN-Gateway" ":" mta-name-type ";" mta-name envelope-id = *text extension-field = extension-field-name ":" *text extension-field-name = atom final-recipient-field = "Final-Recipient" ":" address-type ";" generic-address final-log-id-field = "Final-Log-ID" ":" *text generic-address = *text last-attempt-date-field = "Last-Attempt-Date" ":" date-time mta-name = *text mta-name-type = atom original-envelope-id-field = "Original-Envelope-Id" ":" envelope-id
original-recipient-field = "Original-Recipient" ":" address-type ";" generic-address per-message-fields = [ original-envelope-id-field CRLF ] reporting-mta-field CRLF [ 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 CRLF action-field CRLF status-field CRLF [ remote-mta-field CRLF ] [ diagnostic-code-field CRLF ] [ last-attempt-date-field CRLF ] [ final-log-id-field CRLF ] [ will-retry-until-field CRLF ] *( extension-field CRLF ) received-from-mta-field = "Received-From-MTA" ":" mta-name-type ";" mta-name remote-mta-field = "Remote-MTA" ":" mta-name-type ";" mta-name reporting-mta-field = "Reporting-MTA" ":" mta-name-type ";" mta-name status-code = DIGIT "." 1*3DIGIT "." 1*3DIGIT ; White-space characters and comments are NOT allowed within a ; a status-code, though a comment enclosed in parentheses ; MAY follow the last numeric sub-field of the status-code. ; Each numeric sub-field within the status-code MUST be ; expressed without leading zero digits. status-field = "Status" ":" status-code will-retry-until-field = "Will-Retry-Until" ":" date-time
Gatewaying from DSNs to other mail systems It may be possible to gateway DSNs from the Internet into a foreign mail system. The primary purpose of such gatewaying is to convey delivery status information in a form that is usable by the destination system. A secondary purpose is to allow "tunneling" of DSNs through foreign mail systems, in case the DSN may be gatewayed back into the Internet. In general, the recipient of the DSN (i.e., the sender of the original message) will want to know, for each recipient: the closest available approximation to the original recipient address, the delivery status (success, failure, or temporary failure), and for failed deliveries, a diagnostic code that describes the reason for the failure. If possible, the gateway should attempt to preserve the Original- Recipient address and Original-Envelope-ID (if present), in the resulting foreign delivery status report. When reporting delivery failures, if the diagnostic-type sub-field of the Diagnostic-Code field indicates that the original diagnostic code is understood by the destination environment, the information from the Diagnostic-Code field should be used. Failing that, the information in the Status field should be mapped into the closest available diagnostic code used in the destination environment. If it is possible to tunnel a DSN through the destination environment, the gateway specification may define a means of preserving the DSN information in the delivery status reports used by that environment. section 7.2.7. DSNs are designed to be used by mailing list exploders to allow them to detect and automatically delete recipients for whom mail delivery fails repeatedly. When forwarding a message to list subscribers, the mailing list exploder should always set the envelope return address (e.g., SMTP MAIL FROM address) to point to a special address which is set up to receive non-delivery reports. A "smart" mailing list exploder can therefore intercept such non-delivery reports, and if they are in the DSN format, automatically examine them to determine for which recipients a message delivery failed or was delayed.
The Original-Recipient field should be used if available, since it should exactly match the subscriber address known to the list. If the Original-Recipient field is not available, the recipient field may resemble the list subscriber address. Often, however, the list subscriber will have forwarded his mail to a different address, or the address may be subject to some re-writing, so heuristics may be required to successfully match an address from the recipient field. Care is needed in this case to minimize the possibility of false matches. The reason for delivery failure can be obtained from the Status and Action fields, and from the Diagnostic-Code field (if the status-type is recognized). Reports for recipients with action values other than "failed" can generally be ignored; in particular, subscribers should not be removed from a list due to "delayed" reports. In general, almost any failure status code (even a "permanent" one) can result from a temporary condition. It is therefore recommended that a list exploder not delete a subscriber based on any single failure DSN (regardless of the status code), but only on the persistence of delivery failure over a period of time. However, some kinds of failures are less likely than others to have been caused by temporary conditions, and some kinds of failures are more likely to be noticed and corrected quickly than others. Once more precise status codes are defined, it may be useful to differentiate between the status codes when deciding whether to delete a subscriber. For example, on a list with a high message volume, it might be desirable to temporarily suspend delivery to a recipient address which causes repeated "temporary" failures, rather than simply deleting the recipient. The duration of the suspension might depend on the type of error. On the other hand, a "user unknown" error that persisted for several days could be considered a reliable indication that address were no longer valid.
To register a DSN type, complete the applicable form below and send it via Internet electronic mail to <IANA@IANA.ORG>. IANA registration form for address-type A registration for a DSN address-type MUST include the following information: (a) The proposed address-type name. (b) The syntax for mailbox addresses of this type, specified using BNF, regular expressions, ASN.1, or other non-ambiguous language. (c) If addresses of this type are not composed entirely of graphic characters from the US-ASCII repertoire, a specification for how they are to be encoded as graphic US-ASCII characters in a DSN Original-Recipient or Final-Recipient DSN field. (d) [optional] A specification for how addresses of this type are to be translated to and from Internet electronic mail addresses. IANA registration form for diagnostic-type A registration for a DSN address-type MUST include the following information: (a) The proposed diagnostic-type name. (b) A description of the syntax to be used for expressing diagnostic codes of this type as graphic characters from the US-ASCII repertoire. (c) A list of valid diagnostic codes of this type and the meaning of each code. (d) [optional] A specification for mapping from diagnostic codes of this type to DSN status codes (as defined in ). IANA registration form for MTA-name-type A registration for a DSN MTA-name-type must include the following information: (a) The proposed MTA-name-type name. (b) A description of the syntax of MTA names of this type, using BNF, regular expressions, ASN.1, or other non-ambiguous language.
(c) If MTA names of this type do not consist entirely of graphic characters from the US-ASCII repertoire, a specification for how an MTA name of this type should be expressed as a sequence of graphic US-ASCII characters.
Simple DSN This is a simple DSN issued after repeated attempts to deliver a message failed. In this case, the DSN is issued by the same MTA from which the message was originated. Date: Thu, 7 Jul 1994 17:16:05 -0400 From: Mail Delivery Subsystem <MAILER-DAEMON@CS.UTK.EDU> Message-Id: <199407072116.RAA14128@CS.UTK.EDU> Subject: Returned mail: Cannot send message for 5 days To: <firstname.lastname@example.org> MIME- Version: 1.0 Content-Type: multipart/report; report-type=delivery- status; boundary="RAA14128.773615765/CS.UTK.EDU" --RAA14128.773615765/CS.UTK.EDU The original message was received at Sat, 2 Jul 1994 17:10:28 -0400 from root@localhost ----- The following addresses had delivery problems ----- <email@example.com> (unrecoverable error) ----- Transcript of session follows ----- <firstname.lastname@example.org>... Deferred: Connection timed out with larry.slip.umd.edu. Message could not be delivered for 5 days Message will be deleted from queue --RAA14128.773615765/CS.UTK.EDU content-type: message/delivery-status Reporting-MTA: dns; cs.utk.edu Original-Recipient: rfc822;email@example.com Final-Recipient: rfc822;firstname.lastname@example.org Action: failed Status: 4.0.0 Diagnostic-Code: smtp; 426 connection timed out Last-Attempt-Date: Thu, 7 Jul 1994 17:15:49 -0400 --RAA14128.773615765/CS.UTK.EDU content-type: message/rfc822 [original message goes here] --RAA14128.773615765/CS.UTK.EDU--
Multi-Recipient DSN This is another DSN issued by the sender's MTA, which contains details of multiple delivery attempts. Some of these were detected locally, and others by a remote MTA. Date: Fri, 8 Jul 1994 09:21:47 -0400 From: Mail Delivery Subsystem <MAILER-DAEMON@CS.UTK.EDU> Subject: Returned mail: User unknown To: <owner-ups-mib@CS.UTK.EDU> MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="JAA13167.773673707/CS.UTK.EDU" --JAA13167.773673707/CS.UTK.EDU content-type: text/plain; charset=us-ascii ----- The following addresses had delivery problems ----- <email@example.com> (unrecoverable error) <firstname.lastname@example.org> (unrecoverable error) --JAA13167.773673707/CS.UTK.EDU content-type: message/delivery-status Reporting-MTA: dns; cs.utk.edu Original-Recipient: rfc822;email@example.com Final-Recipient: rfc822;firstname.lastname@example.org Action: failed Status: 5.0.0 (permanent failure) Diagnostic-Code: smtp; 550 'arathib@vnet.IBM.COM' is not a registered gateway user Remote-MTA: dns; vnet.ibm.com Original-Recipient: rfc822;email@example.com Final-Recipient: rfc822;firstname.lastname@example.org Action: delayed Status: 4.0.0 (hpnjld.njd.jp.com: host name lookup failure) Original-Recipient: rfc822;email@example.com Final-Recipient: rfc822;firstname.lastname@example.org Action: failed Status: 5.0.0 Diagnostic-Code: smtp; 550 user unknown Remote-MTA: dns; sdcc13.ucsd.edu --JAA13167.773673707/CS.UTK.EDU content-type: message/rfc822
[original message goes here] --JAA13167.773673707/CS.UTK.EDU-- DSN from gateway to foreign system A delivery report generated by Message Router (MAILBUS) and gatewayed by PMDF_MR to a DSN. In this case the gateway did not have sufficient information to supply an original-recipient address. Disclose-recipients: prohibited Date: Fri, 08 Jul 1994 09:21:25 -0400 (EDT) From: Message Router Submission Agent <AMMGR@corp.timeplex.com> Subject: Status of: Re: Battery current sense To: owner-ups-mib@CS.UTK.EDU Message-id: <01HEGJ0WNBY28Y95LN@mr.timeplex.com> MIME-version: 1.0 content-type: multipart/report; report-type=delivery-status; boundary="84229080704991.122306.SYS30" --84229080704991.122306.SYS30 content-type: text/plain Invalid address - nair_s %DIR-E-NODIRMTCH, No matching Directory Entry Entry found --84229080704991.122306.SYS30 content-type: message/delivery-status Reporting-MTA: mailbus; SYS30 Final-Recipient: unknown; nair_s Status: 5.0.0 (unknown permanent failure) Action: failed --84229080704991.122306.SYS30--
Delayed DSN A delay report from a multiprotocol MTA. Note that there is no returned content, so no third body part appears in the DSN. MIME-Version: 1.0 From: <email@example.com> Message-Id: <199407092338.TAA23293@CS.UTK.EDU> Received: from nsfnet-relay.ac.uk by sun2.nsfnet-relay.ac.uk id <firstname.lastname@example.org>; Sun, 10 Jul 1994 00:36:51 +0100 To: email@example.com Date: Sun, 10 Jul 1994 00:36:51 +0100 Subject: WARNING: message delayed at "nsfnet-relay.ac.uk" content-type: multipart/report; report-type=delivery-status; boundary=foobar --foobar content-type: text/plain The following message: UA-ID: Reliable PC (... Q-ID: sun2.nsf:77/msg.11820-0 has not been delivered to the intended recipient: firstname.lastname@example.org despite repeated delivery attempts over the past 24 hours. The usual cause of this problem is that the remote system is temporarily unavailable. Delivery will continue to be attempted up to a total elapsed time of 168 hours, i.e., 7 days. You will be informed if delivery proves to be impossible within this time. Please quote the Q-ID in any queries regarding this mail. --foobar content-type: message/delivery-status Reporting-MTA: dns; sun2.nsfnet-relay.ac.uk Final-Recipient: rfc822;email@example.com
Status: 4.0.0 (unknown temporary failure) Action: delayed --foobar--
Full Copyright Statement Copyright (C) The Internet Society (2003). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Acknowledgement Funding for the RFC Editor function is currently provided by the Internet Society.