Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

19
Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin

Transcript of Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Page 1: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

E-Mail

Bob BradleyThe University of Tennessee at Martin

Page 2: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

E-Mail Info

Created by Bob Bradley at The University of Tennessee at MartinIf you are viewing this slide from BlackBoard, right click the slide and choose “Full Screen” mode.Then use your left mouse button to advance thru the slide show.

Page 3: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

Typical Email Flow Sender’s

Computer

Sender’s Mail Server

Recipient’s Mail Server

Recipient’s Computer

1) Sender composes email using a mail client such as Outlook 2) The mail client opens a

connection to the user’s mail server sends the message to it using SMTP

SMTP

3) The user’s mail server sends the message (over the internet) to the recipient’s mail server using SMTP.

SMTP

4) The recipient’s mail client checks for new mail by opening up a POP or IMAP connection to it’s mail server, it finds a new message and downloads it using the POP protocol

POP

Page 4: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

SMTP(Simple Mail Transfer Protocol)

The Simple Mail Transfer Protocol (SMTP) provides a method to exchange electronic mail messages.It is currently the standard by which email is exchanged on the Internet.RFC 821 and updatesAn SMTP client wishing to exchange mail with an SMTP server contacts the server on the well-known service port (25).

Page 5: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

SMTP Commands

The protocol is a simple ASCII, line-oriented command/response protocol.Responses consist of a three-digit numeric code followed by a string explaining the response.After contacting the server, the client waits for a simple greeting message and then sends a HELO command identifying itself.

Page 6: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

Table of SMTP CommandsHELO domain Used to inform the server of the client’s identity.

MAIL FROM: <saddr> Used to initiate a message transfer and gives the sender email address.

RCPT TO: <taddr> Follows MAIL command and specifies one of the message addresses. Multiple RCPT commands can be given to send to multiple addresses.

DATA The client sends DATA before sending the message line by line. When all the message data has

been sent, the client sends a single line consisting of a single period.

HELP Used by humans to get a list of commands.

QUIT Tells the server that the client is ending the session.

Page 7: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

SMTP Using the commands

A client uses the MAIL, RCPT and DATA commands to send an email messageA client can send multiple messages to a server, once it has established a connection.After it has sent the last message, it uses the QUIT command.

Page 8: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

SMTP Establishing a connection

SMTP Client connects to port 25 of the ServerSMTP Client connects to port 25 of the Server

• 220 utm.edu ESMTP Sendmail 8.9.3+Sun/8.9.3; Wed, 19 Jun 2002 11:42:59 -0500 (CDT)

SMTP Server accepts the connection and sends greetingSMTP Server accepts the connection and sends greeting

Client sends HELOClient sends HELO

Server says it’s OKServer says it’s OK

HELO mail.north.pole

250 utm.edu Hello sun1 [208.47.4.212], pleased to meet you

Page 9: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

The client has a message to send from [email protected] to bbradleyThe client has a message to send from [email protected] to bbradley

MAIL FROM: <[email protected]>

250 <[email protected]>... Sender ok

RCPT TO: <[email protected]>

250 <[email protected]>... Recipient ok

DATA

354 Enter mail, end with "." on a line by itself

From: Santa Claws <[email protected]>To: Mr. Bob <[email protected]>Subject: Christmas

Hi Bob,Have you been a good boy this year?Santa

.

250 LAA05830 Message accepted for delivery

QUIT

221 utm.edu closing connection

SMTP Sending A Message

Message sent by client

Message sent by client

Client sends this period to tell the server that it is the end of the message

Client sends this period to tell the server that it is the end of the message

Message HeaderMessage Header

Message BodyMessage Body

Client uses the MAIL, RCPT and DATA cmds

Client uses the MAIL, RCPT and DATA cmds

Server responds to each.

Server responds to each.

If this is the last message to send, the client logs off

If this is the last message to send, the client logs off

Page 10: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

POP3(Post Office Protocol, Version 3)

RFC 1725The Post Office Protocol (POP3) allows a client to retrieve mail from a remote server mailbox. This protocol is commonly used by personal computers to retrieve mail from a permanent SMTP host.POP3 is used for downloading only.The POP3 server listens on well-known TCP port 110

Page 11: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

POP3 Commands

POP3 commands consist of short keywords, followed by optional parameters sent as a single line of text, followed by <CRLF>.The basic POP3 success and failure codes are “+OK” and “-ERR”.Multi-line POP3 responses consist of a single-line response followed by additional lines, terminated with a line containing a single period <CRLF>.

Page 12: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

Table of POP3 CommandsUSER name Indicates the mail box namePASS string Indicates the user password

RETR msg Requests the server to send the client the full message msg.

QUIT Quits the session. Server deletes marked messages.

STAT Requests the server to return the number of messages in the mail box and the size of the mail box in octets.LIST [msg] Requests the server to return info about the size of a given message or all messagesDELE msg Requests the server to delete the message msg.RSET Request the server to reset all deletion indicators

APOP name dig Optional secure login command.

TOP msg n Requests the server to return the first n lines of message msg.

Page 13: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

Pop LoginPOP Client connects to port 110 of the ServerPOP Client connects to port 110 of the Server

S: +OK QPOP (version 3.0.2) at mars starting.

POP Server accepts the connection and sends greeting

POP Server accepts the connection and sends greeting

Client sends usernameClient sends username

Server says it’s OKServer says it’s OK

Client sends passwordClient sends password

Server says it’s OK and list number of messages and size of mailboxServer says it’s OK and list number of messages and size of mailbox

C: pass ABC123

S: +OK bobb has 24 visible messages (0 hidden) in 551904 octets.

C: user bobb

S: +OK Password required for bobb.

Page 14: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

retr 24 The client asks for message 24 to be returned to itThe client asks for message 24 to be returned to it

The server responds that the command was received ok, then it sends the text of the message.

The server responds that the command was received ok, then it sends the text of the message.

This period marks the end of the message.This period marks the end of the message.

This blank line separates the message header from the body.This blank line separates the message header from the body.

+OK 689 octetsReceived: from utm.edu (sun1 [208.47.4.212]) by mars.utm.edu (8.9.3+Sun/8.9.3) with ESMTP id NAA21532 for <[email protected]>; Mon, 17 Jun 2002 13:22:57 -0500 (CDT)Received: from localhost (bbradley@localhost) by utm.edu (8.9.3+Sun/8.9.3) with ESMTP id NAA01829 for <[email protected]>; Mon, 17 Jun 2002 13:22:56 -0500 (CDT)Date: Mon, 17 Jun 2002 13:22:56 -0500 (CDT)From: Bob Bradley <[email protected]>X-Sender: bbradley@sun1To: [email protected]: test messageMessage-ID: <Pine.GSO.4.10.10206171322400.1787-100000@sun1>MIME-Version: 1.0Content-Type: TEXT/PLAIN; charset=US-ASCIIX-UIDL: 4Y1"!%_O"!G3\"!A<?!!

Hi,

This is a test message.

Bye

.

Pop Downloading

HeaderHeader

BodyBody

Page 15: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

IMAP4(Internet Message Access Protocol)

RFC 1730, RFC 1731IMAP allows a client to access and manipulate email messages stored on a remote server.Using IMAP, a client can move mail to and from the server, create remote message folders, and move messages between folders.The IMAP4 server listens for connections on well-known TCP port 143.

Page 16: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

IMAP4Continued

IMAP includes the basic functionality of POP3, allowing users to retrieve mail, and adds further sophisticated filing, searching, and parsing functionality.The IMAP4 protocol is much more complicated than the simple POP3 protocol.

Page 17: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

Summary of Mail ProtocolsUsed to Send Mail

Used to Receive Mail

Requires Login & Password

Simple Protocol

Port

SMTP Y Y N Y 25

POP3 N Y Y Y 110

IMAP4 N Y Y N 143

Page 18: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

RFCs for Mail Protocols

SMTP (RFC 821)POP (RFC 1725)IMAP (RFC 1730)

Page 19: Intro to Computer Networks E-Mail Bob Bradley The University of Tennessee at Martin.

Intro to Computer Networks

LinksYou can use the links below to connect to and “talk” to

a mail server by simply clicking on them. Note that depending on your system, you may not be able to see the commands you type, but you will be able to see the server’s responses.

Connect to an SMTP Servertelnet://mail.utm.edu:25 Connect to a POP servertelnet://mail.utm.edu:110

For better results, log into your mars account and type the following commands:telnet mars.utm.edu 25telnet mars.utm.edu 110