Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

SMTP & Pop3

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 15
At a glance
Powered by AI
The key takeaways are that SMTP is used to transfer email messages between servers, POP3 and IMAP are used to retrieve email from servers, and MIME extensions allow encoding of multimedia content in email messages.

The three major components of electronic mail are user agents, mail servers, and the Simple Mail Transfer Protocol (SMTP). User agents are used for composing, reading, and managing emails. Mail servers store emails in user mailboxes and queues. SMTP is used to transfer emails between mail servers.

POP3 is a 'download and delete' protocol where emails are deleted from the server after download, it is stateless across sessions, while IMAP keeps all emails on the server, allows organization into folders, and maintains user state across sessions.

SMTP, POP3, IMAP

Chapter 2: Application layer


 2.1 Principles of network  2.6 P2P applications
applications  2.7 Socket programming
 2.2 Web and HTTP with TCP
 2.3 FTP  2.8 Socket programming
 2.4 Electronic Mail with UDP
 SMTP, POP3, IMAP
 2.5 DNS

2: Application2 Layer
Electronic Mail outgoing
message queue

user mailbox
user
• Three major components: agent
 user agents
mail
user
 mail servers server
agent
 simple mail transfer protocol: SMTP
SMTP mail
server user
SMTP agent
User Agent
 a.k.a. “mail reader” SMTP
 composing, editing, reading mail mail
user
messages agent
server
 e.g., Eudora, Outlook, elm,
user
Mozilla Thunderbird
agent
 outgoing, incoming messages user
stored on server agent

2: Application3 Layer
Electronic Mail: mail servers

• Mail Servers user


agent
 mailbox contains incoming
mail
messages for user user
server
agent
 message queue of outgoing SMTP
(to be sent) mail messages mail
server user
 SMTP protocol between mail
SMTP agent
servers to send email
messages SMTP
 client: sending mail server mail
user
agent
 “server”: receiving mail server

server
user
agent
user
agent

2: Application4 Layer
Electronic Mail: SMTP [RFC 2821]
 uses TCP to reliably transfer email message from client to server,
port 25
 direct transfer: sending server to receiving server
 three phases of transfer
 handshaking (greeting)
 transfer of messages
 closure
 command/response interaction
 commands: ASCII text
 response: status code and phrase
 messages must be in 7-bit ASCII

2: Application5 Layer
Scenario: Alice sends message to Bob
• 1) Alice uses UA to compose • 4) SMTP client sends Alice’s
message and “to” message over the TCP
bob@someschool.edu connection
• 2) Alice’s UA sends message • 5) Bob’s mail server places
to her mail server; message the message in Bob’s
placed in message queue mailbox
• 6) Bob invokes his user
• 3) Client side of SMTP
agent to read message
opens TCP connection with
Bob’s mail server

1 mail
mail
server user
user server
2 agent
agent 3 6
4
5

2: Application6 Layer
Sample SMTP interaction
S: 220 hamburger.edu
C: HELO crepes.fr
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <alice@crepes.fr>
S: 250 alice@crepes.fr... Sender ok
C: RCPT TO: <bob@hamburger.edu>
S: 250 bob@hamburger.edu ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: Do you like ketchup?
C: How about pickles?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 hamburger.edu closing connection

2: Application Layer 7
Mail message format

• SMTP: protocol for exchanging


email msgs header
• RFC 822: standard for text blank
message format: line
 header lines, e.g.,
 To:
 From:
body
 Subject:
different from SMTP commands!
 body
 the “message”, ASCII
characters only
Message format: multimedia extensions
 MIME: multimedia mail extension, RFC 2045, 2056
 additional lines in msg header declare MIME content type
 Types: Uuencode, base64, Quoted-printable

From: alice@crepes.fr
MIME version To: bob@hamburger.edu
Subject: Picture of yummy crepe.
method used MIME-Version: 1.0
to encode data Content-Transfer-Encoding: base64
Content-Type: image/jpeg
multimedia data
type, subtype, base64 encoded data .....
.........................
parameter declaration ......base64 encoded data
encoded data

2: Application9 Layer
MIME

10
Mail access protocols
SMTP SMTP access
user
user protocol
agent
agent

sender’s mail receiver’s mail


server server

 SMTP: delivery/storage to receiver’s server


 Mail access protocol: retrieval from server
 POP: Post Office Protocol [RFC 1939]
• authorization (agent <-->server) and download
 IMAP: Internet Mail Access Protocol [RFC 1730]
• more features (more complex)
• manipulation of stored msgs on server
 HTTP: gmail, Hotmail, Yahoo! Mail, etc.
POP3 and SMTP

12
POP3 protocol
S: +OK POP3 server ready
C: user bob
S: +OK
• authorization phase C: pass hungry
 client commands: S: +OK user successfully logged on
 user: declare username C: list
 pass: password S: 1 498
 server responses S: 2 912
 +OK
S: .
C: retr 1
 -ERR
S: <message 1 contents>
transaction phase, client: S: .
C: dele 1
 list: list message numbers
C: retr 2
 retr: retrieve message by S: <message 1 contents>
number S: .
 dele: delete C: dele 2
 quit C: quit
S: +OK POP3 server signing off

2: Application13Layer
POP3 (more) and IMAP
• More about POP3 • IMAP
 Previous example uses  Keep all messages in one
“download and delete” place: the server
mode.  Allows user to organize
 Bob cannot re-read e-mail if messages in folders
he changes client  IMAP keeps user state
 “Download-and-keep”: across sessions:
copies of messages on  names of folders and
different clients mappings between
 POP3 is stateless across message IDs and folder
sessions name

2: Application14Layer
SMTP, FTP and HTTP
• Connections:  All have ASCII
– All use TCP command/response
– SMTP uses persistent interaction, status codes
connections  HTTP: each object
encapsulated in its own
– FTP persistent control response msg
channel, non-persistent data  FTP: one data channel per
channel per file. file
– HTTP uses both persistent  SMTP: multiple objects sent
in multipart msg
and non-persistent channels
• Data Flow
– FTP and HTTP: pull (user
requests files)
– SMTP: push (email sent to
receiver without request,
result can be spam!)

15

You might also like