POP Commands

POP clients initiate every POP session. POP servers just wait for clients to connect. POP clients issue all of the POP commands, and servers respond to those commands.

POP commands are case insensitive, although server responses are not.

When a client connects to a server, the server responds with a banner greeting. It looks like this:

Client: (Initiates socket connection)
Server: +OK POP server ready

The first thing that a client must do upon connecting is to provide authentication for a particular user. That way, the server knows that it is safe to allow access to a given mailbox. This is known as the Authorization State. Commands that deal with user authentication are only valid in this state. The client can’t do anything in this state except log in or quit. User authentication commands and examples are shown in the section “The Authorization State,” later in this chapter.

Once a user is authenticated, the mailbox may be manipulated. This is known as the Transaction State. Commands that deal with a mailbox are only valid in this state, such as reading messages or moving them to other mailboxes. These commands and examples are shown in the section “The Transaction State,” later in this chapter.

Once the client has issued a QUIT command (which tells the server that the client is finished with the session), a server enters the very brief Update State if any messages have been marked for deletion. At this time, any messages that were marked for deletion in the Transaction ...

Get Programming Internet Email now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.