The IMAP Protocol:
Internet Message Access Protocol (IMAP) is an alternative to POP. It provides the same basic service as POP, and adds features to support mailbox synchronization. Mailbox synchronization is the ability to read individual mail messages on a client or directly on the server while keeping the mailbox on both systems completely up-to-date.
On an average POP server, the entire contents of the mailbox are moved to the client, and either deleted from the server or retained as if never read. Deletion of individual messages on the client is not reflected on the server because all of the messages are treated as a single unit that is either deleted or retained after the initial transfer of data to the client. IMAP provides the ability to manipulate individual messages on the client or the server, and to have those changes reflected in the mailboxes of both systems.
Like the POP protocol, IMAP is also a request/response protocol with a small set of commands. The table below lists the basic set of IMAP commands from version 4 of the IMAP protocol.
Command | Use |
CAPABILITY | Lists the features supported by the server. |
NOOP | Literally means "No Operation," but sometimes used as a way to poll for new messages or message status updates. |
LOGOUT | Closes the connection. |
AUTHENTICATE | Requests an alternative authentication method. |
LOGIN | Opens the connection, and provides the username and password for plain-text authentication. |
SELECT | Opens a mailbox. |
EXAMINE | Opens a mailbox as read-only. |
CREATE | Creates a new mailbox. |
DELETE | Removes a mailbox. |
RENAME | Changes the name of a mailbox. |
SUBSCRIBE | Adds a mailbox to the list of active mailboxes. |
UNSUBSCRIBE | Deletes a mailbox name from the list of active mailboxes. |
LIST | Displays the requested mailbox names from the complete set of all available mailboxes. |
LSUB | Displays the requested mailbox names from the set of active mailboxes. |
STATUS | Requests the status of a mailbox. |
APPEND | Adds a message to the end of the specified mailbox. |
CHECK | Forces a checkpoint of the current mailbox. |
CLOSE | Closes the mailbox, and removes all messages marked for deletion. |
EXPUNGE | Removes from the current mailbox all messages that are marked for deletion. |
SEARCH | Displays all messages in the mailbox that match the specified search criteria. |
FETCH | Retrieves a message from the mailbox. |
STORE | Modifies a message in the mailbox. |
COPY | Copies the specified messages to the end of the selected mailbox. |
UID | Searches for or fetches messages based on the message's unique identifier. |