Skip to main content

Optional POP3 Commands

The POP3 commands discussed above must be supported by all minimal implementations of POP3 servers.

The optional POP3 commands described below permit a POP3 client greater freedom in message handling, while preserving a simple POP3 server implementation.

NOTE: This memo STRONGLY encourages implementations to support these commands in lieu of developing augmented drop and scan listings. In short, the philosophy of this memo is to put intelligence in the part of the POP3 client and not the POP3 server.

TOP Command​

Format: TOP msg n

Arguments: a message-id (required) and a number. This message-id may NOT refer to a message marked as deleted.

Restrictions: may only be given in the TRANSACTION state.

Discussion:

If the POP3 server issues a positive response, then the response given is multi-line. After the initial +OK, the POP3 server sends the headers of the message, the blank line separating the headers from the body, and then the number of lines indicated message's body, being careful to byte-stuff the termination character (as with all multi-line responses).

Note that if the number of lines requested by the POP3 client is greater than than the number of lines in the body, then the POP3 server sends the entire message.

Possible Responses:

  • +OK top of message follows
  • -ERR no such message

Examples:

C:    TOP 10
S: +OK
S: <the POP3 server sends the headers of the message, a blank line, and the first 10 lines of the body of the message>
S: .
...
C: TOP 100
S: -ERR no such message

RPOP Command​

Format: RPOP user

Arguments: a client specific user-id (required)

Restrictions: may only be given in the AUTHORIZATION state after a successful USER command; in addition, may only be given if the client used a reserved (privileged) TCP port to connect to the server.

Discussion:

The RPOP command may be used instead of the PASS command to authenticate access to the maildrop. In order for this command to be successful, the POP3 client must use a reserved TCP port (port < 1024) to connect tothe server. The POP3 server uses the argument pair from the USER and RPOP commands to determine if the client should be given access to the appropriate maildrop. Unlike the PASS command however, the POP3 server considers if the remote user specified by the RPOP command who resides on the POP3 client host is allowed to access the maildrop for the user specified by the USER command (e.g., on Berkeley UNIX, the .rhosts mechanism is used). With the exception of this differing in authentication, this command is identical to the PASS command.

Note that the use of this feature has allowed much wider penetration into numerous hosts on local networks (and sometimes remote networks) by those who gain illegal access to computers by guessing passwords or otherwise breaking into the system.

Possible Responses:

  • +OK maildrop locked and ready
  • -ERR permission denied

Examples:

C:    USER mrose
S: +OK mrose is a real hoopy frood
C: RPOP mrose
S: +OK mrose's maildrop has 2 messages (320 octets)

Command Summary​

Minimal POP3 Commands:
USER name valid in the AUTHORIZATION state
PASS string
QUIT

STAT valid in the TRANSACTION state
LIST [msg]
RETR msg
DELE msg
NOOP
LAST
RSET

QUIT valid in the UPDATE state

Optional POP3 Commands:
RPOP user valid in the AUTHORIZATION state

TOP msg n valid in the TRANSACTION state

POP3 Replies:
+OK
-ERR

Note that with the exception of the STAT command, the reply given by the POP3 server to any command is significant only to "+OK" and "-ERR". Any text occurring after this reply may be ignored by the client.