smtp pop3 imap protocol notes

43
TCP/IP Protocol Suite 1 Upon completion you will be able to: Electronic Mail: Electronic Mail: SMTP, POP, and IMAP SMTP, POP, and IMAP Understand four configurations of email architecture Understand the functions and formats of a user agent Understand MIME and its capabilities and data types Understand the functions and commands of an MTA Understand the function of POP3 and IMAP4 Objectives

Upload: chidambaram

Post on 08-Nov-2014

348 views

Category:

Documents


17 download

DESCRIPTION

SMTP, POP3, IMAP protocols, web technology - notes for How to program - Deitel .For more visit csebdu.blogspot,in

TRANSCRIPT

Page 1: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 1

Upon completion you will be able to:

Electronic Mail:Electronic Mail:SMTP, POP, and IMAPSMTP, POP, and IMAP

• Understand four configurations of email architecture• Understand the functions and formats of a user agent• Understand MIME and its capabilities and data types• Understand the functions and commands of an MTA• Understand the function of POP3 and IMAP4

Objectives

Page 2: Smtp POP3 IMAP protocol notes

SMTP Protocol originated in 1982 (RFC821, Jon Postel) Standard message format (RFC822,2822, D.

Crocker) Goal: To transfer mail reliably and efficiently

Page 3: Smtp POP3 IMAP protocol notes

SMTP SMTP clients and

servers have two main components

User Agents – Prepares the message, encloses it in an envelope. (ex. Thunderbird, Eudora)

Mail Transfer Agent – Transfers the mail across the internet (ex. Sendmail, Exim)

Analogous to the postal system in many ways

Page 4: Smtp POP3 IMAP protocol notes

SMTP SMTP also allows

the use of Relays allowing other MTAs to relay the mail

Mail Gateways are used to relay mail prepared by a protocol other than SMTP and convert it to SMTP

Page 5: Smtp POP3 IMAP protocol notes

Limitations in SMTP

Only uses NVT 7 bit ASCII format How to represent other data types?

No authentication mechanisms Messages are sent un-encrypted Susceptible to misuse (Spamming,

faking sender address)

Page 6: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 6

20.1 ARCHITECTURE

To explain the architecture of email, we give four scenarios. We begin To explain the architecture of email, we give four scenarios. We begin with the simplest situation and add complexity as we proceed. The fourth with the simplest situation and add complexity as we proceed. The fourth scenario is the most common in the exchange of email.scenario is the most common in the exchange of email.

The topics discussed in this section include:The topics discussed in this section include:

First Scenario First Scenario Second Scenario Second Scenario Third Scenario Third Scenario Fourth Scenario Fourth Scenario

Page 7: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 7

Figure 1 First scenario

Page 8: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 8

When the sender and the receiver of an email are on the same system, we

need only two user agents.

Note:Note:

Page 9: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 9

Figure 2 Second scenario

Page 10: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 10

When the sender and the receiver of an email are on different systems, we

need two UAs and a pair of MTAs (client and server).

Note:Note:

Page 11: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 11

Figure 20.3 Third scenario

Page 12: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 12

When the sender is connected to the mail server via a LAN or a WAN, we need two UAs and two pairs of MTAs

(client and server).

Note:Note:

Page 13: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 13

Figure 4 Fourth scenario

Page 14: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 14

Figure 20.5 Push vs. pull

Page 15: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 15

When both sender and receiver are connected to the mail server via a LAN or a WAN, we need two UAs, two pairs

of MTAs (client and server), and a pair of MAAs (client and server). This

is the most common situation today.

Note:Note:

Page 16: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 16

2 USER AGENT

The user agent (UA) provides service to the user to make the process of The user agent (UA) provides service to the user to make the process of sending and receiving a message easier.sending and receiving a message easier.

The topics discussed in this section include:The topics discussed in this section include:

Services Provided by a User Agent Services Provided by a User Agent User Agent Types User Agent Types Sending Mail Sending Mail Receiving Mail Receiving Mail Addresses Addresses Mailing List Mailing List MIME MIME

Page 17: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 17

Figure 6 User agent

Page 18: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 18

Some examples of command-driven user agents are mail, pine, and elm

Note:Note:

Page 19: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 19

Some examples of GUI-based user agents are Eudora, Outlook, and

Netscape.

Note:Note:

Page 20: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 20

Figure 7 Format of an email

Page 21: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 21

Figure 8 Email address

Page 22: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 22

Figure 29 MIME

Page 23: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 23

Table 1 Table 1 Data types and subtypes in MIMEData types and subtypes in MIME

Page 24: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 24

Table 1 Table 1 Data types and subtypes in MIME (Continued)Data types and subtypes in MIME (Continued)

Page 25: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 25

Table 2 Table 2 Content-transfer-encodingContent-transfer-encoding

Page 26: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 26

Figure 11 Base64

Page 27: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 27

Table 3 Table 3 Base64 encoding tableBase64 encoding table

Page 28: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 28

Figure 12 Quoted-printable

Page 29: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 29

3 MESSAGE TRANSFER AGENT: SMTP

The actual mail transfer requires message transfer agents (MTAs). The The actual mail transfer requires message transfer agents (MTAs). The protocol that defines the MTA client and server in the Internet is called protocol that defines the MTA client and server in the Internet is called Simple Mail Transfer Protocol (SMTP).Simple Mail Transfer Protocol (SMTP).

The topics discussed in this section include:The topics discussed in this section include:

Commands and Responses Commands and Responses Mail Transfer Phases Mail Transfer Phases

Page 30: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 30

Figure 13 SMTP range

Page 31: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 31

Figure 14 Commands and responses

Page 32: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 32

Figure 15 Command format

Page 33: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 33

Table 4 Table 4 CommandsCommands

Page 34: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 34

Table 5 Table 5 ResponsesResponses

Page 35: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 35

Table 20.5 Table 20.5 Responses (Continued)Responses (Continued)

Page 36: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 36

Figure 20.16 Connection establishment

Page 37: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 37

Figure 17 Message transfer

Page 38: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 38

Figure 18 Connection termination

Page 39: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 39

4 MESSAGE ACCESS AGENT: POP AND IMAP

The third stage of mail delivery uses a message access agent; the client The third stage of mail delivery uses a message access agent; the client must pull messages from the server. Currently two message access must pull messages from the server. Currently two message access protocols are available: Post Office Protocol, version 3 (POP3) and protocols are available: Post Office Protocol, version 3 (POP3) and Internet Mail Access Protocol, version 4.Internet Mail Access Protocol, version 4.

The topics discussed in this section include:The topics discussed in this section include:

POP3 POP3 IMAP4 IMAP4

Page 40: Smtp POP3 IMAP protocol notes

All Messages

POP3:

IMAP:Dr.Amer

Friends

….headers

Whole message

POP vs. IMAP

Internet

Internet

Page 41: Smtp POP3 IMAP protocol notes

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

Page 42: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 42

Figure 19 POP3 and IMAP4

Page 43: Smtp POP3 IMAP protocol notes

TCP/IP Protocol Suite 43

Figure 20 POP3