D. J. Bernstein
Internet mail
SMTP: Simple Mail Transfer Protocol


The server's initial response to the client must use code 220 or 421.

220 greetings

220 accepts the connection:
     220 heaven.af.mil ESMTP
According to RFC 821, the first word of text after 220 is the ``official'' name of the server host. However, not all servers follow this rule. Some servers don't even have ``official'' names.

By default, most versions of sendmail do not use EHLO unless the text after 220 contains the string ESMTP. This also means that they do not recognize 8BITMIME. I recommend that all servers that support EHLO include the string ESMTP in the 220 line.

There are other conventions for computer-readable text after 220. For example, recent versions of sendmail look for 8BIT-OK. Under a proposed federal law, unsolicited commercial email cannot be sent through a server that includes the string NO UCE in the 220 line. I recommend that all future conventions along these lines use at least one uppercase character, and that servers avoid using uppercase characters for other purposes.

421 greetings

421 temporarily rejects the connection:
     421-heaven.af.mil is too busy to accept mail right now.
     421 Please come back in 2040 seconds.
The server closes the connection without reading any requests from the client.

Klensin also allows code 554. In this case the server reads requests from the client, responding 503 to any request other than QUIT.