RFC 1894
An Extensible Message Format for Delivery Status Notifications
An Extensible Message Format for Delivery Status Notifications ๐
Part 1 of 7, bestie! ๐ This is RFC 1894, from the Network Working Group, and it's Request for Comments: 1894. The authors are K. Moore (University of Tennessee) and G. Vaudreuil (Octel Network Services). It's a Standards Track document, dated January 1996. The title block doesn't list any Obsoletes or Updates entries. ๐
Status of This Memo ๐ฆ
Okay so this is an Internet standards track protocol for the Internet community ๐, and the authors want your discussion and suggestions for improvements. For the current standardization state and status, check the current edition of "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited โจ.
Abstract ๐ธ
This memo defines a MIME content-type that a message transfer agent (MTA) or electronic mail gateway may use to report the result of an attempt to deliver a message to one or more recipients. It's meant to be a machine-processable replacement for all the different delivery status notifications floating around Internet email right now ๐ค.
Because lots of messages travel between the Internet and other messaging systems (like X.400 or the so-called "LAN-based" systems), the DSN protocol is built to work in a multi-protocol messaging environment ๐. So this protocol provides for carrying "foreign" addresses and error codes, not just the ones normally used in Internet mail. Additional attributes may also be defined to support "tunneling" of foreign notifications through Internet mail ๐.
Questions, comments, and reports of defects or ambiguities in this spec can go to the NOTARY working group mailing list of the IETF at <notifications@cs.utk.edu>. To subscribe, email <notifications-request@cs.utk.edu>. Implementors are encouraged to subscribe so they hear about any problems that might hinder interoperability ๐ซถ.
NOTE: This document is a Proposed Standard. If and when this protocol is submitted for Draft Standard status, any normative text (phrases containing SHOULD, SHOULD NOT, MUST, MUST NOT, or MAY) in this document will be re-evaluated in light of implementation experience, and are thus subject to change. ๐
1. Introduction โจ
This memo defines a MIME [1] content-type for delivery status notifications (DSNs). A DSN can tell the sender of a message about any of several conditions: failed delivery, delayed delivery, successful delivery, or a message being gatewayed into an environment that may not support DSNs ๐ฌ. The message/delivery-status content-type defined here is meant to be used within the framework of the multipart/report content type defined in [2] ๐.
This memo only defines the format of the notifications. An extension to the Simple Message Transfer Protocol (SMTP) [3] that fully supports such notifications is the subject of a separate memo [4] ๐ง.
1.1 Purposes ๐ฏ
DSNs are expected to do a few main jobs:
- (a) Tell humans what's going on with message delivery processing, plus the reasons for any delivery problems or outright failures, in a way that's largely independent of human language ๐.
- (b) Let mail user agents track the delivery status of messages they sent, by matching returned DSNs to earlier message transmissions ๐.
- (c) Let mailing list exploders automatically maintain their subscriber lists when delivery attempts keep failing ๐.
- (d) Carry delivery and non-delivery notifications that come back from attempts to deliver messages to "foreign" mail systems through a gateway ๐ช.
- (e) Let "foreign" notifications get tunneled through a MIME-capable message system and back into the original messaging system that issued the notification, or even over to a third messaging system ๐.
- (f) Give language-independent, yet reasonably precise, reasons for why a message failed to be delivered (once status codes of sufficient precision are defined) ๐.
- (g) Give remote MTA maintainers enough info (via "trouble tickets") to understand the nature of reported errors ๐ซ. This is for when a delivery failure is caused by a malfunctioning remote MTA and the sender wants to report the problem to that remote MTA's administrator ๐ ๏ธ.
1.2 Requirements ๐
These purposes put the following constraints on the notification protocol, and they're not optional, bestie ๐ค:
- (a) It must be readable by humans as well as machine-parsable ๐ฉโ๐ป.
- (b) It must provide enough info to let message senders (or their user agents) unambiguously associate a DSN with the message that was sent and the original recipient address the DSN is issued for (if that info is available), even if the message was forwarded to another recipient address ๐ต๏ธโโ๏ธ.
- (c) It must be able to preserve the reason for the success or failure of a delivery attempt in a remote messaging system, using that system's own "language" (mailbox addresses and status codes) ๐ฃ๏ธ.
- (d) It must also be able to describe the reason for the success or failure of a delivery attempt, independent of any particular human language or the "language" of any particular mail system ๐ธ.
- (e) It must preserve enough info to let the maintainer of a remote MTA understand (and, if possible, reproduce) the conditions that caused a delivery failure at that MTA ๐ง.
- (f) For any notifications issued by foreign mail systems that a mail gateway translates into DSN format, the DSN must preserve the "type" of the foreign addresses and error codes, so gateways can interpret them correctly ๐งฉ.
A DSN contains a set of per-message fields that identify the message and the transaction during which it was submitted, along with other fields that apply to all delivery attempts described by the DSN. It 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 ๐ .
1.3 Terminology ๐
A message may go through several message transfer agents (MTAs) on its way to a recipient. For a bunch of different reasons, recipient addresses may get rewritten along the way, so each MTA may see a different recipient address ๐. Depending on what a DSN is used for, different formats of a particular recipient address will be needed.
Several DSN fields are defined in terms of the view from a particular MTA in the transmission. The MTAs get these names:
- (a) Original MTA: The Original MTA is the one the sender submits the message to for delivery ๐ค.
- (b) Reporting MTA: For any DSN, the Reporting MTA is the one reporting the results of the delivery attempts described in the DSN ๐ฃ. If those attempts happened in a "foreign" (non-Internet) mail system, and the DSN was made by translating the foreign notice into DSN format, the Reporting MTA will still identify the "foreign" MTA where the attempts happened ๐.
- (c) Received-From MTA: The Received-From MTA is the MTA the Reporting MTA received the message from, and which accepted responsibility for delivering it ๐ค.
- (d) Remote MTA: Say an MTA decides it has to relay a message to one or more recipients, but the message can't be transferred to its "next hop" MTA, or the "next hop" MTA refuses to accept responsibility for delivering it to one or more of its intended recipients. The relaying MTA may need to issue a DSN on behalf of the recipients the message can't be delivered to ๐ง. In that case the relaying MTA is the Reporting MTA, and the "next hop" MTA is known as the Remote MTA ๐ซ.
Figure 1 shows how these MTAs relate to each other ๐ผ๏ธ:
+-----+ +--------+ +---------+ +---------+ +------+
| | | | |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 can provide info that's useful in a DSN ๐:
- Ideally, the DSN will contain the address of each recipient as the sender originally specified it to the Original MTA. This version of the address is needed (rather than a forwarding address or some modified version of the original) so the sender can compare the recipient address in the DSN with the one in the sender's records (e.g. an address book for an individual, or 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 when the message was submitted. If it's included in the DSN, the sender can use it to keep track of which messages were or weren't delivered ๐ท๏ธ.
- If a message was (a) forwarded to a different address than the one the sender specified, (b) gatewayed to a different mail system than the one the sender used, or (c) subjected to address rewriting during transmission, then the "final" form of the recipient address (i.e. the one the Reporting MTA sees) will be different from the original, sender-specified recipient address ๐ฆ. Just as the sender's user agent (or the sender) prefers the original recipient address, the "final" address is needed when reporting a problem to the postmaster of the site where delivery failed. Only the final recipient address will let her reproduce the conditions that caused the failure ๐ต๏ธโโ๏ธโจ.
- okay bestie, a "failed" DSN should contain the most accurate explanation for the delivery failure that's available ๐โจ. For ease of interpretation, that info should be in a format that's totally independent of the mail transport system that issued the DSN ๐ฆ. But if a foreign error code gets translated into some transport-independent format, some info may get lost ๐ญ. So it's desirable to provide both a transport-independent status code and a way to report transport-specific codes ๐. Depending on what caused the delivery failure, the transport-specific code might come from either the Reporting MTA or the Remote MTA ๐ง.
Since the right "recipient address" and "delivery status code" change depending on the situation a DSN is used in ๐ , and the MTA that issues the DSN can't predict every single situation ๐ตโ๐ซ, the DSN format is built to hold both the original and final forms of a recipient address, plus both a transport-independent and a transport-specific indication of delivery status ๐.
Extension fields can also be added by the Reporting MTA whenever they're needed ๐ซถ. They give extra info for a trouble ticket, or they preserve info for tunneling foreign delivery reports through Internet DSNs ๐.
The Original, Reporting, and Remote MTAs can live in super different environments and use dissimilar transport protocols, MTA names, address formats, and delivery status codes ๐. So DSNs don't assume any particular format for mailbox addresses, MTA names, or transport-specific status codes ๐ โโ๏ธ. Instead, the DSN fields that carry these things are made of a "type" subfield, followed by a subfield of ordinary text characters, and the "type" subfield tells you what format that text is in ๐. That's how a DSN can convey these quantities no matter the format ๐.
2. Format of a Delivery Status Notification โจ
A DSN is a MIME message with a top-level content-type of multipart/report (defined in [2]). 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 [2].
- (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 which 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. okay that exception is very specific and I respect it ๐ง
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 be still be issued in response to a single message submission. it's giving a group project with a hundred people who all forgot to reply ๐ธ
2.1 The message/delivery-status content-type
The message/delivery-status content-type is defined as follows:
MIME type name: message
MIME subtype name: delivery-status
Optional parameters: none
Encoding considerations: "7bit" encoding is sufficient and
MUST be used to maintain readability
when viewed by non-MIME mail
readers.
Security considerations: discussed in 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 [6]). 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. ๐
2.1.1 General conventions for DSN fields
Since these fields are defined according to the rules of 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 which 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 [7]. โ๏ธ
A number of DSN fields are defined to have a portion of a field body of "xtext". "xtext" is used to allow encoding sequences of octets which contain values outside the range [1-127 decimal] of traditional ASCII characters, and also to allow comments to be inserted in the data. Any octet may be encoded as + followed by two upper case hexadecimal digits. (The + character MUST be encoded as +2B.) With certain exceptions, octets that correspond to ASCII characters may be represented as themselves. SPACE and HTAB characters are ignored. Comments may be included by enclosing them in parenthesis. Except within comments, encoded-words such as defined in [7] may NOT 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 represented as plain text, either because they are reserved, or because they are non-printable. However, any octet value may be represented by a "hexchar".
hexchar = ASCII "+" immediately followed by two upper case
hexadecimal digits
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 may also be encoded as "hexchar"s, at the implementor's discretion.) ๐ฆ
- ASCII CHARs that fall outside the range above must be encoded as "hexchar". ๐จ
- Line breaks (CR LF SPACE) MAY be inserted as necessary to keep line lengths from becoming excessive. ๐
- Comments MAY be added to clarify the meaning for human readers. ๐ฌ
2.1.2 "*-type" subfields
Several DSN fields consist of a "-type" subfield, followed by a semicolon, followed by "*text". For these fields, the keyword used in the address-type, diagnostic-type, or MTA-name-type subfield indicates the expected format of the address, status-code, or MTA-name which follows. ๐ท๏ธ
The "-type" subfields 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 [3], 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 a one or more specifications that provide such descriptions. (The "rfc822" address-type, "smtp" diagnostic-type, and "dns" MTA-name-type are defined in [4].) Registration forms for address-type, diagnostic-type, and MTA-name-type appear in 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 names 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 ABNF grammar for DSNs: atom, CHAR, comment, CR, CRLF, DIGIT, LF, linear-white-space, SPACE, text. The date-time lexical token is defined in [8]. ๐
2.2 Per-Message DSN Fields
Some fields of a DSN apply to all of the delivery attempts described by that DSN. These fields may appear at most once in any DSN. These fields are used to correlate the DSN with the original message transaction and to provide additional information which may be useful to gateways. ๐งฉ
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 )
2.2.1 The Original-Envelope-Id field ๐
okay so the optional Original-Envelope-Id field holds an "envelope identifier" that uniquely identifies the transaction the message was submitted in โจ That ID was either (a) specified by the sender and handed to the sender's MTA, or (b) generated by the sender's MTA and made available to the sender when the message was submitted. Its whole purpose is to let the sender (or her user agent) match the returned DSN up with the exact transaction the message was sent in. ๐งพ๐
If that envelope identifier was in the envelope that came with the message when it arrived at the Reporting MTA, it SHOULD be copied into the Original-Envelope-Id field of any DSN issued because of an attempt to deliver the message. ๐ซถ The one exception is when the sender's MTA issues the DSN. Otherwise, an MTA MUST NOT fill in this field unless the envelope that came with the message on arrival at the Reporting MTA had an envelope-identifier field. ๐ โโ๏ธ
The field is defined like this:
original-envelope-id-field =
"Original-Envelope-Id" ":" envelope-id
envelope-id = *text
There may be at most one Original-Envelope-Id field per DSN.
The envelope-id is CASE-SENSITIVE. The DSN MUST preserve the original case and spelling of the envelope-id. ๐
Heads up, bestie: 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. Two different IDs, two different jobs, no mixing them up ๐ โโ๏ธ
2.2.2 The Reporting-MTA DSN field ๐ฎ
The field's grammar looks like this:
reporting-mta-field =
"Reporting-MTA" ":" mta-name-type ";" mta-name
mta-name = *text
Okay, the vibe: a DSN describes the results of attempts to deliver, relay, or gateway a message to one or more recipients ๐ซ In every case, the Reporting-MTA is the MTA that attempted the delivery, relay, or gateway operation the DSN describes. This field is required. ๐
Here's a fun one. If an SMTP client tries to relay a message to an SMTP server and gets an error reply to a RCPT command, the client is the one responsible for generating the DSN, so the client's domain name shows up in the Reporting-MTA field. (The server's domain name shows up in the Remote-MTA field instead ๐ธ)
Also, the Reporting-MTA isn't always the MTA that actually issued the DSN ๐ Say an attempt to deliver a message outside the Internet gets a nondelivery notification, and that notification gets gatewayed back into Internet mail. The Reporting-MTA field of the resulting DSN will name the MTA that originally reported the delivery failure, not the gateway that converted the foreign notification into a DSN. See 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 nondelivery
notification
(4) gateway translates foreign notification into a DSN
The mta-name part of the Reporting-MTA field is formatted according to the conventions named by the mta-name-type subfield ๐งฉ If an MTA acts as a gateway between dissimilar mail environments and goes by different names depending on the environment, the mta-name subfield SHOULD contain the name used by the environment that the Reporting-MTA accepted the message from. ๐
MTA names are CASE-SENSITIVE, because the exact spelling of an MTA name can matter a lot in a particular environment ๐ก
2.2.3 The DSN-Gateway field ๐
The DSN-Gateway field tells you the name of the gateway or MTA that translated a foreign (non-Internet) delivery status notification into this DSN โจ This field MUST appear in any DSN that a gateway translated from a foreign system into DSN format, and MUST NOT appear otherwise. Strict but fair ๐
dsn-gateway-field = "DSN-Gateway" ":" mta-name-type ";" mta-name
For gateways into Internet mail, the MTA-name-type will normally be "smtp", and the mta-name will be the Internet domain name of the gateway ๐ฆ
2.2.4 The Received-From-MTA DSN field ๐ฅ
The optional Received-From-MTA field tells you the name of the MTA the message was received from ๐ซง
received-from-mta-field =
"Received-From-MTA" ":" mta-name-type ";" mta-name
If the message came from an Internet host via SMTP, the mta-name subfield SHOULD hold the Internet domain name given in the HELO or EHLO command ๐ The network address the SMTP client used SHOULD be included as a comment in parentheses. (In this case, the MTA-name-type will be "smtp".)
The mta-name part of the Received-From-MTA field is formatted according to the conventions named by the MTA-name-type subfield ๐ง
Case matters in some mail systems, so the exact spelling of the MTA name, case and all, SHOULD be preserved ๐ ๐ธ
2.2.5 The Arrival-Date DSN field ๐ฐ๏ธ
The optional Arrival-Date field shows the date and time the message arrived at the Reporting MTA โฐ If the Last-Attempt-Date field is also given in a per-recipient field, you can use the two together to work out the interval between the message arriving at the Reporting MTA and the report being issued for that recipient ๐งฎ
arrival-date-field = "Arrival-Date" ":" date-time
The date and time are written in RFC 822 'date-time' format, as modified by [8]. Numeric timezones ([+/-]HHMM format) MUST be used ๐ No named zones allowed, bestie ๐ โโ๏ธ
2.3 Per-Recipient DSN fields ๐ฏ
A DSN can contain info about attempts to deliver a message to one or more recipients ๐ The delivery info for any one recipient lives in a group of contiguous per-recipient fields. Each group of per-recipient fields is preceded by a blank line ๐
The syntax for a group of per-recipient fields looks like this:
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 ]
[ will-retry-until-field CRLF ]
*( extension-field CRLF )
2.3.1 Original-Recipient field ๐ฏ
The Original-Recipient field shows the original recipient address, the one the sender of the message specified, for the message this DSN is about ๐
original-recipient-field =
"Original-Recipient" ":" address-type ";" generic-address
generic-address = *text
The address-type field says what type the original recipient address is. If the message started out inside the Internet, the address-type will normally be "rfc822", and the address will follow the syntax in [6]. Use "unknown" if the Reporting MTA can't work out the type of the original recipient address from the message envelope ๐คทโโ๏ธ
This field is optional ๐ท It should only be included if the sender-specified recipient address was in the message envelope, such as through the SMTP extensions defined in [4]. This address is the same one the sender provided, so it can be used to automatically correlate DSN reports with message transactions ๐โจ
2.3.2 Final-Recipient field ๐
The Final-Recipient field tells you which recipient this set of per-recipient fields is for. This field MUST be present in each set of per-recipient data ๐ซถ
final-recipient-field =
"Final-Recipient" ":" address-type ";" generic-address
The generic-address subfield of the Final-Recipient field MUST contain the mailbox address of the recipient, taken from the transport envelope, the way it looked when the Reporting MTA accepted the message for delivery ๐ฌ
The Final-Recipient address might not match what the sender originally typed, since it may have been transformed during forwarding and gatewaying into a totally unrecognizable mess ๐ญ Still, if the optional Original-Recipient field is missing, the Final-Recipient field and any returned content may be the only info you have to match the DSN up with a particular message submission ๐ต๏ธโโ๏ธ
The address-type subfield shows the type of address the reporting MTA expects in that context. Recipient addresses obtained via SMTP will normally be of address-type "rfc822" ๐
NOTE, but make it iconic: The Reporting MTA is not expected to make sure the address actually follows the syntax conventions of the address-type. Instead, it MUST report exactly the address it received in the envelope, unless that address has characters like CR or LF, which may not appear in a DSN field ๐
Mailbox addresses (including the ones used on the Internet) can be case sensitive, so the case of every alphabetic character in the address MUST be preserved ๐ ๐
2.3.3 Action field ๐ฌ
The Action field tells you what the Reporting-MTA did, as a result of trying to deliver the message to this recipient address ๐ฌ This field MUST be present for each recipient named in the DSN. No skipping anyone, bestie ๐
action-field = "Action" ":" action-value
action-value =
"failed" / "delayed" / "delivered" / "relayed" / "expanded"
The action-value can be spelled with any mix of upper and lower case characters ๐
"failed": means the message couldn't be delivered to the recipient ๐ The Reporting MTA has given up on trying to deliver the message to this recipient, so don't expect any more notifications ๐ชฆ"delayed": means the Reporting MTA hasn't been able to deliver or relay the message yet, but it's still trying ๐ More notification messages might come through as the message gets delayed further, gets delivered successfully, or if the delivery attempts are later given up on ๐ง
"delivered" is the happy ending ๐ฅน๐ It means the message reached the recipient address the sender specified, and yes, that includes delivery to a mailing list exploder ๐ฌ It does not mean the person actually read it ๐ This is a terminal state, so don't go hunting for another DSN for that recipient ๐
โโ๏ธ
"relayed" means the message got passed along or gatewayed into an environment that doesn't take responsibility for making DSNs on successful delivery ๐ฆ This action-value SHOULD NOT be used unless the sender asked to be notified about successful delivery for that recipient. Lowkey, the sender has to ask for it first ๐ฅบ
"expanded" is the main character move ๐ The message was delivered to the recipient address the sender specified, and then the Reporting-MTA forwarded it past that destination to multiple more addresses. It's different from "delivered" because "expanded" isn't a terminal state. "failed" and/or "delayed" notifications may still show up after it ๐
Using the terms "mailing list" and "alias" as defined in [4], 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: Okay, I know the action field looks like it's just repeating the status field, but it is NOT ๐
โโ๏ธ Like, a "temporary failure" ("4") status code could go with either a "delayed" or a "failed" action ๐คฏ
Here's a sweet example. An SMTP client keeps trying to relay a message to the mail exchanger for a recipient, but every try fails because a query to a domain name server timed out ๐ญ After a few hours, it might send a "delayed" DSN to tell the sender the message hasn't been delivered yet. After a few days, the MTA might give up and return a "failed" DSN ๐ The status code (which begins with "4" to mean "temporary failure") would be the same for both DSNs ๐
Another one that looks contradictory: if an MTA or mail gateway can't deliver a message because doing so would mean conversions that cause an unacceptable loss of information, it would issue a DSN with the action field of "failure" and a status code of 'XXX' ๐ซ But if the message had been relayed instead, with some loss of information, it might generate a DSN with that same 'XXX' status-code, only with an action field of "relayed" ๐ธ
2.3.4. Status field
The per-recipient Status field is a transport-independent status code that tells you the delivery status of the message for that recipient ๐ This field MUST be present for each delivery attempt that a DSN describes.
The syntax of the status field is:
status-field = "Status" ":" status-code
status-code = DIGIT "." 1*3DIGIT "." 1*3DIGIT
; White-space characters and comments are NOT allowed within a
; status-code, though a comment enclosed in parentheses MAY follow
; the last numeric subfield of the status-code. Each numeric
; subfield within the status-code MUST be expressed without
; leading zero digits.
So a status code is three numerical fields separated by "." โจ The first subfield tells you whether the attempt worked: 2 = success, 4 = persistent temporary failure, 5 = permanent failure. The second subfield hints at where any delivery drama probably came from, and the third one gives the precise error condition, if it's known ๐
The initial set of status-codes is defined in [5] ๐
2.3.5. Remote-MTA field
The Remote-MTA DSN field holds a printable ASCII version of the name of the "remote" MTA that reported delivery status to the "reporting" MTA ๐ฐ๏ธ
remote-mta-field = "Remote-MTA" ":" mta-name-type ";" mta-name
NOTE: The Remote-MTA field keeps the "while talking to" info that some older nondelivery reports already gave us ๐ฅฐ
This field is optional. It MUST NOT be included if no remote MTA was involved in the attempted delivery of the message to that recipient ๐ โโ๏ธ
2.3.6. Diagnostic-Code field
For a "failed" or "delayed" recipient, the Diagnostic-Code DSN field holds the actual diagnostic code that the mail transport issued ๐งพ These codes vary from one mail transport to another, so the diagnostic-type subfield tells you which type of diagnostic code you're looking at.
diagnostic-code-field =
"Diagnostic-Code" ":" diagnostic-type ";" *text
NOTE: The Diagnostic-Code field can be a bit redundant with the Status field, and that's on purpose ๐ The Status field exists so that any DSN, no matter where it came from, can be understood by any user agent or gateway that parses DSNs. But since the status code is sometimes less precise than the real transport diagnostic code, the Diagnostic-Code field keeps that extra detail around ๐ It can be handy in a trouble ticket sent to the Reporting MTA's administrator, or when you're tunneling foreign nondelivery reports through DSNs ๐ซถ
If the Diagnostic Code came from a Remote MTA while the message was being relayed to that MTA, the Remote-MTA field should be present โจ When you're reading a DSN, a Remote-MTA field tells you the Diagnostic Code was issued by the Remote MTA. If there's no Remote-MTA field, the Diagnostic Code was issued by the Reporting MTA ๐
In addition to the Diagnostic-Code itself, extra textual description of the diagnostic MAY appear in a comment enclosed in parentheses ๐ฌ
This field is optional, since some mail systems don't give you anything beyond what's already in the 'action' and 'status' fields ๐คทโโ๏ธ Still, this field SHOULD be included if transport-specific diagnostic information is available ๐
2.3.7. Last-Attempt-Date field
The Last-Attempt-Date field gives the date and time of the last attempt to relay, gateway, or deliver the message (successful or not) from the Reporting MTA โฐ It isn't always the same as the Date field in the header of the message that carried this DSN. When a gateway generated the DSN, the header's Date field holds the time the gateway sent the DSN, while the Last-Attempt-Date field holds the time the last delivery attempt actually happened ๐ง
last-attempt-date-field = "Last-Attempt-Date" ":" date-time
This field is optional. It MUST NOT be included if the actual date and time of the last delivery attempt aren't available, which might happen if a gateway issued the DSN ๐
The date and time are written in RFC 822 'date-time' format, as modified by [8]. Numeric timezones ([+/-]HHMM format) MUST be used ๐ฐ๏ธ
3.2.1.5. final-log-id field
The "final-log-id" field gives the final-log-id of the message that the final-mta used. This can be a super useful index into the final-mta's log entry for that delivery attempt ๐
final-log-id-field = "Final-Log-ID" ":" *text
This field is optional ๐ซง
2.3.8. Will-Retry-Until field
For DSNs of type "delayed", the Will-Retry-Until field gives the date after which the Reporting MTA expects to give up on all attempts to deliver the message to that recipient โ The Will-Retry-Until field is optional for "delay" DSNs, and MUST NOT appear in other DSNs ๐ซ
will-retry-until-field = "Will-Retry-Until" ":" date-time
The date and time are written in RFC 822 'date-time' format, as modified by [8]. Numeric timezones ([+/-]HHMM format) MUST be used ๐ฐ๏ธ
2.4. Extension fields
More per-message or per-recipient DSN fields may show up in the future, defined by later revisions or extensions to this spec ๐ฎ Extension-field names that begin with "X-" will never be defined as standard fields, because those names are reserved for experimental use ๐งช DSN field names that do NOT begin with "X-" MUST be registered with the Internet Assigned Numbers Authority (IANA) and published in an RFC ๐
Extension DSN fields can be defined for these reasons:
- (a) To let extra info from foreign delivery status reports get tunneled through Internet DSNs. These names should begin with the foreign environment's name, like
X400-Physical-Forwarding-Address๐ - (b) To let diagnostic info that's specific to one mail transport protocol get sent along. These names should begin with the mail transport being used, like
SMTP-Remote-Recipient-Address. Fields like these should be used for diagnostic purposes only, not by user agents or mail gateways ๐ง - (c) To let diagnostic info that's specific to one message transfer agent (MTA) get sent along. These names should begin with the name of the MTA implementation that produced the DSN, like
Foomail-Queue-ID๐ง
MTA implementors are encouraged to include enough info, through extension fields if needed, so an MTA maintainer can understand what caused a correctable delivery failure and how to fix it ๐ ๏ธ For example, if delivery attempts get logged, the DSN might include info that helps the MTA maintainer quickly find the log entry for a failed delivery attempt ๐
If an MTA developer doesn't want to register the meanings of their extension fields, "X-" fields can be used instead ๐ To avoid name collisions, the name of the MTA implementation should follow the "X-", like "X-Foomail-Log-ID" ๐ธ
3. Conformance and Usage Requirements โจ
okay so first things first, an MTA or gateway conforms to this spec if it generates DSNs following the protocol in this memo ๐ for MTAs and gateways that don't support asking for positive delivery notification (like the one in [4]), it is sufficient that delivery failure reports use this protocol ๐
a minimal implementation only needs to generate the Reporting-MTA per-message field, plus the Final-Recipient, Action, and Status fields for each attempt to deliver a message to a recipient the DSN describes ๐ง generating the other fields is strongly recommended when they make sense ๐ซถ
MTAs and gateways MUST NOT generate the Original-Recipient field of a DSN unless the mail transfer protocol gives the address the sender originally specified at submission time ๐ (ordinary SMTP doesn't make that guarantee, but the SMTP extension in [4] lets that info ride along in the envelope if it's 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 gets forwarded to multiple recipients of an "alias" (as defined in [4], 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 spec places no restrictions on how user agents or distribution lists process DSNs they receive ๐ โจ
4. Security Considerations ๐ฅ
okay bestie, this is the serious part, so pay attention ๐ฅน the following security considerations apply when using DSNs:
4.1 Forgery
DSNs can be forged as easily as ordinary Internet electronic mail ๐ฑ user agents and automatic mail handling facilities (like mail distribution list exploders) that want to make automatic use of DSNs should take appropriate precautions to minimize the potential damage 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 delivered to the indicated recipient,
- (b) A falsified non-delivery notification when the message was in fact 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 DSNs
4.2 Confidentiality
another dimension of security is confidentiality ๐คซ there may be cases where a message recipient is autoforwarding messages but doesn't want to divulge the address they're being autoforwarded to. that desire for confidentiality will probably get even stronger as "wireless mailboxes", like pagers, become more widely used as autoforward addresses ๐
MTA authors are encouraged to provide a mechanism that lets the end user preserve the confidentiality of a forwarding address. depending on how much confidentiality is required, and the nature of the environment to which a message were being forwarded, this might be accomplished by one or more of:
- (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 FROMaddress) 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=NEVERparameter to theRCPTcommand), 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 ๐ that need for confidentiality must be balanced against how useful the omitted information is in trouble reports and in DSNs gatewayed to foreign environments.
implementors are cautioned ๐ฌ many existing MTAs will send nondelivery 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 ๐
4.3 Non-Repudiation
within the framework of today's internet mail, the DSNs defined in this memo provide valuable information to the mail user ๐ however, even a "failed" DSN can not be relied upon as a guarantee that a message was not received by the recipient. even if DSNs are not actively forged, there are conditions under which a message can be delivered despite the fact that a failure DSN was issued ๐คฏ
for example, a race condition in the SMTP protocol allows for the duplication of messages if the connection is dropped following a completed DATA command, but before a response is seen by the SMTP client. this will cause the SMTP client to retransmit the message, even though the SMTP server has already accepted it.[9] 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 ๐ญ
5. Appendix - collected grammar ๐งพ
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-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
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 ]
[ 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
; status-code, though a comment enclosed in parentheses MAY follow
; the last numeric subfield of the status-code. Each numeric
; subfield 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
6. Appendix - Guidelines for gatewaying DSNs ๐
NOTE: This section provides non-binding recommendations for the construction of mail gateways that wish to provide semi-transparent delivery reports between the Internet and another electronic mail system. Specific DSN gateway requirements for a particular pair of mail systems may be defined by other documents. ๐ฆ
6.1 Gatewaying from other mail systems to DSNs ๐
okay so a mail gateway can issue a DSN to pass along the contents of a "foreign" delivery or non-delivery notification over Internet mail ๐. When there are good mappings from the foreign notification elements to DSN fields, the info can ride along in those DSN fields. Extra stuff, like what you'd want for a trouble ticket or what you'd need to tunnel the foreign notification through the Internet, can go in extension DSN fields ๐งฉ. (Those fields should be given 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 the Reporting-MTA, Final-Recipient, Action, and Status fields ๐ซถ. Usually it gets these by translating the values from the remote delivery or non-delivery notification into their Internet-style equivalents. But ngl, some info is gonna get lost ๐ญ. For example, the DSN status-codes might not be enough to fully convey the delivery diagnostic code from the foreign system. The gateway should assign the most precise code that describes the failure condition, and only fall back on "generic" codes like 2.0.0 (success), 4.0.0 (temporary failure), and 5.0.0 (permanent failure) when it has to ๐ฏ. The actual foreign diagnostic code should be kept in the Diagnostic-Code field (with an appropriate diagnostic-type value) for trouble tickets or tunneling ๐.
The sender-specified recipient address, and the original envelope-id if it's present in the foreign transport envelope, should be preserved in the Original-Recipient and Original-Envelope-ID fields ๐.
The gateway should also attempt to preserve the "final" recipient addresses and MTA names from the foreign system. Whenever possible, foreign protocol elements should be encoded as meaningful printable ASCII strings ๐ธ.
For DSNs produced from foreign delivery or nondelivery notifications, the name of the gateway MUST appear in the DSN-Gateway field of the DSN ๐.
6.2 Gatewaying from DSNs to other mail systems ๐ฆ
It may be possible to gateway DSNs from the Internet into a foreign mail system. The main goal is to convey delivery status info in a form the destination system can actually use. A secondary goal is letting "tunneling" happen, so a DSN can be gatewayed back into the Internet if it ever needs to ๐.
In general, the recipient of the DSN (aka the sender of the original message) wants 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 explains 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 subfield 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 ๐ง.
7. Appendix - Guidelines for use of DSNs by mailing list exploders ๐
NOTE: This section pertains only to the use of DSNs by "mailing lists" as defined in [4], section 7.2.7. ๐
DSNs are designed so mailing list exploders can detect, and automatically delete, recipients whose mail delivery keeps failing ๐งน.
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 that's set up to receive nondelivery reports. A "smart" mailing list exploder can therefore intercept those nondelivery reports and, if they're in DSN format, automatically examine them to figure out which recipients had a delivery fail or get delayed ๐ง .
The Original-Recipient field should be used if it's 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, though, the list subscriber has forwarded their 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 them 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 that 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 the address was no longer valid ๐ฅบ.
8. Appendix - IANA registration forms for DSN types ๐
The forms below are for use when registering a new address-type, diagnostic-type, or MTA-name-type with the Internet Assigned Numbers Authority (IANA). Each piece of information requested by a registration form may be satisfied either by providing the information on the form itself, or by including a reference to a published, publicly available specification that includes the necessary information. IANA MAY reject DSN type registrations because of incomplete registration forms, imprecise specifications, or inappropriate type names ๐ .
To register a DSN type, complete the applicable form below and send it via Internet electronic mail to <IANA@IANA.ORG>.
8.1 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-RecipientorFinal-RecipientDSN field. - (d) [optional] A specification for how addresses of this type are to be translated to and from Internet electronic mail addresses.
8.2 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 [5]).
8.3 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.
9. Appendix - Examples ๐
NOTE: These examples are provided as illustration only, and are not considered part of the DSN protocol specification. If an example conflicts with the protocol definition above, the example is wrong. ๐
Likewise, the use of *-type subfield names or extension fields in these examples is not to be construed as a definition for those type names or extension fields. These examples were manually translated from bounced messages using whatever information was available ๐.
9.1 A simple DSN after repeated failed attempts ๐
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: <owner-info-mime@cs.utk.edu>
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 -----
<louisl@larry.slip.umd.edu> (unrecoverable error)
----- Transcript of session follows -----
<louisl@larry.slip.umd.edu>... 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;louisl@larry.slip.umd.edu
Final-Recipient: rfc822;louisl@larry.slip.umd.edu
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--
9.2. Another DSN, Multiple Attempts ๐ฌ
okay so this one's another DSN from the sender's MTA, and it's packed with details about multiple delivery attempts ๐ Some of the attempts got caught locally, and others got flagged by a remote MTA. the full drama, bestie ๐ญ
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 -----
<arathib@vnet.ibm.com> (unrecoverable error)
<wsnell@sdcc13.ucsd.edu> (unrecoverable error)
--JAA13167.773673707/CS.UTK.EDU
content-type: message/delivery-status
Reporting-MTA: dns; cs.utk.edu
Original-Recipient: rfc822;arathib@vnet.ibm.com
Final-Recipient: rfc822;arathib@vnet.ibm.com
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;johnh@hpnjld.njd.hp.com
Final-Recipient: rfc822;johnh@hpnjld.njd.hp.com
Action: delayed
Status: 4.0.0 (hpnjld.njd.jp.com: host name lookup failure)
Original-Recipient: rfc822;wsnell@sdcc13.ucsd.edu
Final-Recipient: rfc822;wsnell@sdcc13.ucsd.edu
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--
9.3. Message Router Gatewayed to a DSN ๐ธ
this one's a delivery report generated by Message Router (MAILBUS), then gatewayed by PMDF_MR into a DSN โจ The gateway didn't have enough info to supply an original-recipient address in this case, so that field just isn't there. iykyk ๐
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 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--
9.4. A Delay Report from a Multiprotocol MTA ๐ง
this is a delay report from a multiprotocol MTA, and the vibe is "we're still trying" โณ Note that there's no returned content here, so no third body part shows up in the DSN. just two parts, bestie ๐ซถ
From: <postmaster@nsfnet-relay.ac.uk>
Message-Id: <199407092338.TAA23293@CS.UTK.EDU>
Received: from nsfnet-relay.ac.uk by sun2.nsfnet-relay.ac.uk
id <g.12954-0@sun2.nsfnet-relay.ac.uk>;
Sun, 10 Jul 1994 00:36:51 +0100
To: owner-info-mime@cs.utk.edu
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:
thomas@de-montfort.ac.uk
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, ie 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;thomas@de-montfort.ac.uk
Status: 4.0.0 (unknown temporary failure)
Action: delayed
--foobar--
10. Acknowledgments ๐ซถ
the authors wanted to give a huge thank you to these people for reviewing earlier drafts and dropping 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. absolute legends, all of them ๐
11. References ๐
[1] Borenstein, N., Freed, N. "Multipurpose Internet Mail Extensions", RFC 1521, Bellcore, Innosoft, September 1993.
[2] Vaudreuil, G., "The Multipart/Report Content Type for the Reporting of Mail System Administrative Messages", RFC 1892, Octal Network Services, January 1996.
[3] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821, USC/Information Sciences Institute, August 1982.
[4] Moore, K., "SMTP Service Extension for Delivery Status Notifications", RFC 1891, University of Tennessee, January 1996.
[5] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 1893, Octal Network Services, January 1996.
[6] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822, UDEL, August 1982.
[7] Moore, K. "MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-Ascii Text", RFC 1522, University of Tennessee, September 1993.
[8] Braden, R. (ed.) "Requirements for Internet Hosts - Application and Support", STD 3, RFC 1123, USC/Information Sciences Institute, October 1989.
[9] Partridge, C., "Duplicate Messages and SMTP", RFC 1047, BBN, February 1988.
11. Authors' Addresses ๐
the two authors, and how to reach them ๐
Keith Moore
University of Tennessee
107 Ayres Hall
Knoxville, TN 37996-1301
USA
EMail: moore@cs.utk.edu
Phone: +1 615 974 3126
Fax: +1 615 974 8296
Gregory M. Vaudreuil
Octel Network Services
17080 Dallas Parkway
Dallas, TX 75248-1905
USA
EMail: Greg.Vaudreuil@Octel.Com
๐ฆ where this page comes from
- ietf: rfc1894 1996-01
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms