lesson 26 - (1 of 41) e-mail, smtp, and mime types

41
Lesson 26 - (1 of 41) E-mail, SMTP, E-mail, SMTP, and MIME types and MIME types

Upload: beryl-glenn

Post on 24-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (1 of 41)

E-mail, SMTP,E-mail, SMTP,and MIME typesand MIME types

Page 2: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (2 of 41)

Outline:E-mail, SMTP, and MIME types

• Mail Systems:– Terminology– Delayed Delivery

• Names and Aliases:• Controlling E-Mail

Messages:• Internetworking and Mail:• Mail Gateways:• Mail Addresses:• Simple Mail Transfer

Protocol (SMTP):

• Post Office Protocol (POP)

• E-Mail Application Program Interfaces:

– MAPI

– AOCE

• MIME Extensions

• MIME Types and Subtypes

• S/MIME Content Type

• MIME Multipart Messages

Page 3: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (3 of 41)

Mail Systems:

• Interactive Client / Server Message Exchange:– Messages can be generated and delivered using

an electronic mail client.– Those messages are then passed point-to-point,

from e-mail server to e-mail server, until delivered or rejected.

Page 4: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (4 of 41)

Mail Systems:

• Mail systems differ from normal network delivery since the absolute destination can be down or the mail recipient may not be on-line (delayed delivery).

• Similar to conventional mailing schemes, e-mail allows a server to place successfully delivered mail in the recipients mailbox.

Page 5: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (5 of 41)

Mail Systems:Terminology

• Terminology:– E-mail (Electronic Mail) - most computers

support e-mail of different types and over different operating platforms (delivery times range from seconds...hours or days.)

– Snail Mail (Conventional Mail) - post office is used and manually delivered (takes several days).

Page 6: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (6 of 41)

Mail Systems:Delayed Delivery

• Spooling or Mail Queues store mail messages the user sends in a private area, which include the following information:– ID of sender– ID recipient– Destination machine address– Time of deposit

Page 7: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (7 of 41)

Mail Systems:Delayed Delivery

• After spooling messages, the system then initiates the transfer to the remote machine as a background activity.

• Spooled messages can be sent at various times in block amounts (transfer process sweeps through the spool area periodically).

Page 8: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (8 of 41)

......

......

outgoing mail spool

area

mailboxesfor

incomingmail

client(background

transfer)

server(to accept

mail)

user send mail

user reads mail

TCP connection

TCP connection

for outgoing mail

for outgoing mail

userinter-face

Components of an E-Mail System:

Page 9: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (9 of 41)

Names and Aliases:

• Recipients specified by pair of identifiers:– Mail destination machine name.– Mailbox address on that machine.

• Mail machine names and mailboxes can be assigned independently of other names assigned to a machine (position of employment or responsibility).

Page 10: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (10 of 41)

Names and Aliases:

• The domain name system (DNS) supports a database and query type for mail destinations.

• This makes it possible to de-couple mail destination names from usual domain names for machines.

• Some e-mail packages require explicit DNS commands be used when sending e-mail (VAX/VMS requires MX%”name”)

Page 11: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (11 of 41)

Controlling E-Mail Messages:

• Methods of sending e-mail:– One-to-one.– One to a group of e-mail addresses (all

specified each time).– Mail Aliases– Mail Exploder (listservers)– Majordomo (automated response e-mail)

Page 12: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (12 of 41)

Controlling E-Mail Messages:

• Mail Alias Expansion (mail forwarder):– Allows the local site to map identifiers used in

mail addresses to a set of new mail addresses (electronic mailing lists, mail forwarding).

– Files can be setup in UNIX accounts to allow e-mail messages to automatically be forwarded to another specified e-mail account.

Page 13: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (13 of 41)

Controlling E-Mail Messages:

• Mail Exploder:– Accepts one incoming message and sends it to a

large set of recipients.– Acts as an alias for a group destinations where

a copy is sent to each member (listservers).

Page 14: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (14 of 41)

......

......

outgoing mail spool

area

mailboxesfor

incomingmail

aliasexpansion

andforwarding

server(to accept

mail)

user sends mail

user reads mail

client(background

transfer)

aliasdatabase

userinter-face

Page 15: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (15 of 41)

Internetworking and Mail:

• Commercial e-mail systems differ from TCP/IP in two crucial ways:– TCP/IP on the Internet creates a universal

delivery service.– E-mail systems built on TCP/IP are more

reliable (TCP provides end-to-end connectivity).

Page 16: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (16 of 41)

Internetworking and Mail:

• Mail systems that use end-to-end delivery can guarantee that each mail message remains in the sender’s machine until it has been successfully copied to the recipient’s machine.

Page 17: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (17 of 41)

Mail Gateways:

• Mail Gateways (mail bridges):– Are not end-to-end, but send mail across

intermediate machines that forward the mail messages.

– Advantage - provides interoperability between various e-mail systems and networks.

– Disadvantage - introduces unreliability.

Page 18: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (18 of 41)

Mail Gateways:

• TCP/IP mail standard has two main parts:– Specifies the format for mail messages and

their headers.– Specifies the details of electronic mail

exchange.

Page 19: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (19 of 41)

Mail Addresses:

• Connected Internet addresses are simple: (localpart@domain-name)

– Localpart - usually a user’s ID or account name.

– Domain-name - officially registered with the IAB, this name is usually structured to reflect:

• Machine name.

• Site name.

• Top-level domain.

Page 20: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (20 of 41)

Mail Addresses:

• Outside connected Internet addresses are complex since mail address mapping functions are local to each machine.

• They are not always in domain-name format.– [email protected]– comer%[email protected]

Page 21: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (21 of 41)

Simple MailTransfer Protocol (SMTP):

• Simple Mail Transfer Protocol (SMTP):– This protocol focuses specifically on how the

underlying mail delivery system passes messages from machine to machine.

– It is an official TCP/IP standard application protocol.

Page 22: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (22 of 41)

Simple MailTransfer Protocol (SMTP):

• It provides readable text transcripts of client-server interactions in the mail header and integer values for commands:– MAIL FROM– RCPT TO– HELO– 250 OK– QUIT

Page 23: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (23 of 41)

Example SMTP Interaction:

• S: hertz.njit.edu Simple Mail Transfer Service Ready.

• C: HELO pegasus.rutgers.edu

• S: 250 hertz.njit.edu

• C: MAIL FROM: <[email protected]>

• S: 250 OK

• C: RCPT TO: <[email protected]>

• S: 250 OK

Page 24: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (24 of 41)

Example SMTP Interaction:(Continued)• C: DATA

• S: 354 Start mail input; end with <CR><LF>.<CR><LF>

• C: …sends body of mail message…

• C: …continues for as many lines as message contains

• C: <CR><LF>.<CR><LF>

• S: 250 OK

• C: QUIT

• S: 221 hertz.njit.edu Service closing transmission.

Page 25: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (25 of 41)

Post Office Protocol (POP):

• Post Office Protocol - Version 3 (POP3):– Is intended to permit a workstation to

dynamically access a maildrop (mail server) on a server host in a useful fashion.

– Usually, this means that the POP3 is used to allow a workstation to retrieve mail that the server is holding for it.

– Access to a POP3 server requires a username and password.

Page 26: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (26 of 41)

E-Mail Application Program Interfaces: MAPI

• Messaging Application Program Interface (MAPI):– Is a set of messaging functions that helps you

create mail-enabled applications as well as other message-based applications.

– With MAPI functions, you can easily add messaging to any Windows application and may or not include a user interface (a dialog box).

– It is supported by many vendors (Microsoft).

Page 27: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (27 of 41)

E-Mail Application Program Interfaces:AOCE

• What is AOCE?– AOCE stands for Apple Open Collaboration

Environment.– It is a set of technologies that provide for

system-level collaboration and messaging services.

– The first incarnation of AOCE was in the form of PowerShare and PowerTalk, the AOCE server and client, respectively.

– It is a proposed standard interface to e-mail.

Page 28: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (28 of 41)

MIME Extensions:

• Multipurpose Internet Mail Extensions (MIME):– Defined by IETF to allow transmission of non-

ASCII data via e-mail.– It allows arbitrary data to be encoded in ASCII

for normal transmission.– All media types that are sent/received over the

World Wide Web are encoded using different MIME types.

Page 29: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (29 of 41)

MIME Extensions:822 Mail Header

• Messages sent using MIME encoding include information that describes the type of data and the encoding that was used (resides in 822 mail header).

• 822 Mail Header:– Version of MIME used.– Type of data sent.– Encoding method used.

Page 30: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (30 of 41)

Example 822Mail Message Header:

• From: [email protected]• To: [email protected]• MIME-Version: 1.0• Content-Type: image/gif• Content-Transfer-Encoding: base64

…data for the image...

Page 31: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (31 of 41)

MIME Types and Subtypes:

• All different media encoding done in MIME is classified as a combination of types and subtypes.

• Each MIME Content-Type must contain two identifiers:– Content Type– Content Subtype

Page 32: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (32 of 41)

MIME Types and Subtypes:

• There are seven official (standardized) content-types that can appear in a MIME Content-Type declaration:– Text - Textual documents.– Image - A computer generated image.– Audio - A sound file.– Video - A motion video recording.

Page 33: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (33 of 41)

MIME Types and Subtypes:

– Application - Raw data for a program.– Multipart - Multiple messages, each having a

separate content type and encoding.– Message - An entire e-mail message or an

external reference to a message (FTP server and filename).

Page 34: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (34 of 41)

MIME Types and Subtypes:

• An eight type has been proposed and will most likely be approved to supply a secure method for transferring encoded data:– Secure - Data is sent encrypted and in a secure

fashion.• The push for an official secure MIME content-

type has come about due to the increased interest in doing business over the WWW.

Page 35: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (35 of 41)

S/MIME Content Type:

• What is S/MIME?– A specification for secure electronic mail.– S/MIME stands for Secure/Multipurpose

Internet Mail Extensions and was designed to add security to e-mail messages in MIME format.

• The security services offered are authentication (using digital signatures) and privacy (using encryption).

Page 36: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (36 of 41)

S/MIME Content Type:

• Why S/MIME?– In the growing demand for e-mail security,

S/MIME melds proven cryptographic constructs with standard e-mail practices.

• Is S/MIME a standard?– No. Although the S/MIME spec will be

submitted to the IETF for consideration as an official Internet RFC (standard) when interoperability tests are complete.

Page 37: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (37 of 41)

MIME Types and Subtypes:

• Examples of Content Type/ Subtype:– image/jpeg– text/html– video/mpeg– audio/x-wav– application/octet-stream

Page 38: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (38 of 41)

MIME Multipart Messages:

• Multipart content type has four subtypes, each of which adds significant flexibility to MIME encoding:– Mixed - allows a single message to contain

multiple independent sub-messages, each of which is separately encoded (HTML documents with images).

Page 39: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (39 of 41)

MIME Multipart Messages:

– Alternative - a single message can include multiple representations of the same data type (ASCII and Rich Text Format).

– Parallel - a single message that includes subparts which should be viewed together (video with audio).

– Digest - a single message that can contain a set of other messages (e-mail messages from a discussion).

Page 40: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (40 of 41)

QuestionsE-mail, SMTP, and MIME types

• Why do you think MIME-encoded messages used as the foundation of WWW technology?

• How does one setup a mail-reflector in there account to forward e-mail?

• A listserv is a special type of e-mail broadcasting. Explain.

• What are Mail APIs used for? Give an example.• What specific MIME type(s) would be used to send

an HTML page with in-line video/audio support?

Page 41: Lesson 26 - (1 of 41) E-mail, SMTP, and MIME types

Lesson 26 - (41 of 41)

Reference MaterialsE-mail, SMTP, and MIME types

• RFC 1651, 1652, 1653: SMTP Services (http://www.cis.ohio-state.edu/htbin/rfc/rfc1651.html)

• E-Mail API Web Resources: (http://andrew2.andrew.cmu.edu/cyrus/email/standards-apis.html)

• RFC 1081, 1082: Post Office Protocol - Version 3 (http://www.cis.ohio-state.edu/htbin/rfc/rfc1081.html)

• Writing your own SMTP gateway: (http://www.vb-online.com/sep95/smtp.html)

• RFC 1521, 1522: MIME Extensions and Headers (http://www.cis.ohio-state.edu/htbin/rfc/rfc1521.html)