The Post Office Protocol, version 3 (POP-3) is used to pick up E-Mail across a network.
Not all computer systems that use E-Mail are connected to the Internet 24 hours a day, 7
days a week. Some users dial into a service provider on an as needed basis, and others may
be connected to a LAN with a permanent connection but may not always be powered on. Other
systems may simply not have the available resources to run a full E-Mail server, might be
shielded from direct connection to the Internet by a firewall security system, or it may be
against the organization policy to have mail delivered directly to user systems. In cases
such as these the E-Mail addressed to the users on these systems is sent to a central
E-Mail Post Office system where it is held for the user until they can pick it up. POP-3
allows a user to log onto an E-Mail post office system across the network, validates the
user by ID and password, allows mail to be downloaded, and optionally allows the user to
delete the mail from the server.
POP-3 is defined in RFC 1939. Under TCP/IP the POP-3 protocol is implemented as an application layer protocol that uses Transmission Control Protocol (TCP) to establish a reliable connection between two systems. TCP uses a pair of ports numbers, one for source and one for destination, to identify each communications link. By default a POP-3 client application will contact the remote server using TCP/IP application port number 110 as the destination port, and will select at random a port from the dynamic or private range for the source port number. The remote server will normally respond by contacting the client system using the private port number as the destination and port number 110 as the source.
Commands in POP-3 are a single keyword, possibly followed by one or more arguments. Keywords and arguments consist of text characters. Keywords and arguments are each separated by a single SPACE character. Keywords are three or four characters long. Each argument may be up to 40 characters long.
Responses in POP-3 consist of a status indicator and a keyword, possibly followed by additional information. Responses may be up to 512 characters long. There are two status indicators: positive ("+OK") and negative ("-ERR"). Servers send the "+OK" and "-ERR" messages in upper case only.
Responses to certain commands are multi-line. In these cases, after sending the first line of the response, any additional lines are sent. When all lines of the response have been sent, a final line is sent, consisting of a period character ("."). If any line of the multi-line response begins with a period, an additional period is added at the start of the line to prevent it from being confused with the termination sequence. This extra period is to be stripped by the client program at the user end and is thus transparent to the user.
In a typical POP-3 conversation, the user application connects to the post office server and logs on with a USER and PASS command. The user then issues a STAT command and the server responds with a message telling how many E-Mail messages are waiting. The user application then uses the RETR and DELE commands to retrieve each message from the server and, if successfully retrieved, to delete the message from the server. Then the user application issues a QUIT command to log off of the server. The user then is free to read the messages while “off-line”, not connected to the E-Mail post office server.
The standard POP-3 commands are:
- USER (User Name)
- This is usually the first command transmitted after a link is established. The argument
identifies the identity of the E-Mail Post Office user for access to the post office server
system. The syntax of the USER command is:
USER (username)
- PASS (Password)
- This command must follow immediately after a USER command and the argument completes the
identification procedure. The syntax of the PASS command is:
PASS (Password)
- STAT (Status)
- This command requests the status of the user’s post office box. The server will respond
with a message telling how many e-mail messages are in the user’s mail box. The response
message has a rigid format, it is "+OK mm bb" where "mm" is the number of messages and "bb"
is the total number of bytes of storage taken by the messages.
- LIST (Message)
- The message argument is optional. If it is not given, the server will respond with a list
of the messages in the user’s mail box. The list numbers each message in the box,
beginning with one and incrementing by one for each message. The list also gives the
number of bytes in each message. If the message parameter is given, it is the number of a
message in the user’s mail box on the server. The response is one line describing the
message number and number of bytes for that message. The syntax of the LIST command is:
LIST [Message]
The following is an example of two LIST commands and the possible output:
LIST
+OK 2 messages (320 octets)
1 120
2 200
.
LIST 200
+OK 2 200
- RETR (Retreive)
- This command instructs the server to send a message from the user’s post office box. The
argument is the number of the message to be sent. The syntax of the RETR command is:
RETR (Message)
- DELE (Delete)
- This command instructs the server to mark a message in the user’s post office box as
deleted. The argument is the number of the message to be deleted. The syntax of the DELE
command is:
DELE (Message)
- NOOP (No Operation)
- This command instructs the server to take no action other than to respond with a “+OK”
reply message.
- RSET (Reset)
- This command instructs the server to Reset the transactions. If any messages are currently
marked for deletion, but have not yet been deleted, the delete flag on those messages is
cleared.
- QUIT (Quit)
- This command instructs the server to delete any messages that are currently flagged for
deletion, then send an "+OK" reply and close the communication link. If the POP-3 E-Mail
Post Office server does not receive a QUIT command, any messages marked for deletion will
not be deleted.
- TOP (List Top of Message)
- This command instructs the server to open a selected message, send the header information
(identifying the sender, the message topic, and possibly other information), and the first
few lines of the message. The purpose of this line is to allow a user to preview a large
message without having to retrieve the entire message. The first argument (Message)
identifies the message by number. The second argument (Lines) tells how many lines from
the beginning of the message to send. The syntax of the TOP command is:
TOP (Message) (Lines)
- UIDL (Unique Identifier List)
- This command instructs the server to reply with a unique identifier for messages in the
user’s mail box. The argument is optional. If it is not present, then the server will
send a multi-line list with a unique ID for each message in the user’s mail box. If the
argument is present, it identifies a specific message by number, and the response gives the
unique message ID for that message. The form of the unique ID is server dependent. The
only requirement is that it be unique and persistent. This means that for the life of the
user ID on that server, it will not generate the same value for more than one message. It
also means that the unique ID for a given message will persist from POP-3 session to
session. If the user disconnects, then reconnects at a later time, a given message will
have the same unique ID (this is not necessarily true of numeric message ID numbers). The
syntax of the UIDL command is:
UIDL [Message]
- APOP (Authenticate Post Office Protocol)
- The APOP command can be used instead of the USER and PASS commands to identify and validate
a user. When a user first connects to a POP-3 server, the server responds with a single
line greeting message. If the APOP command is supported by a server, there will be
specific information in the greeting message. A client that supports the APOP command
combines this information with the user password to generate a unique code. The user name
and this code are transmitted to the server as the arguments of the APOP command so that
the password for a user is not transmitted across the network in clear text. The syntax of
the APOP command is:
APOP (Name) (Code)
If a user does not have a POP-3 client application, or for the purposes of testing and
troubleshooting, it is possible to use a Telnet client application to contact a POP-3
server and retrieve E-Mail messages. This is done by Telnetting to port 110 and entering
the commands by hand.
|