List of SMTP server return codes


This is a list of Simple Mail Transfer Protocol response status codes. Status codes are issued by a server in response to a client's request made to the server.
Unless otherwise stated, all status codes described here is part of the current SMTP standard,. The message phrases shown are typical, but any human-readable alternative may be provided.

Basic status code

A "Basic Status Code" SMTP reply consists of a three digit number followed by some text. The number is for use by automata to determine what state to enter next; the text is for the human user.
The first digit denotes whether the response is good, bad, or incomplete:2yz : The requested action has been successfully completed.3yz : The command has been accepted, but the requested action is being held in abeyance, pending receipt of further information.4yz : The command was not accepted, and the requested action did not occur. However, the error condition is temporary, and the action may be requested again.5yz : The command was not accepted and the requested action did not occur. The SMTP client SHOULD NOT repeat the exact request.
The second digit encodes responses in specific categories:x0z : These replies refer to syntax errors, syntactically correct commands that do not fit any functional category, and unimplemented or superfluous commands.x1z : These are replies to requests for information.x2z : These are replies referring to the transmission channel.x3z : Unspecified.x4z : Unspecified.x5z : These replies indicate the status of the receiver mail system.

Enhanced status code

The Basic Status Codes have been in SMTP from the beginning, with in 1982, but were extended rather extensively, and haphazardly so that by 2003 rather grumpily noted that: "SMTP suffers some scars from history, most notably the unfortunate damage to the reply code extension mechanism by uncontrolled use."
defines a separate series of enhanced mail system status codes which is intended to be better structured, consisting of three numerical fields separated by ".", as follows:
class "." subject "." detail
class = "2" / "4" / "5"
subject = 1 to 3 digits
detail = 1 to 3 digits
The classes are defined as follows:2.XXX.XXX Success: Report of a positive delivery action.4.XXX.XXX Persistent Transient Failure: Message as sent is valid, but persistence of some temporary conditions has caused abandonment or delay.5.XXX.XXX Permanent Failure: Not likely to be resolved by resending the message in current form.
In general the class identifier MUST match the first digit of the Basic Status Code to which it applies.
The subjects are defined as follows:X.0.XXX Other or Undefined StatusX.1.XXX Addressing StatusX.2.XXX Mailbox StatusX.3.XXX Mail System StatusX.4.XXX Network and Routing StatusX.5.XXX Mail Delivery Protocol StatusX.6.XXX Message Content or Media StatusX.7.XXX Security or Policy Status
The meaning of the "detail" field depends on the class and the subject, and are listed in and.
A server capable of replying with an Enhanced Status Code MUST preface the Text Part of SMTP Server responses with the Enhanced Status Code followed by one or more spaces. For example, the "221 Bye" reply MUST be sent as "221 2.0.0 Bye" instead.
The Internet Assigned Numbers Authority maintains the official registry of these enhanced status codes.

Common status codes

This section list some of the more commonly encountered SMTP Status Codes. This list is not exhaustive, and the actual text message might be different.

— 4yz Transient negative completion

"Transient Negative" means the error condition is temporary, and the action may be requested again. The sender should return to the beginning of the command sequence.
The accurate meaning of "transient" needs to be agreed upon between the two different sites must agree on the interpretation. Each reply in this category might have a different time value, but the SMTP client SHOULD try again.

— 5yz Permanent negative completion

The SMTP client SHOULD NOT repeat the exact request. Even some "permanent" error conditions can be corrected, so the human user may want to direct the SMTP client to reinitiate the command sequence by direct action at some point in the future.

Example

Below is an example SMTP connection, where a client "C" is sending to server "S":
S: 220 smtp.example.com ESMTP Postfix
C: HELO relay.example.com
S: 250 smtp.example.com, I am glad to meet you
C: MAIL FROM:
S: 250 Ok
C: RCPT TO:
S: 250 Ok
C: RCPT TO:
S: 250 Ok
C: DATA
S: 354 End data with .
C: From: "Bob Example"
C: To: Alice Example
C: Cc: theboss@example.com
C: Date: Tue, 15 Jan 2008 16:02:43 -0500
C: Subject: Test message
C:
C: Hello Alice.
C: This is a test message with 5 header fields and 4 lines in the message body.
C: Your friend,
C: Bob
C:.
S: 250 Ok: queued as 12345
C: QUIT
S: 221 Bye
And below is an example of an SMTP connection in which the SMTP Server supports the Enhanced Status Code, taken from :
S: 220 dbc.mtview.ca.us SMTP service ready
C: EHLO ymir.claremont.edu
S: 250-dbc.mtview.ca.us says hello
S: 250 ENHANCEDSTATUSCODES
C: MAIL FROM:
S: 250 2.1.0 Originator ok
C: RCPT TO:
S: 250 2.1.5 Recipient ok
C: RCPT TO:
S: 550 5.1.1 Mailbox "nosuchuser" does not exist
C: RCPT TO:
S: 551-5.7.1 Forwarding to remote hosts disabled
S: 551 5.7.1 Select another host to act as your forwarder
C: DATA
S: 354 Send message, ending in CRLF.CRLF.
...
C:.
S: 250 2.6.0 Message accepted
C: QUIT
S: 221 2.0.0 Goodbye