Tuesday, December 4, 2007

Post Office Protocol

Post Office Protocol version 3 (POP3) is an application layer Internet standard protocol used to retrieve email from a remote server to a local client over a TCP/IP connection. Nearly all individual Internet service provider email accounts are accessed via POP3.
The earlier versions of the POP protocol, POP (informally called POP1) and POP2, have been thoroughly made obsolete by POP3. In contemporary usage, the less precise term POP almost always means POP3 in the context of email protocols.
POP3 and its predecessors are designed to allow end users with intermittent connections such as dial-up connections to retrieve email when connected, and then to view and manipulate the retrieved messages without needing to stay connected. Although most clients have an option to leave mail on server, email clients using POP3 generally connect, retrieve all messages, store them on the user's PC as new messages, delete them from the server, and then disconnect. In contrast, the newer, more capable IMAP email retrieval protocol supports both connected and disconnected modes of operation. Email clients using IMAP generally leave messages on the server until the user explicitly deletes them. This and other facets of IMAP operation allow multiple clients to access the same mailbox. Most email clients can be configured to use either POP3 or IMAP to retrieve messages; however, ISP support for IMAP is not as common.
UIDL (Unique IDentification Listing) is a POP3 command typically used in the implementation of a client leave mail on server option. POP3 commands identify specific messages by their ordinal number on the mail server. This creates a problem for a client intending to leave messages on the server, since these message numbers may change from one connection to the server to another. For example if there were five messages when last connected and message #3 is deleted by a different client, when next connecting the last two messages' numbers decrement by one! Luckily, the POP3 RFC specifies a method of avoiding numbering issues. Basically, the server assigns an arbitrary and unique string of characters in the range 0x21 to 0x7E to the message. This ID is never reused for any message. When a POP3-compatible email client connects to the server, it can use the UIDL command to get the current mapping from these message IDs to the ordinal message numbers. Using this mapping the client can then determine which messages it has yet to download, which saves time when downloading.
Whether using POP3 or IMAP to retrieve messages, clients use the SMTP protocol to send messages. Email clients are sometimes referred to as either POP or IMAP clients, but in both cases SMTP is also used.
Email attachments and non-ASCII text are nearly universally conveyed in email in accordance with MIME formatting rules. Neither POP3 nor SMTP require email to be MIME formatted, but since essentially all internet email is MIME formatted POP clients by default must also understand and use MIME. IMAP is designed to assume email is MIME formatted.
Like many other older Internet protocols, POP3 originally supported only an unencrypted login mechanism. Although plain text transmission of passwords in POP3 is still common, POP3 currently supports several authentication methods to provide varying levels of protection against illegitimate access to a user's email. One such method (defined in the base specification as an optional command) is APOP, which uses MD5 in an attempt to avoid replay attacks and disclosure of a shared secret; clients implementing APOP include Mozilla, Thunderbird, Eudora, and Novell Evolution. POP3 can also support IMAP authentication methods via the AUTH extension.
It is also possible to encrypt POP3 traffic using SSL.
POP3 works over a TCP/IP connection using network port 110.

No comments: