You are on page 1of 22

Electronic Mail

 822, SMTP, MIME, POP


 Most widely used application service
 Sometimes only way a person ever uses a
network
 Mail delivery is a new concept
 differs fundamentally from other network
transfers

© MMII JW Ryder CS 428 Computer Networks 1


Difference
 Network send packets directly to destinations
 timeout, retransmission, ack
 E-mail must provide for when remote machine
is unavailable
 Senders don’t want to wait until the other
person is there
 E-mail systems use a technique called spooling

© MMII JW Ryder CS 428 Computer Networks 2


Spooling
 User sends a message
 Mail system places a copy in private storage with
 sender id
 recipient
 destination machine
 time of deposit
 Initiates transfer of mail as a background activity

© MMII JW Ryder CS 428 Computer Networks 3


Simple Diagram
User sends mail TCP connection for outgoing mail

outgoing mail client (background


User
Inter- spool area process)
face
incoming mail
spool area client (background
process)

User reads mail TCP connection for incoming mail


© MMII JW Ryder CS 428 Computer Networks 4
Transfer Process
 A client
 Use DNS to map destination system to an IP
Address
 Attempt to form a TCP connection to the mail
server on destination machine
 If succeed, pass a copy of message to remote
server
 Remote server stores to copy in its spool area
© MMII JW Ryder CS 428 Computer Networks 5
Transfer Process
 Once client and server agree that the message
was successfully passed, client removes copy
from spool area
 If cannot form TCP connection or connection
fails
 record time delivery attempted then terminate
 Background sweeps through spool area at time
intervals to try again
© MMII JW Ryder CS 428 Computer Networks 6
Transfer Process
 If can’t deliver after a while (few days) sends
message back to the sender

© MMII JW Ryder CS 428 Computer Networks 7


Mailbox Names and Aliases
 Specify recipients by
 maildestination machine name
 mailbox address

 Names used in above specifications are


independent of other names assigned to
machines
 Usually mailbox name is same as user login id and
destination machine name same as domain name
but not required!
© MMII JW Ryder CS 428 Computer Networks 8
Mailboxes
 Could use ‘dept-head’ as mailbox name
 DNS includes separate query type for mail
destinations
 Mail to machine.com may go to a different
machine than telnet connection
 Simple diagram idea too simple

© MMII JW Ryder CS 428 Computer Networks 9


Alias Expansion, Forwarding
 Mail forwarding software includes a mail alias
expansion mechanism
 Map mail addresses in mail to a new set of
addresses
 usually mail interface program consults local
aliases to replace recipient with real address
 Mapping can be many to one

 Associate groups of users with a single id!

© MMII JW Ryder CS 428 Computer Networks 10


Aliases
 See Figure 27.2 on page 514
 x->y, y->x

 Can map to wrong machine a user mail


address

© MMII JW Ryder CS 428 Computer Networks 11


Internetworking and Mail
 2 claims
 TCP/IP internet makes possible universal
delivery system
 Mail systems built on TCP/IP inherently more
reliable than those built on arbitrary networks

© MMII JW Ryder CS 428 Computer Networks 12


Why
 Universal interconnection among machines a
good idea (1)
 More reliable? Yes. TCP provides end to end
connectivity
 Only after client has sent successfully and
server has received successfully will the
message be erased from client machine.

© MMII JW Ryder CS 428 Computer Networks 13


Mail Gateways
 Sender’s machine does not contact recipient’s
machine
 Less reliable

 Chief advantage to mail gateways is


interoperability

© MMII JW Ryder CS 428 Computer Networks 14


TCP/IP Standards
 One standard for format of mail messages
 Another standard for details of electronic
exchange of messages
 Memos divided into two parts
 header
 body
 separated by a blank line

© MMII JW Ryder CS 428 Computer Networks 15


Mail Standards
 Message standard specifies exact header
content leaves body open
 Headers must contain readable text with
 keyword -> colon -> value
 To: email address
 From: email address
 [Reply-to:] address for replies

 Straightforward format good for heterogeneous


machines
© MMII JW Ryder CS 428 Computer Networks 16
SMTP
 Simple Mail Transfer Protocol
 Standard transfer protocol

 MTP was first try

 All readable ASCII text

 Rigid definition of command format

 See Figure 27.3 on page 520

 Bottom of page 520 is example definition

© MMII JW Ryder CS 428 Computer Networks 17


MIME
 To allow non-ASCII data to be sent in mail
 Multipurpose Internet Mail Extension

 No change to SMTP

 Allows arbitrary data to be encoded in ASCII


then transmitted in plain ASCII

© MMII JW Ryder CS 428 Computer Networks 18


MIME Example
 From: bill@acollege.edu
 To: john@somewhere.com
 MIME-Version: 1.0
 Content-Type: image/gif
 Content-Transfer-Encoding: base64

 … data for image ...

© MMII JW Ryder CS 428 Computer Networks 19


MIME
 MIME-Version declares message composed
with version 1.0 of MIME protocol
 Content-Type has type and subtype

 See MIME types in figure 27.5 on page 523

 See example in figure 27.6 on page 524

© MMII JW Ryder CS 428 Computer Networks 20


Summary
 Client/server paradigm
 822 is mail message format - RFC

 SMTP defines how a mail system on a one


machine transfers mail to a server on another
 MIME provides mechanism that allows
arbitrary data to be transferred by SMTP

© MMII JW Ryder CS 428 Computer Networks 21


Summary
 RFC 821 - SMTP with examples by Postel
 RFC 822 - Exact format of mail messages by
Crocker
 RFC 1521 - standard for MIME

© MMII JW Ryder CS 428 Computer Networks 22

You might also like