SMTP, Startup - CSCI 6433 Internet Protocols

advertisement
Dave Roberts


A word about the Midterm
Simple Mail Transport Protocol
 SMTP
2

It’s about the engineering tradeoffs of
Internet protocols
 Choices in the design of protocols
 Choices in how you use them


You have more knowledge now, so there will
be more hands-on homework
Homework workload will be reduced
somewhat because you have projects and it’s
a busy time
3

Good Citizen Principle
 It’s about giving up resources when they are scarce
 It’s not about normal operation

Layering
 Isolates operations from each other
 Flexibility in configuration

End to end
 High level functions performed by endpoints
 Superior reliability

Conserving router time
 No Internet if router job is too difficult
 Drives design of all Internet protocols
4
5
Email allows users to send memos across the
Internet.
 Notes can be short or quite large
 Notes can have multiple attachments
 Must work when remote machine is
unreachable
6

Post Office
 SMTP servers move email between each other
 SMTP servers store email for delivery to end users

Users
 POP clients pick up email from SMTP servers
 POP clients hand outgoing mail to SMTP servers
7
8
Sender and receiver do not need to be connected to the
server at the same time
9



MAIL command: establishes return address
and bounce address
RCPT command: establishes recipient of this
message
DATA signals beginning of the message text
10


What protocol do SMTP servers use to deliver
messages?
How does SMTP differ between v4 and v6?
11
12

























S: 220 smtp.example.com ESMTP Postfix
C: HELO relay.example.org
S: 250 Hello relay.example.org, I am glad to meet you
C: MAIL FROM:<bob@example.org>
S: 250 Ok
C: RCPT TO:<alice@example.com>
S: 250 Ok
C: RCPT TO:<theboss@example.com>
S: 250 Ok
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C: From: "Bob Example" <bob@example.org>
C: To: "Alice Example" <alice@example.com>
C: Cc: theboss@example.com
C: Date: Tue, 15 January 2008 16:02:43 -0500
C: Subject: Test message
C:
C: Hello Alice.
C: This is a test message with 5 header fields and 4 lines in the message body.
C: Your friend,
C: Bob C: .
S: 250 Ok: queued as 12345
C: QUIT
S: 221 Bye
{The server closes the connection}
13
14
TCP/IP internet makes universal delivery service
possible
 Mail systems built on TCP/IP are inherently reliable
because of end-to-end delivery
 Alternatively, mail gateways are used

 Allow mail transfer between different systems
 When gateway has a message, sender discards it
Question: Is email through a gateway better or worse than a direct
SMTP transfer?
15






Format and computer interaction are
specified separately
Format: header, blank line, body
Body unspecified
Header is key word, colon, value
Some keywords required, others optional
Header is readable
16
local-part @ domain-name
domain-name: name of mail destination
 local-part: address of a mailbox at
destination
Note: when gateways are employed, mail
addresses are site-dependent

17




Simple Mail Transport Protocol
Focuses on how mail delivery system passes
messages from one machine to a server on
another machine
Does not specify anything about user
interface
Does not specify how mail is stored
18
SMTP server forms TCP/IP connection with
receiving server
 Once receiving server has put message into safe
store, then it acknowledges and sender discards
message
 If SMTP can’t transfer message on the first try, it
keeps trying
 After several days of failure, SMTP reports failure to
deliver.

19




All communications is readable ASCII text
Transcript of interactions is readable
Each message is acknowledged separately
Addresses of the form local-part@domainname
20
POP3—Post Office Protocol
POP3 client creates TCP connection to POP3 server
on mailbox computer
 Mailbox computer runs two servers:


 SMTP to place mail into user mailboxes
 POP3 server to allow user to extract messages from user
mailbox
POP3 retrieves messages, deletes from user
mailbox
 Two servers must coordinate use of the user
mailbox

21



POP stores messages offline; not compatible
with the use of multiple computers
IMAP allows message access, manipulation
from multiple computers
Platform-independent access to mail
Question: How does server resource usage of IMAP compare with POP?
22
MIME—Multipurpose Internet Mail Extensions
 Defined to allow transmission of non-ASCII data
through mail
 MIME allows arbitrary data to be encoded in ASCII,
transmitted as standard email message
 MIME message tells recipient type of data, type of
encoding used
 Data type and subtype is specified
 MIME information is in 822 mail header
23
24
From: bill@acollege.edu
To: john@example.com
MIME-Version: 1/0
Content-Type: image/gif
Content-Transfer Encoding: base64
….data for the image….
25




Post Office Protocol—client login with
userid/password
Client can then retrieve, delete messages
Server computer must run two servers: POP
and SMTP
POP and SMTP must coordinate use of
mailbox
26






Email is a very important Internet service
Separate standards are used for message format and
transfer
SMTP—how a mail system on one machine transfers to a
server on another
POP3—how a user can retrieve contents of a mailbox
IMAP—user protocol for use from multiple computers
MIME allows arbitrary data to be exchanged using SMTP
27
Download