RFC 1846

SMTP 521 Reply Code

๐Ÿ“… published September 1995, from ietf

RFC 1846: SMTP 521 Reply Code ๐Ÿ’Œโœจ

okay bestie, the title block is the first thing to know ๐Ÿซถ RFC 1846 is called SMTP 521 Reply Code ๐Ÿ’…. It was written by A. Durand from IMAG and F. Dupont from INRIA Rocquencourt ๐Ÿ‘ฉโ€๐Ÿ’ป. The category is Experimental ๐Ÿงช, the date is September 1995 ๐Ÿ“…, and nothing is listed as obsoleted or updated ๐Ÿ™ƒ.

Status of this Memo ๐Ÿงพ

This memo defines an Experimental Protocol for the Internet community ๐Ÿงช. It does not specify an Internet standard of any kind ๐Ÿ™…โ€โ™€๏ธ. Discussion and suggestions for improvement are requested, and distribution of this memo is unlimited ๐Ÿ“ฃ.

Abstract ๐Ÿ“

This memo adds a brand new Simple Mail Transfer Protocol (SMTP) [1] reply code, 521 ๐ŸŽ€. Its whole job is to tell the sender that an Internet host does not accept incoming mail ๐Ÿšซ๐Ÿ“ฌ.

1. Motivations ๐ŸŒ

Hosts on the Internet used to be big general-purpose machines, but now they're smaller and more specialized ๐Ÿ”ง. Lots of them have one specific job, like serving NTP or DNS ๐Ÿ•ฐ๏ธ. Those dedicated hosts frequently don't provide mail service at all ๐Ÿ™ˆ.

Usually these mailless hosts don't run an SMTP server ๐Ÿซฅ. But users will occasionally misaddress mail to them, and that's where the drama starts ๐Ÿ“ฎ๐Ÿ’€. Regular SMTP clients trying to deliver that misaddressed mail must treat the missing SMTP server as a temporary error ๐Ÿ˜ฌ. They must queue the mail for later delivery, just in case an SMTP server gets started later โณ.

So the mail just sits in the queue for days ๐Ÿ˜ญ. Then it finally gets returned with an error message that's usually super confusing ๐ŸŒ€. Not slay.

2. Two complementary solutions ๐Ÿค

Two complementary solutions MAY be implemented to handle this ๐Ÿซถ. Solution one is to use MX relays to bounce misaddressed mail ๐Ÿ”. Solution two is to run a minimal SMTP server on the mailless host so it bounces all mail ๐Ÿ›Ž๏ธ. Which one you pick is site dependent ๐Ÿ .

3. The MX relays solution ๐Ÿ”

MX relays can be used to tell SMTP clients that an Internet host does not accept mail ๐Ÿ™…โ€โ™€๏ธ. During the SMTP dialog, these MX relays MAY bounce any message destined for this particular host with an SMTP 521 reply code ๐Ÿ’….

Here's what that looks like ๐Ÿ‘€:

   ---> 220 relay.imag.fr ready
   <--- HELO client.inria.fr
   ---> 250 relay.imag.fr Hello client.inria.fr
   <--- MAIL FROM: <user1@client.inria.fr>
   ---> 250 <user1@client.inria.fr>... Sender Ok
   <--- RCPT TO: <user2@nomail.imag.fr>
   ---> 521 nomail.imag.fr does not accept mail
   <--- QUIT
   ---> 221 relay.imag.fr closing connection

If an MX relay of precedence n for a mailless host bounces mail on its behalf, then any other MX relay with a precedence lower than n for that mailless host SHOULD do the same ๐Ÿซก.

4. The SMTP server solution ๐Ÿ–ฅ๏ธ

4.1 521 greeting ๐Ÿ‘‹

A host can say it doesn't accept mail by sending an initial 521 "Host does not accept mail" reply to an incoming SMTP connection ๐Ÿ“ž. The official name of the server host or its IP address MUST be sent as the first word after the reply code ๐Ÿท๏ธ.

For example: 521 canon.inria.fr does not accept mail

4.2 SMTP dialog ๐Ÿ’ฌ

After sending the initial 521 reply, the server host MUST do one of these two things:

  • a) Close the SMTP connection.
  • b) Read commands, and issue 521 replies to all commands except QUIT. If the SMTP client doesn't issue the QUIT command after a reasonable time, the SMTP server MUST time out and close the connection. A suggested time-out value is 5 minutes โฐ.
DISCUSSION ๐Ÿ—ฃ๏ธ: When an SMTP server closes the connection right after the initial 521 reply, some existing SMTP clients treat that as a transient error and requeue the mail for later delivery ๐Ÿ˜ค. If the SMTP server keeps the connection open instead, those clients immediately send QUIT and return the mail ๐Ÿ“ค.

4.3 MX ๐Ÿ“‡

A host which sends a 521 greeting message MUST NOT be listed as an MX record for any domain ๐Ÿšซ.

4.4 Postmaster ๐Ÿ“ฎ

An SMTP server which sends a 521 greeting message IS NOT subject to the postmaster requirement of STD 3, RFC 1123 ([2]) ๐Ÿ™ƒ.

DISCUSSION ๐Ÿ—ฃ๏ธ: Postmaster exists so you can report mail errors. A host that doesn't support mail doesn't need a Postmaster ๐Ÿ’โ€โ™€๏ธ.

5. SMTP client behavior ๐Ÿง‘โ€๐Ÿ’ป

If an SMTP client runs into a host in an MX record that issues a 521 greeting message, it must do one of these two things:

  • a) Attempt to deliver the mail to a different MX host for that domain.
  • b) Return the mail with an appropriate non-delivery report.

If an SMTP client encounters a 521 reply code in any other part of the SMTP dialog, it MUST return the mail with an appropriate non-delivery report ๐Ÿ“จ.

6. Security Considerations ๐Ÿ”

Not 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 ๐Ÿ’€๐Ÿ”’.

7. Authors' Addresses ๐Ÿ“ฌ

Alain Durand
Institut de Mathematiques Appliquees de Grenoble (IMAG)
BP 53 38041 Grenoble CEDEX 9 France

Phone : +33 76 63 57 03
Fax   : +33 76 44 66 75
EMail: Alain.Durand@imag.fr


Francis Dupont
Institut National de Recherche en Informatique et en Automatique
B.P. 105 / 78153 Le Chesnay CEDEX France

Phone : +33 1 39 63 52 13
Fax   : +33 1 39 63 53 30
EMail: Francis.Dupont@inria.fr

8. Expericences ๐Ÿ“ฃ

People implementing this reply code are suggested to send a message to mailext@list.cren.net to report their experience ๐Ÿงช๐Ÿ’–.

9. References ๐Ÿ“š

[1] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821, USC/Information Sciences Institute, August 1982.

[2] Braden, R., Editor, "Requirements for Internet Hosts - Application and Support", STD 3, RFC 1123, USC/Information Sciences Institute, October 1989.

๐Ÿ“ฆ where this page comes from