Internet Engineering Task Force (IETF) J. Klensin
Request for Comments: 7504 June 2015
Updates: 1846, 5321
Category: Standards Track
ISSN: 2070-1721
SMTP 521 and 556 Reply Codes
Klensin Standards Track [Page 1]
RFC 7504 SMTP 521 and 556 Reply Codes June 2015
Copyright Notice
Klensin Standards Track [Page 2]
RFC 7504 SMTP 521 and 556 Reply Codes June 2015 1. IntroductionThe SMTP specification [2] (referred to, along with its various updates, as "SMTP" below) contains a list and discussion of reply codes. This document updates that list with a new code, 521, for use in response to an initial connection. In that context, it specifically denotes a system that does not receive mail or otherwise handle SMTP mail or inquiry transactions. That code differs from the use of reply code 554, recommended by RFC 5321, because the latter code can be used in a larger variety of situations, including mail that is not accepted for, or from, particular sources, destinations, or addresses. It also introduces a second reply code, 556, for use when an SMTP client encounters a domain in a forward-pointing address that it can determine (e.g., from the DNS "null MX" convention [5]) does not support receipt of mail and has to report that condition to a host that delivered the message to it for further processing.
1.1. Terminology
The reader of this document is expected to have reasonable familiarity with the SMTP specification in RFC 5321, particularly its discussion of reply codes and their use and theory.
2. Background
Many Internet hosts are not in a position -- whether technically, operationally, or administratively -- to offer mail service. If an SMTP client (sender) attempts to open a mail connection to a system that does not have an SMTP server, the connection attempt will time out. SMTP requires that timeouts result in the client queuing the message and retrying it for an extended period. That behavior will result in wasted resources and long delays in getting an error message back to its originator.
Klensin Standards Track [Page 3]
RFC 7504 SMTP 521 and 556 Reply Codes June 2015 3. The 521 Reply CodeThis specification adds the 521 reply code to the repertoire specified in SMTP, reserving it for use at connection-opening time to indicate that the host does not accept mail under any circumstances. It SHOULD be used for dummy SMTP servers whose sole purpose is to notify systems that attempt to open mail connections that the host never accepts mail. It MAY be used in other situations where the intent is to indicate that the host never accepts mail. It SHOULD NOT be used for situations in which the server rejects mail from particular hosts or addresses or in which mail for a particular destination host is not accepted. As discussed in SMTP, reply code 554 is more appropriate for most of those conditions; an additional case, in which the determination that mail is not accepted is determined outside the mail system, is covered in the next section (Section 4).
4. The 556 Reply Code
This specification adds the 556 reply code to the repertoire specified in SMTP. When an intermediate SMTP system (typically a relay) that would normally attempt to open a mail connection to a host referred to in a forward-pointing address can determine that the host does not accept mail connections, and do so without attempting to open a connection to that target host, it is appropriate for it to return a reply with a 556 code to the system that sent it the message for outbound transmission. Interpretation of a special DNS record, found when a lookup is performed in conjunction with a RCPT command [5], is one such method (and the only standardized one at the time this specification was written). When an SMTP server returns a 556 reply code after receiving a command (such as RCPT, which contains a forward-pointing address) because it has information (such as discussed above) that the mail will not be accepted, the SMTP client is expected to handle the response like any other permanent negative completion reply to the command. This is consistent with the SMTP specification.
Klensin Standards Track [Page 4]
RFC 7504 SMTP 521 and 556 Reply Codes June 2015 5. Small Details to Avoid Loose Ends 5.1. Specific Changes to RFC 5321This document adds the 521 code, with message "Host does not accept mail", and the 556 code, with message "Domain does not accept mail", to the function group and numerical lists (Sections 4.2.2 and 4.2.3, respectively) of RFC 5321. It also adds the 521 code to the "CONNECTION ESTABLISHMENT" portion of Section 4.3.2 ("Command-Reply Sequences"), preceding the 554 code, and the 556 code to the "RCPT" portion of that same section.
5.2. The RFC 1846 Experiment
By formalizing reply code 521, this specification ends the experiment proposed in RFC 1846. That document also discusses general strategies for hosts that do not accept mail directly. That discussion is out of scope for the present document.
6. IANA Considerations
This document updates RFC 5321 to add descriptions and text for two reply codes, but there is no registry for those codes. IANA has updated the "Enumerated Status Codes" subregistry of the "Simple Mail Transfer Protocol (SMTP) Enhanced Status Codes Registry" [3] to include these codes, specifically:
Klensin Standards Track [Page 5]
RFC 7504 SMTP 521 and 556 Reply Codes June 2015 7. Security ConsiderationsNot running any SMTP server, or running an SMTP server that simply emits fixed strings in response to incoming connections, should provide significantly fewer opportunities for security problems than running a complete SMTP implementation. See the Security Considerations section of RFC 7505 [5] for a discussion of security issues with that approach. Use of the specific codes provided here provides more information to the client than a generic or arbitrarily chosen 5yz code but should have no other effect on security.
8. References 8.1. Normative References[1] Bradner, S., "Key words for use in RFCs to Indicate Requirement
8.2. Informative References
[4] Durand, A. and F. Dupont, "SMTP 521 Reply Code", RFC 1846,
Klensin Standards Track [Page 6]
RFC 7504 SMTP 521 and 556 Reply Codes June 2015
Acknowledgments