Presentation is loading. Please wait.

Presentation is loading. Please wait.

SMTP( 简单邮件传输协议 ) SIMPLE MAIL TRANSFER PROTOCOL RFC 2812.

Similar presentations


Presentation on theme: "SMTP( 简单邮件传输协议 ) SIMPLE MAIL TRANSFER PROTOCOL RFC 2812."— Presentation transcript:

1 SMTP( 简单邮件传输协议 ) SIMPLE MAIL TRANSFER PROTOCOL RFC 2812

2 Introdution standard e-mail protocol part of the TCP/IP protocol defines the message format and the message transfer agent (MTA) TCP port 25 text-based protocol

3 Internet email system User agent Mail server SMTP

4

5 Some mail agents Microsoft Outlook Foxmail Netscape Messenger Endora Mail,pine,elm

6 Mail Server Core of email system Mailbox Message queue

7 SMTP SMTP was originally designed for only plain text (ASCII text) Provides reliable delivery of messages Uses TCP and message exchange between client and server Other functions: –E-mail address lookup –E-mail address verification

8 Scenario

9 SMTP Session 220 mail.cs.tcd.ie ESMTP Postfix (1.1.13) helo FooBar mail from: 250 Ok rcpt to: 250 Ok data 354 End data with. To: Someone@Somewhere.com From: SomeOneElse@Somewhere.com Subject: FooBar Hello World. 250 Ok: queued as A04537DB3 quit 221 Bye

10 SMTP commands HELO domainname startup and give your hostname MAIL MAIL FROM: mail from this address RECV TO: send it to this address VRFY address does this address actually exist (verify) EXPN address expand this address DATA start giving you the body of the mail message RSET reset state and drop current mail message NOOP do nothing DEBUG [level] set debugging level HELP give me some help please QUIT close this connection

11 Telnet SMTP server telnet servername 25 Helo,mail from,rcpt to,data,crlf.crlf,quit

12 SMTP, HTTP –Request/Reply protocols built on TCP or UDP –Designed to handle a fixed set of messages –Pull portocol and push protocol Protocol Data Format Programs SMTP RFC 822 and MIME Pine, NSMail, Eudora,… HTTP HTML Explorer, Netscape, Opera

13 MIME: Multipurpose Internet Mail Extensions Consists of three parts 1.Additional RFC822 Headers MIME-Version: Content-Type: Content-Transfer-Encoding: 2.Content types (and subtypes) text/plain text/rich image/gif application/postscript Multipart/mixed; boundary=“…”

14 MIME Encoding Mail systems assume ASCII –Only 64 valid characters A-Z, a-z, 0-9, +, / Some datatypes include arbitrary binary data (e.g. JPEG) Base64 encoding –3 bytes of data map to 4 ASCII Characters –A=0,B=1,… Also 7bit ASCII encoding –Human readable

15 Encoding of binary Data base64 encoding Treat every 3 bytes (24 bits) as 4 6-bit words

16 The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0A17R34i51z 1B18S35j520 2C19T36k531 3D20U37l542 4E21V38m553 5F22W39n564 6G23X40o575 7H24Y41p586 8I25Z42q597 9J26a43r608 10K27b44s619 11L28c45t62+ 12M29d46u63/ 13N30e47v 14O31f48w 15P32g49x 16Q33h50y

17 From: Steve Zdancewic MIME-Version: 1.0 To: stevez@cis.upenn.edu Subject: Example Mail Content-Type: multipart/mixed; boundary="------------020307000708030506070607" This is a multi-part message in MIME format. --------------020307000708030506070607 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit This is the body. --------------020307000708030506070607 Content-Type: text/plain; name="example.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="example.txt" Hello --------------020307000708030506070607 Content-Type: image/jpeg; name="doc.jpg" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="doc.jpg" /9j/4AAQSkZJRgABAQEASABIAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAIBgYH BgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04…

18 Mail Access Protocols

19 Pop3 A simple mail access protocol RFC 1939 Port 110 Computer with mailboxes runs POP server –User runs POP client on local computer –POP client can access and retrieve messages from mailbox –Requires authentication (password)

20 POP Commands USER - enter your user ID PASS - enter your password QUIT - quit the POP3 server LIST - list the messages and their size RETR - retrieve a message, pass it a message number DELE - delete a message, pass it a message number TOP - show the top x lines of a message, pass it a message number and the number of lines

21 list 1 498 Retr 1 (…). quit


Download ppt "SMTP( 简单邮件传输协议 ) SIMPLE MAIL TRANSFER PROTOCOL RFC 2812."

Similar presentations


Ads by Google