SMTP(Simple Mail Transfer Protocol)
SMTP simply defines how command back and forth. Each device is free to choose a software package for implementation.
SMTP use command and responses message between Message transfer Agent client and MTA server.
SMTP is a common protocol for sending email on internet and for retrieving message its use POP and IGMP protocol.
SMTP use command and response for communication.
Each command is terminated by a two character end of line token.
Here are some commands :
HELO – sender’s host name
MAIL FORM – sender of message
RECPT TO – Intended recipient of message
DATA – body of mail
QUIT – for quit.
These five commands are compulsory use to transfer mail using SMTP.
Now some another commands are:
VRFY – name of recipient to be verified
RSET – abort current transaction
NOOP – send back a positive reply code
These three commands are some time used but highly recommended to use.
EXPN – expand an alias
TURN – switch role (sender and receiver)
HELP – command name
These commands are
SEND FORM – Intended recipient of the message
These commands are seldom used.
Response: It is sent from server to client. It is three digit code.
211- system status or help reply
214 – help message
220 – service ready
221 – service closing transmission channel
250 – request command complete
251 – user not local, the message will be forwarded
These are positive completion reply response. Now negative completion response are here:
421 – service not available
450 – mail Box not available
451 – command aborted: local error
452 – command aborted: insufficient storage
551 – user not local
554 – transaction fail
There are three phases for mail transfer one is connection establish second is mail transfer and third one is connection termination.
Let us see one example using command and response.
We try to send mail using telnet and port no 25 which is well known for SMTP.
$telnet mail.aaa.net 25
220 mta13.aaa.net SMTP server ready, today date //response service ready
HELO mail.aaa.net //HELO-sender name
250 mta13.aaa.net //response that command complete
This is for connection establishes now mail transfer.
MAIL FROM: [email protected]
250 [email protected] Ok
RCPT TO:[email protected]
250 recipient[email protected] Ok
DATA hi how are you
354 OK send data ending with <CRLF><CRLF>
Now last one is connection termination
250 Message received:[email protected]
221 mta13 aaa.net SMTP server closing connection
Now Main Thing IN SMTP is a its work like push only data means push protocol its send data from client to receiver bit not fetch data from server to client so to complete mail transfer we required message access protocol which is either POP3 or IMAP4.
POP3 is a post office protocol version 3. its a simple and limited functionality. In this client POP3 is installed in recipient computer and POP3 server is installed in Mail server. The client open a connection using TCP port NO 110 to fetch inbox using send username and password. And after that user can retrieve mail one by one.
POP3 use two mode delete mode and keep mode.
IMAP$ is internet Mail access Protocol version 4 similar to pop3 but provide more facility.
IN this user can search content of the email, user can create, delete rename mail, Create folder for mail also.