1 / 48

Electronic Mail

Electronic Mail. Three major components: user agents mail servers simple mail transfer protocol: SMTP User Agent a.k.a. “mail reader” composing, editing, reading mail messages e.g., Eudora, Outlook, elm, Netscape Messenger outgoing, incoming messages stored on server. user agent.

brandice
Download Presentation

Electronic Mail

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Electronic Mail

  2. Three major components: user agents mail servers simple mail transfer protocol: SMTP User Agent a.k.a. “mail reader” composing, editing, reading mail messages e.g., Eudora, Outlook, elm, Netscape Messenger outgoing, incoming messages stored on server user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server outgoing message queue user mailbox Electronic Mail

  3. Mail Servers mailbox contains incoming messages for user messagequeue of outgoing (to be sent) mail messages SMTP protocol between mail servers to send email messages client: sending mail server “server”: receiving mail server user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server Electronic Mail: mail servers

  4. The Entire E-mail System

  5. SMTP: delivery/storage to receiver’s server Mail access protocol: retrieval from server POP: Post Office Protocol [RFC 1939] authorization (agent <-->server) and download IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on server HTTP: Hotmail , Yahoo! Mail, etc. user agent user agent sender’s mail server SMTP Mail access protocols SMTP access protocol receiver’s mail server

  6. uses TCP to reliably transfer email message from client to server, port 25 SMTP uses persistent connections direct transfer: sending server to receiving server three phases of transfer handshaking (greeting) transfer of messages closure command/response interaction commands: ASCII text response: status code and phrase SMTP uses info written on envelope of mail Message header Does not look at contents Message body messages must be in 7-bit ASCII Other functions: E-mail address lookup E-mail address verification Electronic Mail: SMTP [RFC 2821]

  7. 1) Alice uses UA to compose message and “to” bob@someschool.edu 2) Alice’s UA sends message to her mail server; message placed in message queue 3) Client side of SMTP opens TCP connection with Bob’s mail server 4) SMTP client sends Alice’s message over the TCP connection 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his user agent to read message user agent user agent mail server mail server Scenario: Alice sends message to Bob 1 2 6 3 4 5

  8. Sample SMTP interaction S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <alice@crepes.fr> S: 250 alice@crepes.fr... Sender ok C: RCPT TO: <bob@hamburger.edu> S: 250 bob@hamburger.edu ... Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C: . S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection

  9. Try SMTP interaction for yourself: • telnet servername 25 • see 220 reply from server • enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader)

  10. [codd:~] [4:18pm] -> telnet www.cs.uakron.edu 25 Trying 130.101.10.1... Connected to vonneumann.cs.uakron.edu. Escape character is '^]'. 220 vonneumann.cs.uakron.edu ESMTP Sendmail 8.9.3/8.9.3; Mon, 12 Nov 2001 16:18:18 -0500 (EST) HELO cs.uakron.edu 250 vonneumann.cs.uakron.edu Hello codd.cs.uakron.edu [130.101.10.5], pleased to meet you MAIL FROM: dang@cs.uakron.edu 250 dang@cs.uakron.edu... Sender ok RCPT TO: dangx@uakron.edu 250 dangx@uakron.edu... Recipient ok DATA 354 Enter mail, end with "." on a line by itself This is a test mail message to myself!!! . 250 Message accepted for delivery QUIT 221 vonneumann.cs.uakron.edu closing connection Connection closed by foreign host.

  11. Mail Message Contents • Each queued message has: • Message text • RFC 822 header with message envelope and list of recipients • Message body, composed by user • A list of mail destinations • Derived by user agent from header • May be listed in header • May require expansion of mailing lists • May need replacement of mnemonic names with mailbox names

  12. Possible Errors • Host unreachable • Host out of operation • TCP connection fail during transfer • Sender can re-queue mail • Give up after a period • Faulty destination address • User error • Target user changed address • Redirect if possible • Inform user if not

  13. SMTP System Overview • Commands and responses between sender and receiver • Initiative with sender • Establishes TCP connection • Sender sends commands to receiver • e.g. HELO<SP><domain><CRLF> • Each command generates exactly one reply • e.g. 250 requested mail action ok; completed

  14. SMTP Replies • Leading digit indicates category • Positive completion reply (2xx) • Positive intermediate reply (3xx) • Transient negative completion reply (4xx) • Permanent negative completion reply (5xx)

  15. Operation Phases • Connection setup • Exchange of command-response pairs • Connection termination

  16. Connection Setup • Sender opens TCP connection with receiver • Once connected, receiver identifies itself • 220 <domain> service ready • Sender identifies itself • HELO • Receiver accepts sender’s identification • 250 OK • If mail service not available, step 2 above becomes: • 421 service not available

  17. Mail Transfer • Sender may send one or more messages to receiver • MAIL command identifies originator • Gives reverse path to used for error reporting • Receiver returns 250 OK or appropriate fail/error message • One or more RCPT commands identifies recipients for the message • Separate reply for each recipient • DATA command transfers message text • End of message indicated by line containing just period (.)

  18. Closing Connection • Two steps • Sender sends QUIT and waits for reply • Then initiate TCP close operation • Receiver initiates TCP close after sending reply to QUIT

  19. Electronic Mailboxes and Addresses • E-mail users have an electronic mailbox into which mail is deposited • Usually associated with computer account; one user may have different electronic mailboxes • User accesses mail with a mail reader program • Electronic mailbox is identified by an e-mail address mailbox@computer

  20. Internet Mail Addressing • User portion or mailbox portion is site specific • Dang • XuanHien_T_Dang • 1234.5678 • Host portion or computer portion is domain name • Source mail client • Resolves destination name using DNS (MX, if available) • Contacts mail delivery server at destination • Copies mail to server • Destination mail server • Interprets user name according to local mailbox addresses • Places mail in appropriate mailbox

  21. E-mail message format • Simple two-part format • Header includes delivery information • Body carries text of message • Header and body separated by blank line

  22. SMTP: protocol for exchanging email msgs RFC 822: standard for text message format: header lines, e.g., To: From: Subject: differentfrom SMTP commands! body the “message”, ASCII characters only Mail message format header blank line body

  23. E-mail Headers • Lines of text in format keyword: information • keyword identifies information; information can appear in any order • Essential information: • To: list of recipients • From: sender • Cc: list of copy recipients • Useful information • Reply-to: different address than From: • Received-by: for debugging • Frivolous information: • Favorite drink: lemonade • Phase-of-the-moon: gibbous

  24. Data in E-mail • Original Internet mail carried only 7-bit ASCII data • Couldn’t contain arbitrary binary values; e.g., executable program • Techniques for encoding binary data allowed transport of binary data • Uuencode: three 8-bit binary values as four ASCII characters (6 bits each) • Also carries file name and protection information • Incurs 33% overhead • Requires manual intervention

  25. Multipurpose Internet Mail Extension (MIME) • Extension to RFC822 • SMTP cannot transmit executables • Uuencode and other schemes are available • Not standardized • Can not transmit text including international characters (e.g. â, å, ä, è, é, ê, ë) • Need 8 bit ASCII • Servers may reject mail over certain size • Translation between ASCII and EBCDIC not standard • SMTP gateways to X.400 can not handle none text data in X.400 messages • Some SMTP implementations do not adhere to standard • CRLF, truncate or wrap long lines, removal of white space, etc.

  26. MIME • MIME extends and automates encoding mechanisms • Allows inclusion of separate components – programs, pictures, audio clips – in a single mail message • Sending program identifies the components so receiving program can automatically extract and inform mail recipient • Header includesMIME-Version: 1.0Content-Type: Multipart/Mixed; Boundary=Mime_separator • Separator line gives information about specific encodingContent-Type: text/plain

  27. MIME (cont.) • MIME is extensible – sender and receiver agree on encoding scheme • MIME is compatible with existing mail systems • Everything encoded as ASCII • Headers and separators ignored by non-MIME mail systems • MIME encapsulates binary data in ASCII mail envelope

  28. MIME

  29. Overview of MIME • Five new message header fields • MIME version • Content type • Content transfer encoding • Content Id • Content Description

  30. Content Types • Text body • Multipart • Mixed, Parallel, Alternative, Digest • Message • RFC 822, Partial, External-body • Image • jpeg, gif • Video • mpeg • Audio • Basic • Application • Postscript • octet stream

  31. MIME Transfer Encodings • Quoted-printable • Data largely printable ASCII characters • Non-printing characters represented by hex code • Base64 • Maps arbitrary binary input onto printable output

  32. MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content type From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data ..... ......................... ......base64 encoded data Message format: multimedia extensions MIME version method used to encode data multimedia data type, subtype, parameter declaration encoded data

  33. Programs as mail recipients • Can arrange for e-mailbox to be associated with a program rather than a user’s mail reader • Incoming mail automatically processed as input to program • Example – mailing list subscription administration

  34. Mailing Lists and Forwarders • E-mail addresses can be attached to programs as well as electronic mailboxes • Mail exploder or mail forwarder resends copies of message to e-mail addresses in mailing list • UNIX mail program sendmail provides mail aliases • Mailing list processor, e.g. listserv, can also interpret subscription management commands

  35. Mail Gateways • Mailing list processing may take significant resources in large organizations • May be segregated to a dedicated server computer: mail gateway • Provides single mail destination point for all incoming mail • Can use MX records in DNS to cause all mail to be delivered to gateway

  36. Mail gateways and forwarding • Users within an organization may want to read mail on local or departmental computer • Can arrange to have mail forwarded from mail gateway • Message now makes multiple hops for delivery • Hops may be recorded in header • Forwarded mail may use proprietary (non-SMTP) mail system

  37. Mail Gateways and E-mail Addresses • Organization may want to use uniform naming for external mail • Internally, may be delivered to many different systems with different naming conventions • Mail gateways can translate e-mail addresses

  38. Mail Access Protocols • User agent accesses a mailbox from a shared mail server • Mail access protocol transfers mail from server to local PC • 2 popular protocols: • POP3 (Post Office Protocol v3) • IMAP (Internet Mail Access Protocol) • Can’t use SMTP because getting messages is a pull operation & SMTP is a push protocol.

  39. Mail Access Protocol • Instead of TELNET, use protocol that accesses mail on remote computer directly • TCP/IP suite includes Post Office Protocol (POP) for remote mailbox access • 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) • Local computer uses SMTP for outgoing mail

  40. POP3 and SMTP

  41. POP3 • Three phases • Authorization • Transaction • Update • During a POP3 session, the server maintains state information • POP3 downloads mail messages to the local machine

  42. authorization phase client commands: user: declare username pass: password server responses +OK -ERR transaction phase, client: list: list message numbers retr: retrieve message by number dele: delete quit POP3 protocol S: +OK POP3 server ready C: user bob S: +OK C: pass hungry S: +OK user successfully logged on C: list S: 1 498 S: 2 912 S: . C: retr 1 S: <message 1 contents> S: . C: dele 1 C: retr 2 S: <message 1 contents> S: . C: dele 2 C: quit S: +OK POP3 server signing off

  43. Dialup Access and POP • POP useful for dialup connection • User’s computer not always connected • Can download all mail at once and read off-line • Can compose mail off-line and mail in one connection

  44. IMAP • Internet Mail Access Protocol • Allows users to manipulate remote mailboxes • Must maintain info about user (e.g., folder hierarchy) even after the user quits • IMAP server is always in 1 of 4 states: • Nonauthenticated • Authenticated • Selected • Logout

  45. More about POP3 Previous example uses “download and delete” mode. Bob cannot re-read e-mail if he changes client “Download-and-keep”: copies of messages on different clients POP3 is stateless across sessions IMAP Keep all messages in one place: the server Allows user to organize messages in folders IMAP keeps user state across sessions: names of folders and mappings between message IDs and folder name POP3 and IMAP

  46. Problem: Suppose Alice, with a web-based email account (such as Hotmail), sends a message to Bob, who accesses his mail from his mail server using POP3. Discuss how the message gets from Alice’s host to Bob’s host. Be sure to list the series of application-layer protocols that are used to move the message between the two hosts. Solution: Message is sent from Alice’s host to her mail server over HTTP. Alice’s mail server then sends the message to Bob’s mail server over SMTP. Bob then transfers the message from his mail server to his host over POP3. Web-based Emails

  47. Connections: – All use TCP – SMTP uses persistent connections – FTP persistent control channel, non-persistent data channel per file. – HTTP uses both persistent and non-persistent channels Data Flow – FTP and HTTP: pull (user requests files) – SMTP: push (email sent to receiver without request, result can be spam!) SMTP, FTP and HTTP • All have ASCII command/response interaction, status codes • HTTP: each object encapsulated in its own response msg • FTP: one data channel per file • SMTP: multiple objects sent in multipart msg

  48. Summary for Email • Electronic mail allows quick, asynchronous communication across entire Internet. • Simple Mail Transfer Protocol (SMTP) is Internet standard for mail delivery • Can attach e-mail addresses to programs for processing • Mailing lists • Other client-server applications • Mail gateways • Provide uniform user addressing outside organizations • Translate from Internet mail (e.g. SMTP) to proprietary systems • Post Office Protocol (POP) and Internet Mail Access Protocol (IMAP) allow remote access to electronic mailboxes.

More Related