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. It includes codes from IETF Request for Comments and other specifications of SMTP. The first digit of the status code specifies one of five standard classes of responses: 1xx ; 2xx ; 3xx ; 4xx or 5xx.
The message phrases shown are typical, but any human-readable alternative may be provided.

Overview

Unless otherwise stated, the status code is part of the current SMTP standard.
All SMTP response status codes are separated into five classes. The first digit of the status code defines the class of response:
The last two digits do not have any class or categorization role.
These return codes have been in SMTP from the beginning, with RFC 821 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. The Internet Assigned Numbers Authority maintains the official registry of these enhanced status codes.

1xx Connection

101 The server is unable to connect
111 Connection refused or inability to open an SMTP stream

2xx Success

This class of status codes indicates the action requested by the client was received, understood and accepted.
200 System status message or help reply
214 A response to the HELP command
220 The server is ready
221 The server is closing its transmission channel
250 Requested mail action okay completed
251 User not local will forward
252 Cannot verify the user, but it will try to deliver the message anyway

3xx Additional data required

354 Start mail input

4xx Persistent transient failure

In most cases when receiving a 4xx error the sending mail server will attempt to retry delivery after a delay, and may repeatedly do so for up to a day or two depending on configuration before reporting to their user that the mail could not be delivered.
420 Timeout connection problem
421 Service is unavailable because the server is shutting down.
422 The recipient’s mailbox has exceeded its storage limit
431 Not enough space on the disk
432 Recipient’s incoming mail queue has been stopped
441 The recipient’s server is not responding
442 The connection was dropped during the transmission
446 The maximum hop count was exceeded for the message
447 Message timed out because of issues concerning the incoming server
449 Routing error
450 User’s mailbox is unavailable
451 Aborted – Local error in processing
452 insufficient storage on the server
471 An error of your mail server

5xx Permanent errors

These errors will result in the SMTP connection being dropped, and the sending mail server will advise the user that their mail could not be delivered.

500 Syntax error
501 Syntax error in parameters or arguments
503 Bad sequence of commands, or requires authentication
504 Command parameter is not implemented
510 Bad email address
511 Bad email address
512 Host server for the recipient’s domain name cannot be found in DNS
513 Address type is incorrect
523 Encryption is required before the requested authentication mechanism may be used.
530 Authentication problem
541 The recipient address rejected your message
550 Non-existent email address, or command rejected for policy reasons
551 User not local, relaying denied, providing correct address
552 Exceeded storage allocation
553 Mailbox name invalid
554 Transaction has failed

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