RFC 7504
SMTP 521 and 556 Reply Codes
๐ฎ RFC 7504: SMTP 521 and 556 Reply Codes ๐
okay bestie, this one is the RFC for when a server basically says "nah, we don't do mail here" ๐ It's RFC 7504, written by J. Klensin in June 2015. It's a Standards Track doc, which means it's an official Internet standard and not just somebody's opinion ๐ซถ It was published as ISSN 2070-1721, and it updates two older docs: RFC 1846 and RFC 5321. Basically it's an upgrade patch for SMTP, the protocol that moves email around. โจ
Abstract โจ
okay so this memo defines two SMTP reply codes, 521 and 556 ๐ฆ The 521 code was first described in an Experimental RFC back in 1995. People have been using it for ages, but it never got officially added to SMTP, so this doc finally makes it official ๐ The 556 code was made to go with the new tests and actions in RFC 7505. Both codes mean the same vibe: an Internet host does not accept incoming mail at all ๐ โโ๏ธ
This spec is NOT for hosts that sometimes take mail but might reject certain messages, or even every message, under specific conditions. That's a different situation and this doc is not about it ๐
Status of This Memo ๐ธ
This is an Internet Standards Track document ๐
This doc is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community, and it went through public review and got approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check out Section 2 of RFC 5741 ๐ง
For the current status of this doc, any errata, and how to give feedback, go to http://www.rfc-editor.org/info/rfc7504 ๐ฅ
Copyright Notice ๐
Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved. ๐
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they were in effect on the date this document was published. Please actually read these, bestie, because they explain your rights and restrictions for this doc ๐ Code Components extracted from this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions. They're provided without warranty, as described in the Simplified BSD License โ ๏ธ
Table of Contents ๐๏ธ
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
2. Background . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. The 521 Reply Code . . . . . . . . . . . . . . . . . . . . . 4
4. The 556 Reply Code . . . . . . . . . . . . . . . . . . . . . 4
5. Small Details to Avoid Loose Ends . . . . . . . . . . . . . . 5
5.1. Specific Changes to RFC 5321 . . . . . . . . . . . . . . 5
5.2. The RFC 1846 Experiment . . . . . . . . . . . . . . . . . 5
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
7. Security Considerations . . . . . . . . . . . . . . . . . . . 6
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 6
8.1. Normative References . . . . . . . . . . . . . . . . . . 6
8.2. Informative References . . . . . . . . . . . . . . . . . 6
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 7
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7
1. Introduction โจ
okay so the SMTP specification [2] (called "SMTP" from here on, along with its various updates) has a whole list and discussion of reply codes ๐ This doc adds a new one, 521, for when you get an initial connection. It specifically means a system that doesn't receive mail or handle SMTP mail or inquiry transactions at all ๐ This is different from reply code 554, which RFC 5321 recommends, because 554 works in a bunch more situations. That includes mail that isn't accepted from or for certain sources, destinations, or addresses ๐
The doc also adds a second code, 556. You use it when an SMTP client sees a domain in a forward-pointing address and can tell (for example, from the DNS "null MX" convention [5]) that the domain doesn't support receiving mail. The client then has to report that to the host that delivered the message to it, so that host can do further processing ๐ฆ
This specification updates RFC 5321 to add the new codes. The 521 code was first formally proposed in the Experimental RFC 1846 [4]. This document updates that spec to standardize the code and give it more specific treatment ๐
1.1. Terminology ๐
The reader is expected to be pretty familiar with the SMTP specification in RFC 5321, especially its discussion of reply codes and how they're used and the theory behind them ๐ง
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 RFC 2119 [1] ๐
2. Background ๐ท
Lots of Internet hosts just aren't in a position to offer mail service, whether that's for technical, operational, or administrative reasons ๐ If an SMTP client (the sender) tries to open a mail connection to a system that doesn't have an SMTP server, the connection attempt is going to time out. SMTP requires that timeouts result in the client queuing the message and retrying it for an extended period. That's a lot of wasted resources and long delays before an error message makes it back to the person who sent the mail ๐ญ
There are two main alternatives. One is to run a dummy SMTP server on hosts that never receive mail, and have that server return a fatal error reply code whenever something tries to open a connection. The other is to figure out from a separate source, like a DNS record, that the host doesn't receive mail. This document specifies reply codes to be used for those purposes ๐ง
3. The 521 Reply Code ๐
okay this part is the main event ๐ This spec adds the 521 reply code to the set of codes in SMTP. It's reserved for use at connection-opening time, to say that the host does not accept mail under any circumstances ๐
It SHOULD be used for dummy SMTP servers whose only job is to tell systems trying to open mail connections that the host never accepts mail. It MAY be used in other situations where the goal is to say the host never accepts mail. It SHOULD NOT be used when the server rejects mail from particular hosts or addresses, or when mail for a particular destination host isn't accepted. As SMTP discusses, reply code 554 is the better fit for most of those conditions. There's one more case, where the decision that mail isn't accepted gets made outside the mail system. That's covered in the next section (Section 4) ๐
"Server does not accept mail" (or a variant like "Host", "Domain", or a related term) is an acceptable message to go with a 521 code used for this purpose ๐ธ
Once the 521 reply code comes back instead of the usual 220, the SMTP session proceeds normally. If the SMTP client tries to send any commands other than QUIT, the server MAY either keep sending 521 reply codes or just close the connection. If the point of running a dummy SMTP server that returns 521 is to conserve resources, closing the connection will usually be the better move โก
4. The 556 Reply Code ๐ฆ
this section adds the 556 reply code to the SMTP repertoire ๐ Here's the situation: an intermediate SMTP system (usually a relay) would normally try to open a mail connection to a host named in a forward-pointing address. If it can figure out that the host doesn't accept mail connections, and it can do that without actually trying to connect to that target host, then it's appropriate for the relay to send back a reply with a 556 code to the system that passed it the message for outbound transmission ๐ง
One way to figure that out is by interpreting a special DNS record. You find it with a lookup done alongside a RCPT command [5]. That's the only standardized method at the time this spec was written ๐
When an SMTP server returns a 556 reply code after receiving a command (like RCPT, which contains a forward-pointing address) because it has information like what's described above that the mail won't be accepted, the SMTP client is expected to handle the response like any other permanent negative completion reply to that command. This matches the SMTP specification, so it's all consistent ๐ซถ
โจ Part 1 wraps up here! โจ
Acknowledgments โจ
Okay bestie, the thank-you section! ๐ซถ Alain Durand and Francis Dupont proposed the 521 code in RFC 1846 [4]. They also joined an extended conversation and gave lots of useful comments that shaped this doc ๐ And with their permission, the document includes some text copied from that early spec ๐
Discussion of the "null MX" approach and proposal [5] inspired this specification ๐ฆ Specific comments and suggestions from John Levine (co-author of that document) were also super helpful ๐
Martin Duerst and Tom Petch spotted significant issues in the initial draft of the current form of the document ๐
Dilyan Palauzov did a careful reading and caught an editorial error ๐
Ned Freed, Tony Hansen, and Rolf Sonneveld suggested textual improvements, and they got incorporated โจ Tony Hansen also acted as document shepherd and made several contributions in conjunction with that role ๐
Author's Address ๐ธ
John C Klensin 1770 Massachusetts Ave, Ste 322 Cambridge, MA 02140 United States
Phone: +1 617 245 1457 Email: john-ietf@jck.com ๐
๐ฆ where this page comes from
- ietf: rfc7504 2015-06
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms