Electronic Mail (SMTP, POP, IMAP, MIME) Chapter 26.
-
Upload
clemence-long -
Category
Documents
-
view
244 -
download
5
Transcript of Electronic Mail (SMTP, POP, IMAP, MIME) Chapter 26.
Electronic MailElectronic Mail(SMTP, POP, IMAP, MIME)(SMTP, POP, IMAP, MIME)
Chapter 26Chapter 26
Electronic MailElectronic Mail
Email used to send memos over an internetEmail used to send memos over an internet Widely usedWidely used Popular because it is fast and convenientPopular because it is fast and convenient
Can send small notes or large memosCan send small notes or large memos
More users send files with email than file transferMore users send files with email than file transfer Different concept than other network usesDifferent concept than other network uses
Must provide for unavailable remote machineMust provide for unavailable remote machine
Temporary outage should not cause sender to wait or Temporary outage should not cause sender to wait or the transfer to abortthe transfer to abort
Spooling used to handle delayed deliverySpooling used to handle delayed deliveryWhen user sends, mail system stores copyWhen user sends, mail system stores copy
Initiates transfer as a background activityInitiates transfer as a background activity
Sender can proceed with other activitiesSender can proceed with other activities
Background mail process becomes a clientBackground mail process becomes a client Uses DNS to map destination name to IP addressUses DNS to map destination name to IP address Attempts to form TCP connection to destination mail serverAttempts to form TCP connection to destination mail server If successful, passes copy to remote system’s spool areaIf successful, passes copy to remote system’s spool area
If not, records attempted time and terminatesIf not, records attempted time and terminates
Background process periodically sweeps spool areaBackground process periodically sweeps spool area
If finds undelivered mail, tries againIf finds undelivered mail, tries again
If cannot deliver after an extended time, notifies senderIf cannot deliver after an extended time, notifies sender
Figure 26.1Figure 26.1
Three hidden ideasThree hidden ideas Recipient specified by text stringRecipient specified by text string
local-part@domain-part (ex. [email protected])local-part@domain-part (ex. [email protected]) Names independent of other machine namesNames independent of other machine names
Mail destination names decoupled from usual domain Mail destination names decoupled from usual domain namesnames
Mail forwardingMail forwardingMail that arrives on one machine may be forwarded to Mail that arrives on one machine may be forwarded to anotheranother
Includes a mail alias expansion mechanismIncludes a mail alias expansion mechanism
TCP/IP Standards for Email ServiceTCP/IP Standards for Email Service
Two sets of mail standardsTwo sets of mail standards Message formatsMessage formats
Exact format for headersExact format for headers
Body of text formatting up to senderBody of text formatting up to sender Details of email exchanges between computersDetails of email exchanges between computers
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
SMTPSMTP Standard for exchange of mail between machinesStandard for exchange of mail between machines Focuses on how underlying mail delivery system Focuses on how underlying mail delivery system
passes messages across internetpasses messages across internetNot specify how mail system accepts mail from a userNot specify how mail system accepts mail from a user
Not specify how user presented with incoming mailNot specify how user presented with incoming mail
Not specify how mail is storedNot specify how mail is stored
Not specify how frequently send attempts madeNot specify how frequently send attempts made
SMTP is straightforwardSMTP is straightforwardClient/server communication done in ASCII textClient/server communication done in ASCII text
Easily readable by humansEasily readable by humans
Client establishes reliable stream connection to server; Client establishes reliable stream connection to server; waits for server to send READY FOR MAILwaits for server to send READY FOR MAIL
When get, client sends HELO commandWhen get, client sends HELO command
Server responds by identifying itselfServer responds by identifying itself
Once communication established, sender can:Once communication established, sender can: transmit one or more mail messagestransmit one or more mail messages terminate the connectionterminate the connection Request server to reverse roles (mail go other way)Request server to reverse roles (mail go other way) Receiver must acknowledge each message; or can abort Receiver must acknowledge each message; or can abort
connection or abort current message transferconnection or abort current message transfer
Mail Retrieval & Mailbox Mail Retrieval & Mailbox Manipulation ProtocolsManipulation Protocols
SMTP scheme implies that a server must SMTP scheme implies that a server must remain ready to accept email at all timesremain ready to accept email at all times What about user with dialup Internet access?What about user with dialup Internet access?
Only be available when dialed inOnly be available when dialed inUse a two-stage delivery processUse a two-stage delivery process
User given mailbox on system with permanent connectionUser given mailbox on system with permanent connectionThat computer runs a conventional SMTP serverThat computer runs a conventional SMTP server
User forms dialup connection, runs protocol to get messagesUser forms dialup connection, runs protocol to get messages
Two protocols allows remote user to get mail from Two protocols allows remote user to get mail from permanent mailboxpermanent mailbox
Post Office ProtocolPost Office Protocol Current version is 3; POP3Current version is 3; POP3 User invokes POP3 clientUser invokes POP3 client
Creates TCP connection to POP3 serverCreates TCP connection to POP3 server
User authenticates by login & passwordUser authenticates by login & password
User client sends commands to retrieve messagesUser client sends commands to retrieve messages Computer with permanent mailbox must run Computer with permanent mailbox must run
two serverstwo serversSMTP server accepts mail and stores itSMTP server accepts mail and stores it
POP3 server allows user to get messagesPOP3 server allows user to get messages
Internet Message Access ProtocolInternet Message Access Protocol Current version is 4: IMAP4Current version is 4: IMAP4 Uses same general paradigm as POP3Uses same general paradigm as POP3
But allows user to dynamically create, delete, or But allows user to dynamically create, delete, or rename mailboxesrename mailboxes
Also provides more functionality for message retrieval Also provides more functionality for message retrieval and processingand processing
Examine headers without retrievingExamine headers without retrieving Search for string and retrieve portions of a messageSearch for string and retrieve portions of a message
MIME Extension for Non-ASCII DataMIME Extension for Non-ASCII Data
Multipurpose Internet Mail ExtensionsMultipurpose Internet Mail Extensions Defined for email transfer of Non-ASCII dataDefined for email transfer of Non-ASCII data Does not replace or change POP3 or SMTPDoes not replace or change POP3 or SMTP
Allows encoding of arbitrary data in ASCIIAllows encoding of arbitrary data in ASCII
Then can be transmitted in a standard email messageThen can be transmitted in a standard email message
MIME header lines specify:MIME header lines specify: Version of MIME usedVersion of MIME used Type of data being sendType of data being send Encoding used to covert the data to ASCIIEncoding used to covert the data to ASCII
Example:Example:
From: [email protected]: [email protected]
To: [email protected]: [email protected]
MIME-Version: 1.0MIME-Version: 1.0
Content-Type: image/gifContent-Type: image/gif
Content-Transfer-Encoding: base64Content-Transfer-Encoding: base64
……data for the image…data for the image…
MIME-Version: 1.0MIME-Version: 1.0Content-Type: multipart/mixed;Content-Type: multipart/mixed;Content-Type: application/msword;Content-Type: application/msword;
name="assign10.doc"name="assign10.doc"Content-Transfer-Encoding: base64Content-Transfer-Encoding: base64Content-Description: assign10.docContent-Description: assign10.docContent-Disposition: attachment;Content-Disposition: attachment;
filename="assign10.doc"filename="assign10.doc"
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAbAAAAAAAAAAA0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAbAAAAAAAAAAAEAAAbgAAAAEAAAD+////AAAAAGsAAAD/////////////////////////////////////////EAAAbgAAAAEAAAD+////AAAAAGsAAAD/////////////////////////////////////////EAAAbgAAAAEAAAD+////EAAAbgAAAAEAAAD+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////s///////////////////////////////////////////////////////////////////////////spcEAA2AJBAAA8BK/AAAAAAAAEAAAAAAABgAAXA0AAA4AYmpiastzy3MAAAAAAAAAAAAAAAAAAAAApcEAA2AJBAAA8BK/AAAAAAAAEAAAAAAABgAAXA0AAA4AYmpiastzy3MAAAAAAAAAAAAAAAAAAAAAAAAJBBYANBoAAKkZAQCpGQEAXAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//w8AAAAAAAAJBBYANBoAAKkZAQCpGQEAXAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAAAAAAAAAAAAKQAAAAAAHAEAAAAAAAAcAQAAHAEAAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAAAAAAAAAAAAKQAAAAAAHAEAAAAAAAAcAQAAHAEAAAAAAAAcAQAAAAAAABwBAAAAAAAAHAEAAAAAAAAcAQAABQAAAAAAAAAAAAAAIQEAAAAAAAADAoAAAAAAAAAcAQAAAAAAABwBAAAAAAAAHAEAAAAAAAAcAQAABQAAAAAAAAAAAAAAIQEAAAAAAAADAoAAAAAAAAMCgAAAAAAAAwKAAAAAAAAD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AAAAAAAAAAAAAAAAAAAAAAAAAAKZMAAAAAAAAAAAAAAAAAAGYLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Content-Type must have two identifiersA content type and a subtype
Separated by a slash
Figure 26.5Figure 26.5
MIME Multipart MessagesMIME Multipart Messages
Multipart content type useful for flexibilityMultipart content type useful for flexibility Four subtypes definedFour subtypes defined
MixedMixed Message can have multiple independent submessagesMessage can have multiple independent submessages Each can have own type and encodingEach can have own type and encoding
AlternativeAlternative Message can have multiple representations of the same dataMessage can have multiple representations of the same data
ParallelParallel Message can have subparts that should be viewed togetherMessage can have subparts that should be viewed together
DigestDigest Single message can contain a set of other messagesSingle message can contain a set of other messages
SummarySummary
Email is one of most widely available Email is one of most widely available application servicesapplication services Like other TCP/IP services, uses client-serverLike other TCP/IP services, uses client-server Mail system buffers outgoing/incoming msgsMail system buffers outgoing/incoming msgs
Allows transfer to be done in the backgroundAllows transfer to be done in the background
TCP/IP suite has separate standards for:TCP/IP suite has separate standards for: Mail message formatMail message format Mail transferMail transfer
SMTPSMTP Defines how mail system on one machine Defines how mail system on one machine
transfers mail to a server on anothertransfers mail to a server on another
POP3POP3 Specifies how a user can retrieve contents of a Specifies how a user can retrieve contents of a
mailboxmailbox Allows user to have permanent mailbox on a Allows user to have permanent mailbox on a
computer with continuous Internet connectivitycomputer with continuous Internet connectivityUser can access from a machine with intermittent User can access from a machine with intermittent connectivityconnectivity
MIMEMIME Provides mechanism allowing arbitrary data to Provides mechanism allowing arbitrary data to
be transferred using SMTPbe transferred using SMTP Lines in header of message define the type of Lines in header of message define the type of
data and the encoding useddata and the encoding used Mixed multipart type is especially usefulMixed multipart type is especially useful
Single message can contain multiple data typesSingle message can contain multiple data types