SMTP Simple Mail Transfer Protocol Content I. What is SMTP? II. History of SMTP III. General Features IV. SMTP Commands V. SMTP Replies VI. A typical SMTP Session VII. The Mail Object VIII.Relaying What is SMTP? The Simple Mail Transfer Protocol (SMTP) is the actual protocol used to transfer mail from MTA to MTA. MTA: Mail Transfer Agent .... A program that actually routes and delivers mail. MUA: Mail User Agent ... A program that is used to access mail after delivery. What is SMTP? The objective of SMTP is to transfer mail reliably and efficiently. SMTP is widely deployed and proven to be very robust. 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. History of SMTP The SMTP specification originally started with the Mail Transfer Protocol in 1980 It evolved into Simple Mail Transfer Protocol (SMTP) in 1981 Specified in RFC 821 Most recent RFC is 2821 First and most important implementation is sendmail General Features Independent of underlying transmission subsystem Just needs a reliable ordered data stream channel Operates over TCP port 25 Uses an request-response protocol that is useful to human readers (SMTP commands) SMTP sessions are stateful, with both parties carefully maintaining a common view of the current state. SMTP Commands SMTP Replies A typical SMTP Session SMTP commands are generated by the SMTP client and sent to the SMTP server. SMTP replies are sent from the SMTP server to the SMTP client in response to the commands. To effect a mail transfer to an SMTP server, an SMTP client establishes a two-way transmission channel to that SMTP server. Client resolves either final target host or intermediate MX host via DNS MX RRs A typical SMTP Session Sender: Open TCP connection to port 25 Receiver: 220 starfleet.org ready Sender: HELO remulaner.net Receiver: 250 starfleet.org Sender: MAIL FROM: checker@remulaner.net Receiver: 250 Ok Sender: RCPT TO: riker@starfleet.org Receiver 250 Ok A typical SMTP Session Sender: DATA Receiver: 354 start mail input Sender: SUBJECT: Hi Riker Du Lutscher! Sender: Bla blabla Bla Blaaa! Willste ein Spacetrip? Sender:<CRLF>.<CRLF> Receiver: 250 Ok Sender: QUIT Receiver: 221 starfleet.org closing transmission channel The Mail Object SMTP transports a mail object Consists of envelope and content Envelope: Originator Address (MAIL FROM: xx@xx.net) Recipient Address(es) (RCPT TO: x@x.net) Extensions Content: Header and Body (DATA) Relaying SMTP Server maybe ultimate destination or intermediate relay host SMTP server becomes client if it sends the message on Responsibility for the message is handed over to relay host: Deliver Message Or report failure to do so! Thank you for listening Any questions ??