SDSU CS 580 Client-Server
Spring Semester, 2004
POP
Previous    Lecture Notes Index    Next    
© 2004, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 11-Mar-04


Reference

Reference RFC 1939, http://www.ietf.org/rfc/rfc1939.txt

CS 580, Spring 1997 lecture notes, http://www.eli.sdsu.edu/courses/spring97/cs596/notes/protocol/protocol.html


Doc 19, POP Slide # 2

POP3 Protocol


Purpose: Allow PC's, Macs, etc. to download mail from server

Port number 110

Protocol uses ASCII only


Doc 19, POP Slide # 3

Command Format

Format of commands to server

keyword blank argument 1 [ blank argument k ] CRLF
| keyword | = 3, 4 characters

| argument | <= 40 characters

keyword and arguments are separated by single space character
Server Response
Status keyword additionalInfo

Status is either "+OK" or "-ERR0.3."

A single line response ends in CRLF

If response requires more than one line:


Doc 19, POP Slide # 4
Timeouts

A POP3 server may have an autologout timer

A server must wait at least 10 minutes before timing out a client

The POP3 server on cs.sdsu.edu times out in 2 minutes




Doc 19, POP Slide # 5

States


AUTHORIZATION

Must log in with password before entering transaction state


TRANSACTION

Client can request actions of server, get mail for example


UPDATE

Updates mail box to reflect actions taken in transaction state



Doc 19, POP Slide # 6

Commands

AUTHORIZATION

Server acknowledges connection from client with

   +OK  "message"
   +OK UCB Pop server (version 2.1.2-R3) at sciences.sdsu.edu starting.

Commands: USER, PASS, APOP, QUIT



Doc 19, POP Slide # 7
USER PASS

Combination is used to progress to transaction state

USER must come first
PASS or QUIT must come after USER

Example
Ti 38-> telnet cs.sdsu.edu 110
Trying 130.191.226.116...
Connected to cs.sdsu.edu.
Escape character is '^]'.
+OK QPOP (version 3.1.2) at sciences.sdsu.edu starting.
USER whitney
+OK Password required for whitney.
PASS typeYourPasswordHere
+OK whitney has 116 visible messages (0 hidden) in 640516 octets.


Doc 19, POP Slide # 8
TRANSACTION

Commands: STAT, LIST, RETR, RSET, QUIT

STAT

Arguments: none

Returns "+OK" numberOfMessages SizeOfMail

Example

STAT
+OK 22 45595


LIST

Arguments: a message-number ( optional )

Returns: size of message in octets

Examples:

LIST 2
+OK 2 3064

LIST
+OK 116 visible messages (640516 octets)
1 2980
2 3064 ( message 3 - 116 deleted to save space )
116 1290
.

Doc 19, POP Slide # 9
RETR

Arguments: a message-number

Returns: the message

Example:

RETR 21
+OK 825 octets
Received: from [130.191.9.18] (ebb2p9.sdsu.edu [130.191.9.18]) by sciences.sdsu.edu
(4.1/8.6.10) with SMTP id UAA29486 for <whitney@saturn.sdsu.edu>; Mon, 11 Mar
1996 20:16:07 -0800 (PST)
X-Sender: whitney@cs.sdsu.edu (Unverified)
Message-Id: <v02110100ad6aaaf097b6@[130.191.9.70]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Mon, 11 Mar 1996 20:16:50 -0800
To: whitney@saturn.sdsu.edu
From: whitney@saturn.sdsu.edu (Roger Whitney)
Subject: Sample Mail
X-UIDL: 826604201.000

this is a test
..
the end
---
Roger Whitney Math & Computer Science Dept.
whitney@cs.sdsu.edu San Diego State University
http://www.eli.sdsu.edu San Diego, CA 92182-7720
(619) 594-3535
(619) 594-6746 (fax)

.

Doc 19, POP Slide # 10
DELE

Arguments: a message-number to delete

Returns: a confirmation of deletion

Marks a message to be deleted


NOOP

Arguments: none

Returns: a positive response

Does nothing


QUIT

Arguments: none

Returns: a positive response

Send POP3 server to UPDATE state


UPDATE State

Updates mail box to reflect transactions taken during the transaction state, then logs user out

If session ends by any method except the QUIT command during the transaction state, the update state is not entered

Doc 19, POP Slide # 11

Optional POP3 Commands

TOP

Arguments: a message-number and number of lines to return

Returns: Requested lines of indicated message

State allowed in: transaction

UIDL

Arguments: a message-number ( optional )

Returns: a unique-id listing for message

State allowed in: transaction

Examples:
UIDL 1
+OK 1 826312760.001

UIDL
+OK uidl command accepted.
1 826312760.001
2 826312760.006
3 826493796.004
etc.
.


Doc 19, POP Slide # 12
APOP

Arguments: a mailbox and a MD5 digest string


State allowed in: authorization

Action: If MD5 string is correct move to transaction state




Copyright ©, All rights reserved.
2004 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

Previous    visitors since 11-Mar-04    Next