SMTP


SMTP Simple Mail Transfer Protocol is an Internet Standard (STD), contained in the file STD10.TXT written by Jonathan B. Postel. The STD can be retrieved from the Nework Information Center at:

http://www.internic.net

SMTP is used for transfering e-mail items from a client to a message transfer agent or e-mail server. It is useful only for sending e-mail to the server; it cannot be used to retrieve e-mail from the server. SMTP defines a small number of commands that may be sent from the client to the server, and the response codes that the server should respond with for each condition. The following are the SMTP commands:

HELO
MAIL
RCPT
DATA
RSET
NOOP
QUIT

The following are the SMTP reply codes taken from the STD:

500 Syntax error, command unrecognized

A syntax error may include errors such as command line too long.

501 Syntax error in parameters or arguments
502 Command not implemented
503 Bad sequence of commands
504 Command parameter not implemented
211 System status, or system help reply
214 Help message

A help message contains information on how to use the receiver or the meaning of a particular non-standard command. This reply is useful only to the human user.

220 <domain> Service ready
221 <domain> Service closing transmission channel
421 <domain> Service not available,
    closing transmission channel

"Service not available" may be a reply to any command if the service knows it must shut down.

250 Requested mail action okay, completed
251 User not local; will forward to <forward-path>
450 Requested mail action not taken: mailbox unavailable

The mailbox may be busy, for example.

550 Requested action not taken: mailbox unavailable

The mailbox is not found, or cannot be accessed.

451 Requested action aborted: error in processing
551 User not local; please try <forward-path>
452 Requested action not taken: insufficient system storage 552
Requested mail action aborted: exceeded storage allocation 553
Requested action not taken: mailbox name not allowed

For example, the mailbox syntax is incorrect.

354 Start mail input; end with <CRLF>.<CRLF>
554 Transaction failed

The following example is also taken from STD10.TXT:

This SMTP example shows mail sent by Smith at host Alpha.ARPA, to Jones, Green, and Brown at host Beta.ARPA. Here we assume that host Alpha contacts host Beta directly.

S: MAIL FROM:<Smith@Alpha.ARPA>
R: 250 OK

S: RCPT TO:<Jones@Beta.ARPA>
R: 250 OK

S: RCPT TO:<Green@Beta.ARPA>
R: 550 No such user here

S: RCPT TO:<Brown@Beta.ARPA>
R: 250 OK

S: DATA
R: 354 Start mail input; end with <CRLF>.<CRLF>
S: Blah blah blah...
S: ...etc. etc. etc.
S: <CRLF>.<CRLF>
R: 250 OK

The mail has now been accepted for Jones and Brown. Green did not have a mailbox at host Beta. o