List of SMTP server return codes

Last updated

This is a list of Simple Mail Transfer Protocol (SMTP) response status codes. Status codes are issued by a server in response to a client's request made to the server.

Contents

Unless otherwise stated, all status codes described here is part of the current SMTP standard, RFC   5321. 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 (transmitted as three numeric characters) followed by some text. The number is for use by automata (e.g., email clients) to determine what state to enter next; the text ("Text Part") is for the human user.

The first digit denotes whether the response is good, bad, or incomplete:

The second digit encodes responses in specific categories:

Enhanced status code

The Basic Status Codes have been in SMTP from the beginning, with RFC   821 in 1982, but were extended rather extensively, and haphazardly so that by 2003 RFC   3463 rather grumpily noted that: "SMTP suffers some scars from history, most notably the unfortunate damage to the reply code extension mechanism by uncontrolled use."

RFC   3463 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:

In general the class identifier MUST match the first digit of the Basic Status Code to which it applies. [1]

The subjects are defined as follows:

The meaning of the "detail" field depends on the class and the subject, and are listed in RFC 3463 and RFC   5248.

A server capable of replying with an Enhanced Status Code MUST preface (prepend) the Text Part of SMTP Server responses with the Enhanced Status Code followed by one or more spaces. For example, the "221 Bye" reply (after QUIT command) MUST be sent as "221 2.0.0 Bye" instead. [1]

The Internet Assigned Numbers Authority (IANA) maintains the official registry of these enhanced status codes. [2]

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 (outside of the 3-field Enhanced Status Code) might be different.

2yz Positive completion

211System status, or system help reply
214Help message (A response to the HELP command)
220<domain> Service ready
221<domain> Service closing transmission channel
221 2.0.0Goodbye [1]
235 2.7.0Authentication succeeded [3]
240QUIT
250Requested mail action okay, completed
251User not local; will forward
252Cannot verify the user, but it will try to deliver the message anyway

3yz Positive intermediate

334 (Server challenge - the text part contains the Base64-encoded challenge) [3]
354Start mail input

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 (if any).

The accurate meaning of "transient" needs to be agreed upon between the two different sites (receiver- and sender-SMTP agents) must agree on the interpretation. Each reply in this category might have a different time value, but the SMTP client SHOULD try again.

421Service not available, closing transmission channel (This may be a reply to any command if the service knows it must shut down)
432 4.7.12A password transition is needed [3]
450Requested mail action not taken: mailbox unavailable (e.g., mailbox busy or temporarily blocked for policy reasons)
451Requested action aborted: local error in processing
451 4.4.1IMAP server unavailable [4]
452Requested action not taken: insufficient system storage
454 4.7.0Temporary authentication failure [3]
455Server unable to accommodate parameters

5yz Permanent negative completion

The SMTP client SHOULD NOT repeat the exact request (in the same sequence). 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.

500Syntax error, command unrecognized (This may include errors such as command line too long)
500 5.5.6Authentication Exchange line is too long [3]
501Syntax error in parameters or arguments
501 5.5.2Cannot Base64-decode Client responses [3]
501 5.7.0Client initiated Authentication Exchange (only when the SASL mechanism specified that client does not begin the authentication exchange) [3]
502Command not implemented
503Bad sequence of commands
504Command parameter is not implemented
504 5.5.4Unrecognized authentication type [3]
521Server does not accept mail [5]
523Encryption Needed [6]
530 5.7.0Authentication required [3]
534 5.7.9Authentication mechanism is too weak [3]
535 5.7.8Authentication credentials invalid [3]
538 5.7.11Encryption required for requested authentication mechanism [3]
550Requested action not taken: mailbox unavailable (e.g., mailbox not found, no access, or command rejected for policy reasons)
551User not local; please try <forward-path>
552Requested mail action aborted: exceeded storage allocation
553Requested action not taken: mailbox name not allowed
554Transaction has failed (Or, in the case of a connection-opening response, "No SMTP service here")
554 5.3.4Message too big for system [4]
556Domain does not accept mail [5]

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:<bob@example.com> S: 250 Ok C: RCPT TO:<alice@example.com> S: 250 Ok C: RCPT TO:<theboss@example.com> S: 250 Ok C: DATA S: 354 End data with <CR><LF>.<CR><LF> C: From: "Bob Example" <bob@example.com> C: To: Alice Example <alice@example.com> 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 {The server closes the connection}

And below is an example of an SMTP connection in which the SMTP Server supports the Enhanced Status Code, taken from RFC   2034:

S: 220 dbc.mtview.ca.us SMTP service ready C: EHLO ymir.claremont.edu S: 250-dbc.mtview.ca.us says helloS: 250 ENHANCEDSTATUSCODES C: MAIL FROM:<ned@ymir.claremont.edu> S: 250 2.1.0 Originator <ned@ymir.claremont.edu> ok C: RCPT TO:<mrose@dbc.mtview.ca.us> S: 250 2.1.5 Recipient <mrose@dbc.mtview.ca.us> ok C: RCPT TO:<nosuchuser@dbc.mtview.ca.us> S: 550 5.1.1 Mailbox "nosuchuser" does not exist C: RCPT TO:<remoteuser@isi.edu> S: 551-5.7.1 Forwarding to remote hosts disabledS: 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 {The server closes the connection}

Related Research Articles

<span class="mw-page-title-main">Email</span> Mail sent using electronic means

Electronic mail is a method of exchanging messages ("mail") between people using electronic devices. Email was thus conceived as the electronic (digital) version of, or counterpart to, mail, at a time when "mail" meant only physical mail. Email later became a ubiquitous communication medium, to the point that in current use, an email address is often treated as a basic and necessary part of many processes in business, commerce, government, education, entertainment, and other spheres of daily life in most countries. Email is the medium, and each message sent therewith is called an email.

In computing, the Internet Message Access Protocol (IMAP) is an Internet standard protocol used by email clients to retrieve email messages from a mail server over a TCP/IP connection. IMAP is defined by RFC 9051.

In computing, the Post Office Protocol (POP) is an application-layer Internet standard protocol used by e-mail clients to retrieve e-mail from a mail server. POP version 3 (POP3) is the version in common use, and along with IMAP the most common protocols for email retrieval.

The Simple Mail Transfer Protocol (SMTP) is an Internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages. User-level email clients typically use SMTP only for sending messages to a mail server for relaying, and typically submit outgoing email to the mail server on port 587 or 465 per RFC 8314. For retrieving messages, IMAP is standard, but proprietary servers also often implement proprietary protocols, e.g., Exchange ActiveSync.

In computing, a handshake is a signal between two devices or programs, used to, e.g., authenticate, coordinate. An example is the handshaking between a hypervisor and an application in a guest virtual machine.

<span class="mw-page-title-main">Email client</span> Computer program used to access and manage a users email

An email client, email reader or, more formally, message user agent (MUA) or mail user agent is a computer program used to access and manage a user's email.

The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client–server model architecture using separate control and data connections between the client and the server. FTP users may authenticate themselves with a clear-text sign-in protocol, normally in the form of a username and password, but can connect anonymously if the server is configured to allow it. For secure transmission that protects the username and password, and encrypts the content, FTP is often secured with SSL/TLS (FTPS) or replaced with SSH File Transfer Protocol (SFTP).

An email address identifies an email box to which messages are delivered. While early messaging systems used a variety of formats for addressing, today, email addresses follow a set of specific rules originally standardized by the Internet Engineering Task Force (IETF) in the 1980s, and updated by RFC 5322 and 6854. The term email address in this article refers to just the addr-spec in Section 3.4 of RFC 5322. The RFC defines address more broadly as either a mailbox or group. A mailbox value can be either a name-addr, which contains a display-name and addr-spec, or the more common addr-spec alone.

Various anti-spam techniques are used to prevent email spam.

A bounce message or just "bounce" is an automated message from an email system, informing the sender of a previous message that the message has not been delivered. The original message is said to have "bounced".

In computers and technology, a postmaster is the administrator of a mail server. Nearly every domain should have the e-mail address postmaster@example.com where errors in e-mail processing are directed. Error e-mails automatically generated by mail servers' MTAs usually appear to have been sent to the postmaster address.

On-Demand Mail Relay (ODMR) is an SMTP extension standardized in RFC 2645 that allows e-mail to be relayed to the recipients after they have been authenticated. It uses the extended SMTP command ATRN, similar to the ETRN command but available for dynamically assigned IP addresses.

The Sender Rewriting Scheme (SRS) is a scheme for bypassing the Sender Policy Framework's (SPF) methods of preventing forged sender addresses. Forging a sender address is also known as email spoofing.

Opportunistic TLS refers to extensions in plain text communication protocols, which offer a way to upgrade a plain text connection to an encrypted connection instead of using a separate port for encrypted communication. Several protocols use a command named "STARTTLS" for this purpose. It is a form of opportunistic encryption and is primarily intended as a countermeasure to passive monitoring.

Email forwarding generically refers to the operation of re-sending an email message delivered to one email address to one or more different email addresses.

A mailbox is the destination to which electronic mail messages are delivered. It is the equivalent of a letter box in the postal system.

A bounce address is an email address to which bounce messages are delivered. There are many variants of the name, none of them used universally, including return path, reverse path, envelope from, envelope sender, MAIL FROM, 5321-FROM, return address, From_, Errors-to, etc. It is not uncommon for a single document to use several of these names.

SMTP Authentication, often abbreviated SMTP AUTH, is an extension of the Simple Mail Transfer Protocol (SMTP) whereby a client may log in using any authentication mechanism supported by the server. It is mainly used by submission servers, where authentication is mandatory.

A mailbox provider, mail service provider or, somewhat improperly, email service provider is a provider of email hosting. It implements email servers to send, receive, accept, and store email for other organizations or end users, on their behalf.

References