Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar...

28
Applications:Electroni c Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen

Transcript of Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar...

Page 1: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Applications:Electronic Mail(SMTP,POP,IMAP,MIME)

Presented by-Tarun Lall

Badrinath

Sai Kumar

Praveen

Page 2: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Electronic Mail

It is one of the most widely used and popular applications.

Mail delivery differs fundamentally from other uses of networks.

To handle delayed delivery mail systems use a technique called spooling.

Page 3: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Electronic Mail(Contd..)

OUTGOING MAIL CLIENT

SPOOL AREA (BACKGROUND TRANSFER)

USER SENDS TCP CONNECTION MAIL FOR OUTGOING MAILUSER INTERFACEUSER READS TCP CONNECTIONMAIL FOR INCOMING MAIL

MAILBOXES SERVER FOR INCOMING MAIL (TO ACCEPT MAIL)

Page 4: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Mailbox Names and Aliases

Users specify recipients by giving pairs of strings that identify the mail destination machine name and mailbox address on that machine.

The names used in such specifications are independent other names assigned to machines.

Mail processing and forwarding.

Page 5: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Alias Expansion And Mail Forwarding

Most mail forwarding software includes a mail alias expansion mechanism.

Aliases increase mail system functionality and convenience.

The set of recipients associated with an identifier is called an electronic mailing list.

Page 6: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

An extension of mail system

ALIAS DATABASE

ALIAS EXPANSION AND FORWARDING

USER

INTERFACE OUTGOING MAIL SPOOL AREA

CLIENT (BACKGROUND

USER SENDS TRANSFER)

MAIL

USER READS

MAIL

MAILBOXES FOR INCOMING MAIL SERVER (TO ACCEPT MAIL)

Page 7: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Relationship Of Internetworking and

Mail • Many commercial computer systems can forward

e-mail from sites that do not connect to the Internet. How do these systems differ ?

A TCP/IP internet makes possible universal delivery service.

Electronic mail systems built on TCP/IP are more reliable than those built by arbitrary networks.

Page 8: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

• The alternative form of e-mail delivery uses mail gateways. In such systems the sender’s machine does not contact the recipient’s m/c directly but sends mails across one or more intermediate machines that forward it.

• Disadvantage

Introduce unreliability & delay

• Advantage

Interoperability

Page 9: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

TCP/IP Standards For Electronic Mail Service

• TCP/IP divides its mail standard into two sets. One standard specifies the format for mail

messages. The other specifies the details of electronic mail

exchange between two computers. What do these standards accomplish? These two standards make it possible to build mail

gateways that connect TCP/IP internets to some other vendor’s mail delivery system, while still using the same message format for both.

Page 10: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

• The TCP/IP standard for mail messages specifies the exact format of mail headers; it leaves the the format of the body to the user.

TO

SUB

Page 11: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Electronic Mail Addresses

There are several formats in which you could specify mail addresses.

local-part@ domain-name

comer @ purdue.edu Mail gate ways however make addresses more

complex for example consider address of the following CSNET operated gateway

comer%purdue.edu @ relay.cs.net

Page 12: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

• Once the mail reached machine relay.cs.net the mail gateway software would extract the local-part, change the % sign into a @ sign and use result as the destination address to forward the mail. In essence the sites act as if the addresses were parenthesized

( comer%purdue.edu ) @ ( relay.cs.net )

Page 13: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

PSEUDO DOMAIN ADDRESSES

To help solve the problem of multiple mail systems,each with its own e-mail address format,a site can use domain-style names for all e-mail addresses,even if the site does not use the domain name system.

example :

uucp-styleaddress@uucp

or [email protected]

The local mail forwarding software recognizes the special addresses and translates them to address syntax required by the UUCP network software.

From users perspective, the advantage is clear: all electronic addresses have the same general format independent of the underlying communication network used to reach the recipient.

Page 14: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

but such addresses only work where local mailers have been instructed to map them into appropriate forms and only when the appropriate transport mechanisms are available.

Even though psuedo-domain mail addresses have the same form as domain names,they can only be used with electronic mail-one cannot use the domain name system to resolve a psuedo-address into an underlying IP address.

Page 15: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

SIMPLE MAIL TRANSFER PROTOCOL(SMTP)

• In addition to message formats, the TCP/IP protocol suite specifies a standard for exchange of mail between machines.

• The standard specifies the exact format of messages a client on one machine uses to transfer mail to a server on another.

• SMTP focuses specifically on how the underlying mail delivery system passes messages across an internet from one machine to another.

Page 16: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

• It does not specify how the mail system accepts mail from a user or how the user interface presents the user with incoming mail.

• Also it does not specify how mail is stored or how frequently the mail system attempts to send messages.

• communication between client and server consists of readable ASCII text.

• SMTP rigidly defines the command format, humans can easily read a transcript of interactions between a client and server.

• Initially a client establishes a reliable stream connection to the server and waits for the server to send a 220 READY FOR MAIL message.

• If the server is overloaded, it may delay sending the 220 message temporarily.

• Upon receipt of 220 message, the client sends a HELO command.• The end of line marks end of command.• The server responds by identifying itself.

Page 17: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

• Once communication has been established,the sender can transmit one or more mail messages, terminate the connection, or request the server to exchange the roles of sender and receiver so messages can flow in opposite direction.

• The receiver must acknowledge each message. It can also abort the entire connection or abort the current message transfer.

• Mail transactions begin with a MAIL command that gives sender identification as well as a FROM: field that contains the address to which errors should be reported.

• Response 250 means that all is well.The full response consists of the text 250 OK.

• After a successful MAIL command, the sender issues a series of RCPT commands that identify recipients of mail message.

• The recipient must acknowledge each RCPT command by sending 250 OK or by sending the error message 550 NO such user here.

Page 18: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

• After all RCPT commands have been acknowledged, the sender issues a DATA command. In essence, a DATA command informs the receiver that the sender is ready to transfer a complete mail message.

• The receiver responds with message 354 start mail input and specifies the sequence of characters used to terminate the mail message. It consists of 5 characters: carriage return, line feed,period,carriage return, and line feed.

• consider the following example:• suppose user smith at host Alpha.EDU sends a message to users

jones,green and brown at host Beta.GOV.• The SMTP client software on host Alpha.EDU contacts the SMTP server

software on host Beta.GOV and begins the exchange as shown: S: 220 Beta.GOV Simple Mail Transfer Service ReadyC: HELO Alpha.EDUS: 250 Beta.GOV

Page 19: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

• C: MAIL FROM : <[email protected]>• S: 250 ok

• C: RCPT To: <[email protected]>• S: 250 ok

• C: RCPT To:<[email protected]>• S: 550 No Such User Here

• C: RCPT To:[email protected]• S: 250 ok

• C: DATA• S: 354 Start Mail input;end with <CR><LF>.<CR><LF>• C: ….sends body of mail message….• C: …continues for as may lines as message contains• C: <CR><LF>.<CR><LF>• S: 250 ok

Page 20: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

• C: QUIT

• S: 221 Beta.GOV Service Closing transmission channel

• SMTP is much more complex because if a user has moved, the server may know the users new mailbox address. SMTP allows the server to inform the client about the new address so the client can use it in future. When informing the client about a new address, the server may choose to forward the mail that triggered the message, or it may request that the client take the responsibility for forwarding.

Page 21: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Mail Retrieval

• SMTP scheme- Server should remain ready to accept e-mails all the time.

• How can a user receive e-mail without a permanent connection?– User assigned a mail box on computer that has

permanent internet connection.– User forms dialup connection and runs protocol

that receives messages from permanent mailbox.

Page 22: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Post Office Protocol

• Protocol to transfer e-mail messages from mailbox to local computer.

• User invokes a POP3 client, which creates a TCP connection to a POP3 server on the mailbox computer.

• Computer with permanent mailbox must run 2 servers- – SMTP( Accepts mail sent to user) – POP3 (Allows to extract messages from mailbox).

Page 23: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

IMAP4

• Internet Message Access Protocol is an alternative to POP3.

• User runs a IMAP4 client that contacts the server to retrieve messages.

• IMAP4 allows user to dynamically create, delete or rename mail boxes.

Page 24: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

MIME

• Multipurpose Internet Mail Extensions are defined for transmission of non-ASCII data.

• It allows ordinary data to be encoded in ASCII and transmitted in standard email.

• MIME header specifies:– Version of MIME used.– Type of data being sent.– Encoding used to convert data to ASCII.

Page 25: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

MIME Multipart Messages

• Four subtypes for multipart messages:– Mixed

• Allows single message to contain multiple messages.• Possible to send text, graphics and sound in single

message.

– Alternative• Allows single message to include multiple

representations of same data.• Useful when sending same message to multiple

recipients.

Page 26: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Subtypes for Multipart Message

– Parallel• Permits message to include subparts that should be

viewed together(Like video and audio).

– Digest• Permits a message to contain set of other messages.

• E.g., collection of e-mail messages from a discussion.

Page 27: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.

Summary

• E-mail uses TCP/IP paradigm.• SMTP- Defines how a mail system on one

machine transfers mail to server on another.• POP3- Specifies how user can retrieve

contents of a mailbox.• MIME- Provides a mechanism that allows

arbitrary data to be transmitted using SMTP.

Page 28: Applications:Electronic Mail (SMTP,POP,IMAP,MIME) Presented by-Tarun Lall Badrinath Sai Kumar Praveen.