Category
IIITA News
About Us
Technova
SIMPLE MAIL TRANSFER PROTOCOL
Nitin Kumar Verma
MS-CLIS '07
Introduction
Simple Mail Transfer Protocol is the standard e-mail protocol on the Internet and part of the TCP/IP protocol suite. SMTP defines the message format and the message transfer agent (MTA), which stores and forwards the mail. SMTP was originally designed for only plain text (ASCII text), but MIME and other encoding methods enable executable programs and multimedia files to be attached to and transported with the e-mail message.
SMTP is a relatively simple, text-based protocol, where one or more recipients of a message are specified and then the message text is transferred. SMTP uses TCP port 25.
Purpose
The primary purpose of SMTP is to transfer email between mail servers. However, it is critical for email clients as well. In order to send email, the client sends the message to an outgoing mail server, which in turn contacts the destination mail server for delivery. For this reason, it is necessary to specify an SMTP server when configuring an email client.
One important point to make about the SMTP protocol is that it does not require authentication. This allows anyone on the Internet to send email to anyone else or even to large groups of people. It is this characteristic of SMTP that makes junk email or spam possible.
Basic Commands
SMTP defines a small-required command set, with several optional commands included for convenience purposes. The minimal set required for an SMTP sending client are:
HELO - Initial State Identification
MAIL- Mail Sender Reverse Path
RCPT - One Recipients Forward Path
DATA - Mail Message Text State
RSET - Abort Transaction and Reset all buffers
NOOP - No Operation
QUIT- Commit Message and Close Channel
SMTP PROCEDURE
There are three steps in SMTP mail transactions.
The transaction is started with a MAIL command that gives the sender identification. If accepted the receiver-SMTP returns a 250 OK reply.
A series of one or more RCPT commands follows giving the receiver information. If accepted, the receiver-SMTP returns a 250 OK reply, and stores the forward-path. If the recipient is unknown the receiver-SMTP returns a 550 Failure reply.
Then a DATA command gives the mail data. If accepted, the receiver-SMTP returns a 354 Intermediate reply and considers all succeeding lines to be the message text. And finally, the end of mail data indicator confirms the transaction. When the end of text is received and stored the SMTP-receiver sends a 250 OK reply.
Example of SMTP Procedure
This SMTP example shows mail sent by ims2007018 at three host of imb2007 at IIITA.
(Note: It is just a Example, not exactly will work at IIITA.)
S: MAIL FROM: ims2007018@iiita.ac.in
R: 250 OK
S: RCPT TO: imb2007045@iiita.ac.in
R: 250 OK
S: RCPT TO: imb2007001@iiita.ac.in
R: 550 No such user here
S: RCPT TO: imb2007002@iiita.ac.in
R: 250 OK
S: DATA
R: 354 Start mail input; end with <CRLF>.
<CRLF>
S: hello this is
..
S: ...etc. etc. etc.
S: <CRLF>. <CRLF>
R: 250 OK