|
AIXtmmtXIA :
Technical Consulting Group
  |
SMTP 101 |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The Simple Mail Transfer Protocol (SMTP) is the most widely used protocol to send messages by Message Transfer Agents (MTA) on the internet. MTAs are client or server programs that perform email services, such as sending or receiving mail for a host computer. The protocol is defined in RFC 821 and RFC 1123, and was designed to transfer mail independently of any specific transmission subsystem. SMTP demands an ordered data stream of 7-bit US-ASCII characters, and has size limitations on certain objects discussed below. The SMTP model is based on what is called a mail transaction. Sender and receiver MTAs send commands and replies in a structured, lock-step process. The sender MTA initiates the transaction steps by sending SMTP commands to the receiver. The receiver MTA replies to the sender with numeric reply codes, followed by a text string with additional information about the reply code. The Mail TransactionThe sender MTA initiates a two-way TCP communication channel between it and the receiver MTA, generally on port 25. Once the connection is open, the receiver MTA sends reply code 220 indicating that it is ready. The sender MTA then sends the HELO command with the client host as an argument. The HELO command identifies the sender MTA to the receiver MTA, and the receiver MTA will respond with a reply code 250. This tells the sender MTA that the connection is open and ready to go. This step in the transaction identifies and confirms host addresses for both the sender and receiver MTAs. Example:
The mail transaction is initiated by the MAIL command from the sender MTA. This command causes the receiver MTA to reset its state tables and buffers, including the recipients and mail data. The syntax for the MAIL command is
Example:
The reverse-path is the full reverse source route list, starting with the current client host and ending with the user mailbox. The reverse-path is modified by each MTA as the message travels toward its destination. Before transferring a message to the next relay host, the current host will remove its name from the beginning of the forward-path and adds its name to the beginning of the reverse path. The forward-path is used in the next command, RCPT.
Example:
If the mailbox address is acceptable to the receiver MTA, it transmits a reply code 250 to the sender MTA. If it cannot fulfill the request, it transmits a reply code of 550. One reason it may not be able to fulfill the request is because the mailbox is incorrect or non-existent. The next step is for the sender MTA to issue the DATA command. There are no arguments to this command, it simply tells the receiver that the sender is ready to start sending the message. The receiver MTA will transmit a reply code 354 indicating that it is ready to receive the message. Once the sender MTA receives the correct reply code, it sends the mail data to the receiver. The mail data is followed by a <CRLF>.<CRLF> sequence indicating that there is no more data.
Example:
When the receiver MTA responds with the reply code 250, acknowledging receipt of the message, the sender MTA transmits the QUIT command. The receiver MTA sends the reply code 221, and the mail transaction is complete.
SMTP CommandsThe following are the SMTP commands. The commands marked "Required" are the ones specified by RFC 821 and RFC 1123 which must be part of a minimal SMTP implementation.
SMTP Reply CodesThe following are the SMTP reply codes sent from the receiver MTA.
|
  |
For information regarding this page, contact Dana French ( dfrench@mtxia.com )