Application SMTP
Application SMTP
• MIME
• SMTP
• POP
• IMAP
Main components: User agents, message access agent, and
transfer agents
Components of email
User agent: used to compose mail, read mail, store in local
computer (if two users are on the same LAN, we only need two
user agents). Eg. Eudora, Outlook, Netscape.
MTAs (message transfer agents) to transfer from local machine
to a server, server to another server and so on. SMTP
Message Access agent – to retrieve from the local server to the
local recipient computer. Pop and IMAP, MIME
Mime (multipurpose internet mail extenstion)
• Allows non-ASCII characters. Used for all languages, video,
and audio.
Figure 20.9 MIME
Figure 20.10 MIME header
Table 20.1 Data types and subtypes in MIME
Table 20.1 Data types and subtypes in MIME (Continued)
Table 20.2 Content-transfer-encoding
SMTP (simple mail transfer protocol)
• Uses commands and responses to transfer messages. Each
command or reply is terminated by carriage return and linefeed.
20.3 MESSAGE TRANSFER AGENT:
SMTP
The actual mail transfer requires message transfer agents (MTAs). The
protocol that defines the MTA client and server in the Internet is called
Simple Mail Transfer Protocol (SMTP).
Srinivas Narayana
20
We’re all familiar with email.
How does it work?
outgoing
Electronic Mail message queue
user mailbox
user
Three major components: agent
user
agent
user
agent
22
Electronic Mail: Mail servers
2. Mail Servers user
agent
• Mailbox contains incoming messages
for user mail
user
server
• Message queue of outgoing (to be sent) agent
mail messages SMTP mail
• Sender mail server makes connection server user
to Receiver mail server agent
• IP address, port 25 SMTP
SMTP
3. SMTP protocol mail user
• Used to send messages server agent
23
Scenario: Alice sends message to Bob
1) Alice 4) SMTP client sends Alice’s
([email protected]) uses message over the TCP
UA to compose message to connection
[email protected]
5) Bob’s mail server places the
2) Alice’s UA sends message to message in Bob’s incoming
her mail server; message mailbox
placed in outgoing message 6) Sometime later, Bob invokes
queue his user agent to read
3) Client side of SMTP opens message
TCP connection with Bob’s
mail server
1 mail
mail
server user
user server
Alice 2 agent Bob
agent 3 6
4 5
27
MAIL command response codes
28
Mail message (stored on server) format
SMTP: protocol for exchanging email msgs
header
RFC 822: standard for text message format: blank
line
• body
• the “message”, ASCII characters only
29
Message format: multimedia extensions
• MIME: multimedia mail extension, RFC 2045, 2056
• additional lines in msg header declare MIME content type
From: [email protected]
MIME version To: [email protected]
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
30
CS 352
Mail: Access Protocols
CS 352, Lecture 5.2
http://www.cs.rutgers.edu/~sn624/352
Srinivas Narayana
31
Mail access protocols
POP3 or IMAP4
SMTP SMTP access user
user Bob
Alice protocol agent
agent
33
What about web-based email?
• Connect to mail servers via web browser
• Ex: gmail, outlook, etc.
34
Web based email
HTTP HTTP
SMTP SMTP
Client server
Internet
35
Comparing SMTP with HTTP
• HTTP: pull
• SMTP: push
36
Mail Transfer Agents
MTAs do the actual mail transfers
MTAs are not meant to be directly accessed by users.
MMDF
SENDMAIL
Mail Access Protocols
The MTAs place the email in the user’s mailbox
The Mail Access Protocols are used by the users to
retrieve the email from the mailbox
POP3
IMAP4
POP3 and IMAP4
• Message access protocols. (pull)
• Post Office protocol. Simple with limited functionality. Uses
port 100. Has to modes, delete or keep.
• Internet Mail Access Protocol is used to check mail directly from
the web.
20.4 MESSAGE ACCESS AGENT:
POP AND IMAP
The third stage of mail delivery uses a message access agent; the client
must pull messages from the server. Currently two message access
protocols are available: Post Office Protocol, version 3 (POP3) and
Internet Mail Access Protocol, version 4.
POP3
IMAP4
Figure 20.19 POP3 and IMAP4
Post Office Protocol v3
Simple
Allows the user to obtain a list of their Emails
Users can retrieve their emails
Users can either delete or keep the email on their
system
Minimizes server resources
Figure 20.20 POP3
How does POP work?
Incoming messages are stored at a POP server until the user logs in
using an email client and downloads the messages to their computer.
After user downloads the message, it is deleted from the server.
Adv:
POP does not require an internet connection for accessing the
downloaded mails.
Disadv:
For receiving e-mails only on one single device, POP is useful. It is not
possible to access the same email account from multi devices and
have actions synchronize between them.
Common Clients
• Eudora
• Gmail
• Outlook Express
• Mozilla Thunderbird
• Netscape
• Internet Explorer
POP vs. IMAP
POP3:
All Messages
IMAP:
Dr.Amer
Friends
….
Internet Mail Access Protocol v4
Has more features then POP3
User can check the email header before downloading
Emails can be accessed from any location
Can search the email for a specific string of characters before
downloading
User can download parts of an email
User can create, delete, or rename mailboxes on a server