SMTP Simple Mail Transfer Protocol. Content I.What is SMTP? II.History of SMTP III.General Features...
-
Upload
peter-davis -
Category
Documents
-
view
223 -
download
1
Transcript of SMTP Simple Mail Transfer Protocol. Content I.What is SMTP? II.History of SMTP III.General Features...
SMTPSMTPSimple Mail Transfer Simple Mail Transfer
ProtocolProtocol
ContentContent
I.I. What is SMTP?What is SMTP?II.II. History of SMTPHistory of SMTPIII.III. General FeaturesGeneral FeaturesIV.IV. SMTP CommandsSMTP CommandsV.V. SMTP RepliesSMTP RepliesVI.VI. A typical SMTP SessionA typical SMTP SessionVII.VII. The Mail ObjectThe Mail ObjectVIII.VIII. RelayingRelaying
What is SMTP?What is SMTP?
The Simple Mail Transfer Protocol The Simple Mail Transfer Protocol (SMTP) is the actual protocol used to (SMTP) is the actual protocol used to transfer mail from MTA to MTA.transfer mail from MTA to MTA.
MTA: Mail Transfer Agent .... A MTA: Mail Transfer Agent .... A program that actually routes and program that actually routes and delivers mail.delivers mail.
MUA: Mail User Agent ... A program MUA: Mail User Agent ... A program that is used to access mail after that is used to access mail after delivery.delivery.
What is SMTP?What is SMTP?
The objective of SMTP is to transfer The objective of SMTP is to transfer mail reliably and efficiently.mail reliably and efficiently.
SMTP is widely deployed and proven SMTP is widely deployed and proven to be very robust.to be very robust.
The SMTP model is based on what is The SMTP model is based on what is called a mail transaction. Sender called a mail transaction. Sender and receiver MTAs send commands and receiver MTAs send commands and replies in a structured, lock-step and replies in a structured, lock-step process. process.
History of SMTPHistory of SMTP
The SMTP specification originally The SMTP specification originally started with the Mail Transfer started with the Mail Transfer Protocol in 1980Protocol in 1980
It evolved into Simple Mail Transfer It evolved into Simple Mail Transfer Protocol (SMTP) in 1981Protocol (SMTP) in 1981
Specified in RFC 821Specified in RFC 821 Most recent RFC is 2821Most recent RFC is 2821 First and most important First and most important
implementation is sendmailimplementation is sendmail
General FeaturesGeneral Features Independent of underlying transmission Independent of underlying transmission
subsystemsubsystem Just needs a Just needs a reliable ordered data stream reliable ordered data stream
channelchannel Operates over TCP port 25Operates over TCP port 25 Uses an Uses an request-response protocol that is request-response protocol that is
useful to human readers (SMTP useful to human readers (SMTP commands)commands)
SMTP sessions are stateful, with both SMTP sessions are stateful, with both parties carefully maintaining a common parties carefully maintaining a common view of the current state.view of the current state.
SMTP CommandsSMTP Commands
SMTP RepliesSMTP Replies
A typical SMTP SessionA typical SMTP Session SMTP commands are generated by the SMTP commands are generated by the
SMTP client and sent to the SMTP server.SMTP client and sent to the SMTP server. SMTP replies are sent from the SMTP SMTP replies are sent from the SMTP
server to the SMTP client in response to server to the SMTP client in response to the commands.the commands.
To effect a mail transfer to an SMTP To effect a mail transfer to an SMTP server, an SMTP client establishes a two-server, an SMTP client establishes a two-way transmission channel to that SMTP way transmission channel to that SMTP server.server.
Client resolves either final target host or Client resolves either final target host or intermediate MX host via DNS MX RRsintermediate MX host via DNS MX RRs
A typical SMTP SessionA typical SMTP Session
Sender: Open TCP connection to port 25Sender: Open TCP connection to port 25Receiver: 220 starfleet.org readyReceiver: 220 starfleet.org readySender: HELO remulaner.netSender: HELO remulaner.netReceiver: 250 starfleet.orgReceiver: 250 starfleet.orgSender: MAIL FROM: Sender: MAIL FROM:
[email protected]@remulaner.netReceiver: 250 OkReceiver: 250 OkSender: RCPT TO: Sender: RCPT TO: [email protected]@starfleet.orgReceiver 250 OkReceiver 250 Ok
A typical SMTP SessionA typical SMTP Session
Sender: DATASender: DATA
Receiver: 354 start mail inputReceiver: 354 start mail input
Sender: SUBJECT: Hi Riker Du Lutscher!Sender: SUBJECT: Hi Riker Du Lutscher!
Sender: Bla blabla Bla Blaaa! Willste ein Sender: Bla blabla Bla Blaaa! Willste ein Spacetrip?Spacetrip?
Sender:<CRLF>.<CRLF>Sender:<CRLF>.<CRLF>
Receiver: 250 OkReceiver: 250 Ok
Sender: QUITSender: QUIT
Receiver: 221 starfleet.org closing transmission Receiver: 221 starfleet.org closing transmission channelchannel
The Mail ObjectThe Mail Object
SMTP transports a mail objectSMTP transports a mail object Consists of envelope and contentConsists of envelope and content Envelope:Envelope:
Originator Address (MAIL FROM: Originator Address (MAIL FROM: [email protected]@xx.net))
Recipient Address(es) (RCPT TO: Recipient Address(es) (RCPT TO: [email protected]@x.net)) Extensions Extensions
Content:Content: Header and Body (DATA)Header and Body (DATA)
RelayingRelaying
SMTP Server maybe ultimate SMTP Server maybe ultimate destination or intermediate relay hostdestination or intermediate relay host
SMTP server becomes client if it SMTP server becomes client if it sends the message onsends the message on
Responsibility for the message is Responsibility for the message is handed over to relay host:handed over to relay host: Deliver MessageDeliver Message Or report failure to do so!Or report failure to do so!
Thank you for Thank you for listening listening
Any questions ??Any questions ??