阿凡提物流收费:RFC:1939 - Post Office Protocol - Version 3

来源:百度文库 编辑:九乡新闻网 时间:2024/04/20 03:30:25

Network Working Group J. MyersRequest for Comments: 1939 Carnegie MellonSTD: 53 M. RoseObsoletes: 1725 Dover Beach Consulting, Inc.Category: Standards Track May 1996Post Office Protocol - Version 3Status of this MemoThis document specifies an Internet standards track protocol for theInternet community, and requests discussion and suggestions forimprovements. Please refer to the current edition of the "InternetOfficial Protocol Standards" (STD 1) for the standardization stateand status of this protocol. Distribution of this memo is unlimited.Table of Contents1. Introduction ................................................ 22. A Short Digression .......................................... 23. Basic Operation ............................................. 34. The AUTHORIZATION State ..................................... 4QUIT Command ................................................ 55. The TRANSACTION State ....................................... 5STAT Command ................................................ 6LIST Command ................................................ 6RETR Command ................................................ 8DELE Command ................................................ 8NOOP Command ................................................ 9RSET Command ................................................ 96. The UPDATE State ............................................ 10QUIT Command ................................................ 107. Optional POP3 Commands ...................................... 11TOP Command ................................................. 11UIDL Command ................................................ 12USER Command ................................................ 13PASS Command ................................................ 14APOP Command ................................................ 158. Scaling and Operational Considerations ...................... 169. POP3 Command Summary ........................................ 1810. Example POP3 Session ....................................... 1911. Message Format ............................................. 1912. References ................................................. 2013. Security Considerations .................................... 2014. Acknowledgements ........................................... 2015. Authors' Addresses ......................................... 21Appendix A. Differences from RFC 1725 .......................... 22Myers & Rose Standards Track [Page 1]RFC 1939 POP3 May 1996Appendix B. Command Index ...................................... 231. IntroductionOn certain types of smaller nodes in the Internet it is oftenimpractical to maintain a message transport system (MTS). Forexample, a workstation may not have sufficient resources (cycles,disk space) in order to permit a SMTP server [RFC821] and associatedlocal mail delivery system to be kept resident and continuouslyrunning. Similarly, it may be expensive (or impossible) to keep apersonal computer interconnected to an IP-style network for longamounts of time (the node is lacking the resource known as"connectivity").Despite this, it is often very useful to be able to manage mail onthese smaller nodes, and they often support a user agent (UA) to aidthe tasks of mail handling. To solve this problem, a node which cansupport an MTS entity offers a maildrop service to these less endowednodes. The Post Office Protocol - Version 3 (POP3) is intended topermit a workstation to dynamically access a maildrop on a serverhost in a useful fashion. Usually, this means that the POP3 protocolis used to allow a workstation to retrieve mail that the server isholding for it.POP3 is not intended to provide extensive manipulation operations ofmail on the server; normally, mail is downloaded and then deleted. Amore advanced (and complex) protocol, IMAP4, is discussed in[RFC1730].For the remainder of this memo, the term "client host" refers to ahost making use of the POP3 service, while the term "server host"refers to a host which offers the POP3 service.2. A Short DigressionThis memo does not specify how a client host enters mail into thetransport system, although a method consistent with the philosophy ofthis memo is presented here:When the user agent on a client host wishes to enter a messageinto the transport system, it establishes an SMTP connection toits relay host and sends all mail to it. This relay host couldbe, but need not be, the POP3 server host for the client host. Ofcourse, the relay host must accept mail for delivery to arbitraryrecipient addresses, that functionality is not required of allSMTP servers.Myers & Rose Standards Track [Page 2]RFC 1939 POP3 May 19963. Basic OperationInitially, the server host starts the POP3 service by listening onTCP port 110. When a client host wishes to make use of the service,it establishes a TCP connection with the server host. When theconnection is established, the POP3 server sends a greeting. Theclient and POP3 server then exchange commands and responses(respectively) until the connection is closed or aborted.Commands in the POP3 consist of a case-insensitive keyword, possiblyfollowed by one or more arguments. All commands are terminated by aCRLF pair. Keywords and arguments consist of printable ASCIIcharacters. Keywords and arguments are each separated by a singleSPACE character. Keywords are three or four characters long. Eachargument may be up to 40 characters long.Responses in the POP3 consist of a status indicator and a keywordpossibly followed by additional information. All responses areterminated by a CRLF pair. Responses may be up to 512 characterslong, including the terminating CRLF. There are currently two statusindicators: positive ("+OK") and negative ("-ERR"). Servers MUSTsend the "+OK" and "-ERR" in upper case.Responses to certain commands are multi-line. In these cases, whichare clearly indicated below, after sending the first line of theresponse and a CRLF, any additional lines are sent, each terminatedby a CRLF pair. When all lines of the response have been sent, afinal line is sent, consisting of a termination octet (decimal code046, ".") and a CRLF pair. If any line of the multi-line responsebegins with the termination octet, the line is "byte-stuffed" bypre-pending the termination octet to that line of the response.Hence a multi-line response is terminated with the five octets"CRLF.CRLF". When examining a multi-line response, the client checksto see if the line begins with the termination octet. If so and ifoctets other than CRLF follow, the first octet of the line (thetermination octet) is stripped away. If so and if CRLF immediatelyfollows the termination character, then the response from the POPserver is ended and the line containing ".CRLF" is not consideredpart of the multi-line response.A POP3 session progresses through a number of states during itslifetime. Once the TCP connection has been opened and the POP3server has sent the greeting, the session enters the AUTHORIZATIONstate. In this state, the client must identify itself to the POP3server. Once the client has successfully done this, the serveracquires resources associated with the client's maildrop, and thesession enters the TRANSACTION state. In this state, the clientrequests actions on the part of the POP3 server. When the client hasMyers & Rose Standards Track [Page 3]RFC 1939 POP3 May 1996issued the QUIT command, the session enters the UPDATE state. Inthis state, the POP3 server releases any resources acquired duringthe TRANSACTION state and says goodbye. The TCP connection is thenclosed.A server MUST respond to an unrecognized, unimplemented, orsyntactically invalid command by responding with a negative statusindicator. A server MUST respond to a command issued when thesession is in an incorrect state by responding with a negative statusindicator. There is no general method for a client to distinguishbetween a server which does not implement an optional command and aserver which is unwilling or unable to process the command.A POP3 server MAY have an inactivity autologout timer. Such a timerMUST be of at least 10 minutes' duration. The receipt of any commandfrom the client during that interval should suffice to reset theautologout timer. When the timer expires, the session does NOT enterthe UPDATE state--the server should close the TCP connection withoutremoving any messages or sending any response to the client.4. The AUTHORIZATION StateOnce the TCP connection has been opened by a POP3 client, the POP3server issues a one line greeting. This can be any positiveresponse. An example might be:S: +OK POP3 server readyThe POP3 session is now in the AUTHORIZATION state. The client mustnow identify and authenticate itself to the POP3 server. Twopossible mechanisms for doing this are described in this document,the USER and PASS command combination and the APOP command. Bothmechanisms are described later in this document. Additionalauthentication mechanisms are described in [RFC1734]. While there isno single authentication mechanism that is required of all POP3servers, a POP3 server must of course support at least oneauthentication mechanism.Once the POP3 server has determined through the use of anyauthentication command that the client should be given access to theappropriate maildrop, the POP3 server then acquires an exclusive-access lock on the maildrop, as necessary to prevent messages frombeing modified or removed before the session enters the UPDATE state.If the lock is successfully acquired, the POP3 server responds with apositive status indicator. The POP3 session now enters theTRANSACTION state, with no messages marked as deleted. If themaildrop cannot be opened for some reason (for example, a lock cannot be acquired, the client is denied access to the appropriateMyers & Rose Standards Track [Page 4]RFC 1939 POP3 May 1996maildrop, or the maildrop cannot be parsed), the POP3 server respondswith a negative status indicator. (If a lock was acquired but thePOP3 server intends to respond with a negative status indicator, thePOP3 server must release the lock prior to rejecting the command.)After returning a negative status indicator, the server may close theconnection. If the server does not close the connection, the clientmay either issue a new authentication command and start again, or theclient may issue the QUIT command.After the POP3 server has opened the maildrop, it assigns a message-number to each message, and notes the size of each message in octets.The first message in the maildrop is assigned a message-number of"1", the second is assigned "2", and so on, so that the nth messagein a maildrop is assigned a message-number of "n". In POP3 commandsand responses, all message-numbers and message sizes are expressed inbase-10 (i.e., decimal).Here is the summary for the QUIT command when used in theAUTHORIZATION state:QUITArguments: noneRestrictions: nonePossible Responses:+OKExamples:C: QUITS: +OK dewey POP3 server signing off5. The TRANSACTION StateOnce the client has successfully identified itself to the POP3 serverand the POP3 server has locked and opened the appropriate maildrop,the POP3 session is now in the TRANSACTION state. The client may nowissue any of the following POP3 commands repeatedly. After eachcommand, the POP3 server issues a response. Eventually, the clientissues the QUIT command and the POP3 session enters the UPDATE state.Myers & Rose Standards Track [Page 5]RFC 1939 POP3 May 1996Here are the POP3 commands valid in the TRANSACTION state:STATArguments: noneRestrictions:may only be given in the TRANSACTION stateDiscussion:The POP3 server issues a positive response with a linecontaining information for the maildrop. This line iscalled a "drop listing" for that maildrop.In order to simplify parsing, all POP3 servers arerequired to use a certain format for drop listings. Thepositive response consists of "+OK" followed by a singlespace, the number of messages in the maildrop, a singlespace, and the size of the maildrop in octets. This memomakes no requirement on what follows the maildrop size.Minimal implementations should just end that line of theresponse with a CRLF pair. More advanced implementationsmay include other information.NOTE: This memo STRONGLY discourages implementationsfrom supplying additional information in the droplisting. Other, optional, facilities are discussedlater on which permit the client to parse the messagesin the maildrop.Note that messages marked as deleted are not counted ineither total.Possible Responses:+OK nn mmExamples:C: STATS: +OK 2 320LIST [msg]Arguments:a message-number (optional), which, if present, may NOTrefer to a message marked as deletedMyers & Rose Standards Track [Page 6]RFC 1939 POP3 May 1996Restrictions:may only be given in the TRANSACTION stateDiscussion:If an argument was given and the POP3 server issues apositive response with a line containing information forthat message. This line is called a "scan listing" forthat message.If no argument was given and the POP3 server issues apositive response, then the response given is multi-line.After the initial +OK, for each message in the maildrop,the POP3 server responds with a line containinginformation for that message. This line is also called a"scan listing" for that message. If there are nomessages in the maildrop, then the POP3 server respondswith no scan listings--it issues a positive responsefollowed by a line containing a termination octet and aCRLF pair.In order to simplify parsing, all POP3 servers arerequired to use a certain format for scan listings. Ascan listing consists of the message-number of themessage, followed by a single space and the exact size ofthe message in octets. Methods for calculating the exactsize of the message are described in the "Message Format"section below. This memo makes no requirement on whatfollows the message size in the scan listing. Minimalimplementations should just end that line of the responsewith a CRLF pair. More advanced implementations mayinclude other information, as parsed from the message.NOTE: This memo STRONGLY discourages implementationsfrom supplying additional information in the scanlisting. Other, optional, facilities are discussedlater on which permit the client to parse the messagesin the maildrop.Note that messages marked as deleted are not listed.Possible Responses:+OK scan listing follows-ERR no such messageExamples:C: LISTS: +OK 2 messages (320 octets)S: 1 120Myers & Rose Standards Track [Page 7]RFC 1939 POP3 May 1996S: 2 200S: ....C: LIST 2S: +OK 2 200...C: LIST 3S: -ERR no such message, only 2 messages in maildropRETR msgArguments:a message-number (required) which may NOT refer to amessage marked as deletedRestrictions:may only be given in the TRANSACTION stateDiscussion:If the POP3 server issues a positive response, then theresponse given is multi-line. After the initial +OK, thePOP3 server sends the message corresponding to the givenmessage-number, being careful to byte-stuff the terminationcharacter (as with all multi-line responses).Possible Responses:+OK message follows-ERR no such messageExamples:C: RETR 1S: +OK 120 octetsS: S: .DELE msgArguments:a message-number (required) which may NOT refer to amessage marked as deletedRestrictions:may only be given in the TRANSACTION stateMyers & Rose Standards Track [Page 8]RFC 1939 POP3 May 1996Discussion:The POP3 server marks the message as deleted. Any futurereference to the message-number associated with the messagein a POP3 command generates an error. The POP3 server doesnot actually delete the message until the POP3 sessionenters the UPDATE state.Possible Responses:+OK message deleted-ERR no such messageExamples:C: DELE 1S: +OK message 1 deleted...C: DELE 2S: -ERR message 2 already deletedNOOPArguments: noneRestrictions:may only be given in the TRANSACTION stateDiscussion:The POP3 server does nothing, it merely replies with apositive response.Possible Responses:+OKExamples:C: NOOPS: +OKRSETArguments: noneRestrictions:may only be given in the TRANSACTION stateDiscussion:If any messages have been marked as deleted by the POP3server, they are unmarked. The POP3 server then repliesMyers & Rose Standards Track [Page 9]RFC 1939 POP3 May 1996with a positive response.Possible Responses:+OKExamples:C: RSETS: +OK maildrop has 2 messages (320 octets)6. The UPDATE StateWhen the client issues the QUIT command from the TRANSACTION state,the POP3 session enters the UPDATE state. (Note that if the clientissues the QUIT command from the AUTHORIZATION state, the POP3session terminates but does NOT enter the UPDATE state.)If a session terminates for some reason other than a client-issuedQUIT command, the POP3 session does NOT enter the UPDATE state andMUST not remove any messages from the maildrop.QUITArguments: noneRestrictions: noneDiscussion:The POP3 server removes all messages marked as deletedfrom the maildrop and replies as to the status of thisoperation. If there is an error, such as a resourceshortage, encountered while removing messages, themaildrop may result in having some or none of the messagesmarked as deleted be removed. In no case may the serverremove any messages not marked as deleted.Whether the removal was successful or not, the serverthen releases any exclusive-access lock on the maildropand closes the TCP connection.Possible Responses:+OK-ERR some deleted messages not removedExamples:C: QUITS: +OK dewey POP3 server signing off (maildrop empty)...C: QUITMyers & Rose Standards Track [Page 10]RFC 1939 POP3 May 1996S: +OK dewey POP3 server signing off (2 messages left)...7. Optional POP3 CommandsThe POP3 commands discussed above must be supported by all minimalimplementations of POP3 servers.The optional POP3 commands described below permit a POP3 clientgreater freedom in message handling, while preserving a simple POP3server implementation.NOTE: This memo STRONGLY encourages implementations to supportthese commands in lieu of developing augmented drop and scanlistings. In short, the philosophy of this memo is to putintelligence in the part of the POP3 client and not the POP3server.TOP msg nArguments:a message-number (required) which may NOT refer to to amessage marked as deleted, and a non-negative numberof lines (required)Restrictions:may only be given in the TRANSACTION stateDiscussion:If the POP3 server issues a positive response, then theresponse given is multi-line. After the initial +OK, thePOP3 server sends the headers of the message, the blankline separating the headers from the body, and then thenumber of lines of the indicated message's body, beingcareful to byte-stuff the termination character (as withall multi-line responses).Note that if the number of lines requested by the POP3client is greater than than the number of lines in thebody, then the POP3 server sends the entire message.Possible Responses:+OK top of message follows-ERR no such messageExamples:C: TOP 1 10S: +OKMyers & Rose Standards Track [Page 11]RFC 1939 POP3 May 1996S: S: ....C: TOP 100 3S: -ERR no such messageUIDL [msg]Arguments:a message-number (optional), which, if present, may NOTrefer to a message marked as deletedRestrictions:may only be given in the TRANSACTION state.Discussion:If an argument was given and the POP3 server issues a positiveresponse with a line containing information for that message.This line is called a "unique-id listing" for that message.If no argument was given and the POP3 server issues a positiveresponse, then the response given is multi-line. After theinitial +OK, for each message in the maildrop, the POP3 serverresponds with a line containing information for that message.This line is called a "unique-id listing" for that message.In order to simplify parsing, all POP3 servers are required touse a certain format for unique-id listings. A unique-idlisting consists of the message-number of the message,followed by a single space and the unique-id of the message.No information follows the unique-id in the unique-id listing.The unique-id of a message is an arbitrary server-determinedstring, consisting of one to 70 characters in the range 0x21to 0x7E, which uniquely identifies a message within amaildrop and which persists across sessions. Thispersistence is required even if a session ends withoutentering the UPDATE state. The server should never reuse anunique-id in a given maildrop, for as long as the entityusing the unique-id exists.Note that messages marked as deleted are not listed.While it is generally preferable for server implementationsto store arbitrarily assigned unique-ids in the maildrop,Myers & Rose Standards Track [Page 12]RFC 1939 POP3 May 1996this specification is intended to permit unique-ids to becalculated as a hash of the message. Clients should be ableto handle a situation where two identical copies of amessage in a maildrop have the same unique-id.Possible Responses:+OK unique-id listing follows-ERR no such messageExamples:C: UIDLS: +OKS: 1 whqtswO00WBw418f9t5JxYwZS: 2 QhdPYR:00WBw1Ph7x7S: ....C: UIDL 2S: +OK 2 QhdPYR:00WBw1Ph7x7...C: UIDL 3S: -ERR no such message, only 2 messages in maildropUSER nameArguments:a string identifying a mailbox (required), which is ofsignificance ONLY to the serverRestrictions:may only be given in the AUTHORIZATION state after the POP3greeting or after an unsuccessful USER or PASS commandDiscussion:To authenticate using the USER and PASS commandcombination, the client must first issue the USERcommand. If the POP3 server responds with a positivestatus indicator ("+OK"), then the client may issueeither the PASS command to complete the authentication,or the QUIT command to terminate the POP3 session. Ifthe POP3 server responds with a negative status indicator("-ERR") to the USER command, then the client may eitherissue a new authentication command or may issue the QUITcommand.The server may return a positive response even though nosuch mailbox exists. The server may return a negativeresponse if mailbox exists, but does not permit plaintextMyers & Rose Standards Track [Page 13]RFC 1939 POP3 May 1996password authentication.Possible Responses:+OK name is a valid mailbox-ERR never heard of mailbox nameExamples:C: USER fratedS: -ERR sorry, no mailbox for frated here...C: USER mroseS: +OK mrose is a real hoopy froodPASS stringArguments:a server/mailbox-specific password (required)Restrictions:may only be given in the AUTHORIZATION state immediatelyafter a successful USER commandDiscussion:When the client issues the PASS command, the POP3 serveruses the argument pair from the USER and PASS commands todetermine if the client should be given access to theappropriate maildrop.Since the PASS command has exactly one argument, a POP3server may treat spaces in the argument as part of thepassword, instead of as argument separators.Possible Responses:+OK maildrop locked and ready-ERR invalid password-ERR unable to lock maildropExamples:C: USER mroseS: +OK mrose is a real hoopy froodC: PASS secretS: -ERR maildrop already locked...C: USER mroseS: +OK mrose is a real hoopy froodC: PASS secretS: +OK mrose's maildrop has 2 messages (320 octets)Myers & Rose Standards Track [Page 14]RFC 1939 POP3 May 1996APOP name digestArguments:a string identifying a mailbox and a MD5 digest string(both required)Restrictions:may only be given in the AUTHORIZATION state after the POP3greeting or after an unsuccessful USER or PASS commandDiscussion:Normally, each POP3 session starts with a USER/PASSexchange. This results in a server/user-id specificpassword being sent in the clear on the network. Forintermittent use of POP3, this may not introduce a sizablerisk. However, many POP3 client implementations connect tothe POP3 server on a regular basis -- to check for newmail. Further the interval of session initiation may be onthe order of five minutes. Hence, the risk of passwordcapture is greatly enhanced.An alternate method of authentication is required whichprovides for both origin authentication and replayprotection, but which does not involve sending a passwordin the clear over the network. The APOP command providesthis functionality.A POP3 server which implements the APOP command willinclude a timestamp in its banner greeting. The syntax ofthe timestamp corresponds to the `msg-id' in [RFC822], andMUST be different each time the POP3 server issues a bannergreeting. For example, on a UNIX implementation in which aseparate UNIX process is used for each instance of a POP3server, the syntax of the timestamp might be:where `process-ID' is the decimal value of the process'sPID, clock is the decimal value of the system clock, andhostname is the fully-qualified domain-name correspondingto the host where the POP3 server is running.The POP3 client makes note of this timestamp, and thenissues the APOP command. The `name' parameter hasidentical semantics to the `name' parameter of the USERcommand. The `digest' parameter is calculated by applyingthe MD5 algorithm [RFC1321] to a string consisting of thetimestamp (including angle-brackets) followed by a sharedMyers & Rose Standards Track [Page 15]RFC 1939 POP3 May 1996secret. This shared secret is a string known only to thePOP3 client and server. Great care should be taken toprevent unauthorized disclosure of the secret, as knowledgeof the secret will allow any entity to successfullymasquerade as the named user. The `digest' parameteritself is a 16-octet value which is sent in hexadecimalformat, using lower-case ASCII characters.When the POP3 server receives the APOP command, it verifiesthe digest provided. If the digest is correct, the POP3server issues a positive response, and the POP3 sessionenters the TRANSACTION state. Otherwise, a negativeresponse is issued and the POP3 session remains in theAUTHORIZATION state.Note that as the length of the shared secret increases, sodoes the difficulty of deriving it. As such, sharedsecrets should be long strings (considerably longer thanthe 8-character example shown below).Possible Responses:+OK maildrop locked and ready-ERR permission deniedExamples:S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>C: APOP mrose c4c9334bac560ecc979e58001b3e22fbS: +OK maildrop has 1 message (369 octets)In this example, the shared secret is the string `tan-staaf'. Hence, the MD5 algorithm is applied to the string<1896.697170952@dbc.mtview.ca.us>tanstaafwhich produces a digest value ofc4c9334bac560ecc979e58001b3e22fb8. Scaling and Operational ConsiderationsSince some of the optional features described above were added to thePOP3 protocol, experience has accumulated in using them in large-scale commercial post office operations where most of the users areunrelated to each other. In these situations and others, users andvendors of POP3 clients have discovered that the combination of usingthe UIDL command and not issuing the DELE command can provide a weakversion of the "maildrop as semi-permanent repository" functionalitynormally associated with IMAP. Of course the other capabilities ofMyers & Rose Standards Track [Page 16]RFC 1939 POP3 May 1996IMAP, such as polling an existing connection for newly arrivedmessages and supporting multiple folders on the server, are notpresent in POP3.When these facilities are used in this way by casual users, there hasbeen a tendency for already-read messages to accumulate on the serverwithout bound. This is clearly an undesirable behavior pattern fromthe standpoint of the server operator. This situation is aggravatedby the fact that the limited capabilities of the POP3 do not permitefficient handling of maildrops which have hundreds or thousands ofmessages.Consequently, it is recommended that operators of large-scale multi-user servers, especially ones in which the user's only access to themaildrop is via POP3, consider such options as:* Imposing a per-user maildrop storage quota or the like.A disadvantage to this option is that accumulation of messages mayresult in the user's inability to receive new ones into themaildrop. Sites which choose this option should be sure to informusers of impending or current exhaustion of quota, perhaps byinserting an appropriate message into the user's maildrop.* Enforce a site policy regarding mail retention on the server.Sites are free to establish local policy regarding the storage andretention of messages on the server, both read and unread. Forexample, a site might delete unread messages from the server after60 days and delete read messages after 7 days. Such messagedeletions are outside the scope of the POP3 protocol and are notconsidered a protocol violation.Server operators enforcing message deletion policies should takecare to make all users aware of the policies in force.Clients must not assume that a site policy will automate messagedeletions, and should continue to explicitly delete messages usingthe DELE command when appropriate.It should be noted that enforcing site message deletion policiesmay be confusing to the user community, since their POP3 clientmay contain configuration options to leave mail on the serverwhich will not in fact be supported by the server.One special case of a site policy is that messages may only bedownloaded once from the server, and are deleted after this hasbeen accomplished. This could be implemented in POP3 serverMyers & Rose Standards Track [Page 17]RFC 1939 POP3 May 1996software by the following mechanism: "following a POP3 login by aclient which was ended by a QUIT, delete all messages downloadedduring the session with the RETR command". It is important not todelete messages in the event of abnormal connection termination(ie, if no QUIT was received from the client) because the clientmay not have successfully received or stored the messages.Servers implementing a download-and-delete policy may also wish todisable or limit the optional TOP command, since it could be usedas an alternate mechanism to download entire messages.9. POP3 Command SummaryMinimal POP3 Commands:USER name valid in the AUTHORIZATION statePASS stringQUITSTAT valid in the TRANSACTION stateLIST [msg]RETR msgDELE msgNOOPRSETQUITOptional POP3 Commands:APOP name digest valid in the AUTHORIZATION stateTOP msg n valid in the TRANSACTION stateUIDL [msg]POP3 Replies:+OK-ERRNote that with the exception of the STAT, LIST, and UIDL commands,the reply given by the POP3 server to any command is significantonly to "+OK" and "-ERR". Any text occurring after this replymay be ignored by the client.Myers & Rose Standards Track [Page 18]RFC 1939 POP3 May 199610. Example POP3 SessionS: C: S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>C: APOP mrose c4c9334bac560ecc979e58001b3e22fbS: +OK mrose's maildrop has 2 messages (320 octets)C: STATS: +OK 2 320C: LISTS: +OK 2 messages (320 octets)S: 1 120S: 2 200S: .C: RETR 1S: +OK 120 octetsS: S: .C: DELE 1S: +OK message 1 deletedC: RETR 2S: +OK 200 octetsS: S: .C: DELE 2S: +OK message 2 deletedC: QUITS: +OK dewey POP3 server signing off (maildrop empty)C: S: 11. Message FormatAll messages transmitted during a POP3 session are assumed to conformto the standard for the format of Internet text messages [RFC822].It is important to note that the octet count for a message on theserver host may differ from the octet count assigned to that messagedue to local conventions for designating end-of-line. Usually,during the AUTHORIZATION state of the POP3 session, the POP3 servercan calculate the size of each message in octets when it opens themaildrop. For example, if the POP3 server host internally representsend-of-line as a single character, then the POP3 server simply countseach occurrence of this character in a message as two octets. Notethat lines in the message which start with the termination octet neednot (and must not) be counted twice, since the POP3 client willremove all byte-stuffed termination characters when it receives amulti-line response.Myers & Rose Standards Track [Page 19]RFC 1939 POP3 May 199612. References[RFC821] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC821, USC/Information Sciences Institute, August 1982.[RFC822] Crocker, D., "Standard for the Format of ARPA-Internet TextMessages", STD 11, RFC 822, University of Delaware, August 1982.[RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,MIT Laboratory for Computer Science, April 1992.[RFC1730] Crispin, M., "Internet Message Access Protocol - Version4", RFC 1730, University of Washington, December 1994.[RFC1734] Myers, J., "POP3 AUTHentication command", RFC 1734,Carnegie Mellon, December 1994.13. Security ConsiderationsIt is conjectured that use of the APOP command provides originidentification and replay protection for a POP3 session.Accordingly, a POP3 server which implements both the PASS and APOPcommands should not allow both methods of access for a given user;that is, for a given mailbox name, either the USER/PASS commandsequence or the APOP command is allowed, but not both.Further, note that as the length of the shared secret increases, sodoes the difficulty of deriving it.Servers that answer -ERR to the USER command are giving potentialattackers clues about which names are valid.Use of the PASS command sends passwords in the clear over thenetwork.Use of the RETR and TOP commands sends mail in the clear over thenetwork.Otherwise, security issues are not discussed in this memo.14. AcknowledgementsThe POP family has a long and checkered history. Although primarilya minor revision to RFC 1460, POP3 is based on the ideas presented inRFCs 918, 937, and 1081.In addition, Alfred Grimstad, Keith McCloghrie, and Neil Ostroffprovided significant comments on the APOP command.Myers & Rose Standards Track [Page 20]RFC 1939 POP3 May 199615. Authors' AddressesJohn G. MyersCarnegie-Mellon University5000 Forbes AvePittsburgh, PA 15213EMail: jgm+@cmu.eduMarshall T. RoseDover Beach Consulting, Inc.420 Whisman CourtMountain View, CA 94043-2186EMail: mrose@dbc.mtview.ca.usMyers & Rose Standards Track [Page 21]RFC 1939 POP3 May 1996Appendix A. Differences from RFC 1725This memo is a revision to RFC 1725, a Draft Standard. It makes thefollowing changes from that document:- clarifies that command keywords are case insensitive.- specifies that servers must send "+OK" and "-ERR" inupper case.- specifies that the initial greeting is a positive response,instead of any string which should be a positive response.- clarifies behavior for unimplemented commands.- makes the USER and PASS commands optional.- clarified the set of possible responses to the USER command.- reverses the order of the examples in the USER and PASScommands, to reduce confusion.- clarifies that the PASS command may only be given immediatelyafter a successful USER command.- clarified the persistence requirements of UIDs and added someimplementation notes.- specifies a UID length limitation of one to 70 octets.- specifies a status indicator length limitationof 512 octets, including the CRLF.- clarifies that LIST with no arguments on an empty mailboxreturns success.- adds a reference from the LIST command to the Message Formatsection- clarifies the behavior of QUIT upon failure- clarifies the security section to not imply the use of theUSER command with the APOP command.- adds references to RFCs 1730 and 1734- clarifies the method by which a UA may enter mail into thetransport system.Myers & Rose Standards Track [Page 22]RFC 1939 POP3 May 1996- clarifies that the second argument to the TOP command is anumber of lines.- changes the suggestion in the Security Considerations sectionfor a server to not accept both PASS and APOP for a given userfrom a "must" to a "should".- adds a section on scaling and operational considerationsAppendix B. Command IndexAPOP ....................................................... 15DELE ....................................................... 8LIST ....................................................... 6NOOP ....................................................... 9PASS ....................................................... 14QUIT ....................................................... 5QUIT ....................................................... 10RETR ....................................................... 8RSET ....................................................... 9STAT ....................................................... 6TOP ........................................................ 11UIDL ....................................................... 12USER ....................................................... 13Myers & Rose Standards Track [Page 23]