Email

  • Upload
    kanchan

  • View
    215

  • Download
    0

Embed Size (px)

DESCRIPTION

How Email Works? MUA, MTA, MAA

Citation preview

  • SMTP, POP3, IMAPFile Transfer Access Method (FTAM), also known as File Transfer Access and Management or Electronic File Transfer Access Method (EFTAM), is anISOstandard (8571) that specifies methods of transferingfiles between networked computers. FTAM is based on the Open Systems Interconnection (OSI) model and is similar to File Transfer Protocol (FTP) and Network File System (NFS).FTAM can be broken down into functional categories known as service classes, as follows:Transfer class, which facilitates the simple exchange of files.Management class, which facilitates the creation, modification and deletion of files.Transfer-and-management class, which facilitates directory navigation and manipulation.Access class, which facilitates operations on file access structures.

  • 2: Application Layer*Chapter 2: Application layer2.1 Principles of network applications2.2 Web and HTTP2.3 FTP 2.4 Electronic MailSMTP, POP3, IMAP2.5 DNS

    2.6 P2P applications2.7 Socket programming with TCP2.8 Socket programming with UDP

  • 2: Application Layer*Electronic MailThree major components: user agents mail servers simple mail transfer protocol: SMTPUser Agenta.k.a. mail readercomposing, editing, reading mail messagese.g., Eudora, Outlook, elm, Mozilla Thunderbirdoutgoing, incoming messages stored on server

  • 2: Application Layer*Electronic Mail: mail serversMail Servers mailbox contains incoming messages for usermessage queue of outgoing (to be sent) mail messagesSMTP protocol between mail servers to send email messagesclient: sending mail serverserver: receiving mail server

  • 2: Application Layer*Electronic Mail: SMTP [RFC 2821]uses TCP to reliably transfer email message from client to server, port 25direct transfer: sending server to receiving serverthree phases of transferhandshaking (greeting)transfer of messagesclosurecommand/response interactioncommands: ASCII textresponse: status code and phrasemessages must be in 7-bit ASCII

  • 2: Application Layer*Scenario: Alice sends message to Bob1) Alice uses UA to compose message and to [email protected]) Alices UA sends message to her mail server; message placed in message queue3) Client side of SMTP opens TCP connection with Bobs mail server4) SMTP client sends Alices message over the TCP connection5) Bobs mail server places the message in Bobs mailbox6) Bob invokes his user agent to read message

    123456

  • 2: Application Layer*Sample SMTP interaction S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: S: 250 [email protected]... Sender ok C: RCPT TO: S: 250 [email protected] ... 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

  • Mail message formatSMTP: protocol for exchanging email msgsRFC 822: standard for text message format:header lines, e.g.,To:From:Subject:different from SMTP commands!bodythe message, ASCII characters onlyheaderbodyblankline

  • 2: Application Layer*Message format: multimedia extensionsMIME: multimedia mail extension, RFC 2045, 2056additional lines in msg header declare MIME content typeTypes: Uuencode, base64, Quoted-printable

    multimedia datatype, subtype, parameter declarationmethod usedto encode dataMIME versionencoded data

  • *MIME

  • Mail access protocolsSMTP: delivery/storage to receivers serverMail access protocol: retrieval from serverPOP: 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 serverHTTP: gmail, Hotmail, Yahoo! Mail, etc.

    SMTPaccessprotocolreceivers mail server

  • *POP3 and SMTP

  • 2: Application Layer*POP3 protocolauthorization phaseclient commands: user: declare usernamepass: passwordserver responses+OK-ERRtransaction phase, client:list: list message numbersretr: retrieve message by numberdele: deletequit C: list S: 1 498 S: 2 912 S: . C: retr 1 S: S: . C: dele 1 C: retr 2 S: S: . C: dele 2 C: quit S: +OK POP3 server signing off

    S: +OK POP3 server ready C: user bob S: +OK C: pass hungry S: +OK user successfully logged on

  • 2: Application Layer*POP3 (more) and IMAPMore about POP3Previous example uses download and delete mode.Bob cannot re-read e-mail if he changes clientDownload-and-keep: copies of messages on different clientsPOP3 is stateless across sessionsIMAPKeep all messages in one place: the serverAllows user to organize messages in foldersIMAP keeps user state across sessions:names of folders and mappings between message IDs and folder name

  • *SMTP, FTP and HTTPConnections: All use TCP SMTP uses persistentconnections FTP persistent controlchannel, non-persistent datachannel per file. HTTP uses both persistentand non-persistent channelsData Flow FTP and HTTP: pull (userrequests files) SMTP: push (email sent toreceiver without request,result can be spam!)

    All have ASCII command/response interaction, status codesHTTP: each object encapsulated in its own response msgFTP: one data channel per fileSMTP: multiple objects sent in multipart msg

    **************