7 Network Working Group J. Myers
\r
8 Request for Comments: 1939 Carnegie Mellon
\r
10 Obsoletes: 1725 Dover Beach Consulting, Inc.
\r
11 Category: Standards Track May 1996
\r
14 Post Office Protocol - Version 3
\r
18 This document specifies an Internet standards track protocol for the
\r
19 Internet community, and requests discussion and suggestions for
\r
20 improvements. Please refer to the current edition of the "Internet
\r
21 Official Protocol Standards" (STD 1) for the standardization state
\r
22 and status of this protocol. Distribution of this memo is unlimited.
\r
26 1. Introduction ................................................ 2
\r
27 2. A Short Digression .......................................... 2
\r
28 3. Basic Operation ............................................. 3
\r
29 4. The AUTHORIZATION State ..................................... 4
\r
30 QUIT Command ................................................ 5
\r
31 5. The TRANSACTION State ....................................... 5
\r
32 STAT Command ................................................ 6
\r
33 LIST Command ................................................ 6
\r
34 RETR Command ................................................ 8
\r
35 DELE Command ................................................ 8
\r
36 NOOP Command ................................................ 9
\r
37 RSET Command ................................................ 9
\r
38 6. The UPDATE State ............................................ 10
\r
39 QUIT Command ................................................ 10
\r
40 7. Optional POP3 Commands ...................................... 11
\r
41 TOP Command ................................................. 11
\r
42 UIDL Command ................................................ 12
\r
43 USER Command ................................................ 13
\r
44 PASS Command ................................................ 14
\r
45 APOP Command ................................................ 15
\r
46 8. Scaling and Operational Considerations ...................... 16
\r
47 9. POP3 Command Summary ........................................ 18
\r
48 10. Example POP3 Session ....................................... 19
\r
49 11. Message Format ............................................. 19
\r
50 12. References ................................................. 20
\r
51 13. Security Considerations .................................... 20
\r
52 14. Acknowledgements ........................................... 20
\r
53 15. Authors' Addresses ......................................... 21
\r
54 Appendix A. Differences from RFC 1725 .......................... 22
\r
58 Myers & Rose Standards Track [Page 1]
\r
60 RFC 1939 POP3 May 1996
\r
63 Appendix B. Command Index ...................................... 23
\r
67 On certain types of smaller nodes in the Internet it is often
\r
68 impractical to maintain a message transport system (MTS). For
\r
69 example, a workstation may not have sufficient resources (cycles,
\r
70 disk space) in order to permit a SMTP server [RFC821] and associated
\r
71 local mail delivery system to be kept resident and continuously
\r
72 running. Similarly, it may be expensive (or impossible) to keep a
\r
73 personal computer interconnected to an IP-style network for long
\r
74 amounts of time (the node is lacking the resource known as
\r
77 Despite this, it is often very useful to be able to manage mail on
\r
78 these smaller nodes, and they often support a user agent (UA) to aid
\r
79 the tasks of mail handling. To solve this problem, a node which can
\r
80 support an MTS entity offers a maildrop service to these less endowed
\r
81 nodes. The Post Office Protocol - Version 3 (POP3) is intended to
\r
82 permit a workstation to dynamically access a maildrop on a server
\r
83 host in a useful fashion. Usually, this means that the POP3 protocol
\r
84 is used to allow a workstation to retrieve mail that the server is
\r
87 POP3 is not intended to provide extensive manipulation operations of
\r
88 mail on the server; normally, mail is downloaded and then deleted. A
\r
89 more advanced (and complex) protocol, IMAP4, is discussed in
\r
92 For the remainder of this memo, the term "client host" refers to a
\r
93 host making use of the POP3 service, while the term "server host"
\r
94 refers to a host which offers the POP3 service.
\r
96 2. A Short Digression
\r
98 This memo does not specify how a client host enters mail into the
\r
99 transport system, although a method consistent with the philosophy of
\r
100 this memo is presented here:
\r
102 When the user agent on a client host wishes to enter a message
\r
103 into the transport system, it establishes an SMTP connection to
\r
104 its relay host and sends all mail to it. This relay host could
\r
105 be, but need not be, the POP3 server host for the client host. Of
\r
106 course, the relay host must accept mail for delivery to arbitrary
\r
107 recipient addresses, that functionality is not required of all
\r
114 Myers & Rose Standards Track [Page 2]
\r
116 RFC 1939 POP3 May 1996
\r
121 Initially, the server host starts the POP3 service by listening on
\r
122 TCP port 110. When a client host wishes to make use of the service,
\r
123 it establishes a TCP connection with the server host. When the
\r
124 connection is established, the POP3 server sends a greeting. The
\r
125 client and POP3 server then exchange commands and responses
\r
126 (respectively) until the connection is closed or aborted.
\r
128 Commands in the POP3 consist of a case-insensitive keyword, possibly
\r
129 followed by one or more arguments. All commands are terminated by a
\r
130 CRLF pair. Keywords and arguments consist of printable ASCII
\r
131 characters. Keywords and arguments are each separated by a single
\r
132 SPACE character. Keywords are three or four characters long. Each
\r
133 argument may be up to 40 characters long.
\r
135 Responses in the POP3 consist of a status indicator and a keyword
\r
136 possibly followed by additional information. All responses are
\r
137 terminated by a CRLF pair. Responses may be up to 512 characters
\r
138 long, including the terminating CRLF. There are currently two status
\r
139 indicators: positive ("+OK") and negative ("-ERR"). Servers MUST
\r
140 send the "+OK" and "-ERR" in upper case.
\r
142 Responses to certain commands are multi-line. In these cases, which
\r
143 are clearly indicated below, after sending the first line of the
\r
144 response and a CRLF, any additional lines are sent, each terminated
\r
145 by a CRLF pair. When all lines of the response have been sent, a
\r
146 final line is sent, consisting of a termination octet (decimal code
\r
147 046, ".") and a CRLF pair. If any line of the multi-line response
\r
148 begins with the termination octet, the line is "byte-stuffed" by
\r
149 pre-pending the termination octet to that line of the response.
\r
150 Hence a multi-line response is terminated with the five octets
\r
151 "CRLF.CRLF". When examining a multi-line response, the client checks
\r
152 to see if the line begins with the termination octet. If so and if
\r
153 octets other than CRLF follow, the first octet of the line (the
\r
154 termination octet) is stripped away. If so and if CRLF immediately
\r
155 follows the termination character, then the response from the POP
\r
156 server is ended and the line containing ".CRLF" is not considered
\r
157 part of the multi-line response.
\r
159 A POP3 session progresses through a number of states during its
\r
160 lifetime. Once the TCP connection has been opened and the POP3
\r
161 server has sent the greeting, the session enters the AUTHORIZATION
\r
162 state. In this state, the client must identify itself to the POP3
\r
163 server. Once the client has successfully done this, the server
\r
164 acquires resources associated with the client's maildrop, and the
\r
165 session enters the TRANSACTION state. In this state, the client
\r
166 requests actions on the part of the POP3 server. When the client has
\r
170 Myers & Rose Standards Track [Page 3]
\r
172 RFC 1939 POP3 May 1996
\r
175 issued the QUIT command, the session enters the UPDATE state. In
\r
176 this state, the POP3 server releases any resources acquired during
\r
177 the TRANSACTION state and says goodbye. The TCP connection is then
\r
180 A server MUST respond to an unrecognized, unimplemented, or
\r
181 syntactically invalid command by responding with a negative status
\r
182 indicator. A server MUST respond to a command issued when the
\r
183 session is in an incorrect state by responding with a negative status
\r
184 indicator. There is no general method for a client to distinguish
\r
185 between a server which does not implement an optional command and a
\r
186 server which is unwilling or unable to process the command.
\r
188 A POP3 server MAY have an inactivity autologout timer. Such a timer
\r
189 MUST be of at least 10 minutes' duration. The receipt of any command
\r
190 from the client during that interval should suffice to reset the
\r
191 autologout timer. When the timer expires, the session does NOT enter
\r
192 the UPDATE state--the server should close the TCP connection without
\r
193 removing any messages or sending any response to the client.
\r
195 4. The AUTHORIZATION State
\r
197 Once the TCP connection has been opened by a POP3 client, the POP3
\r
198 server issues a one line greeting. This can be any positive
\r
199 response. An example might be:
\r
201 S: +OK POP3 server ready
\r
203 The POP3 session is now in the AUTHORIZATION state. The client must
\r
204 now identify and authenticate itself to the POP3 server. Two
\r
205 possible mechanisms for doing this are described in this document,
\r
206 the USER and PASS command combination and the APOP command. Both
\r
207 mechanisms are described later in this document. Additional
\r
208 authentication mechanisms are described in [RFC1734]. While there is
\r
209 no single authentication mechanism that is required of all POP3
\r
210 servers, a POP3 server must of course support at least one
\r
211 authentication mechanism.
\r
213 Once the POP3 server has determined through the use of any
\r
214 authentication command that the client should be given access to the
\r
215 appropriate maildrop, the POP3 server then acquires an exclusive-
\r
216 access lock on the maildrop, as necessary to prevent messages from
\r
217 being modified or removed before the session enters the UPDATE state.
\r
218 If the lock is successfully acquired, the POP3 server responds with a
\r
219 positive status indicator. The POP3 session now enters the
\r
220 TRANSACTION state, with no messages marked as deleted. If the
\r
221 maildrop cannot be opened for some reason (for example, a lock can
\r
222 not be acquired, the client is denied access to the appropriate
\r
226 Myers & Rose Standards Track [Page 4]
\r
228 RFC 1939 POP3 May 1996
\r
231 maildrop, or the maildrop cannot be parsed), the POP3 server responds
\r
232 with a negative status indicator. (If a lock was acquired but the
\r
233 POP3 server intends to respond with a negative status indicator, the
\r
234 POP3 server must release the lock prior to rejecting the command.)
\r
235 After returning a negative status indicator, the server may close the
\r
236 connection. If the server does not close the connection, the client
\r
237 may either issue a new authentication command and start again, or the
\r
238 client may issue the QUIT command.
\r
240 After the POP3 server has opened the maildrop, it assigns a message-
\r
241 number to each message, and notes the size of each message in octets.
\r
242 The first message in the maildrop is assigned a message-number of
\r
243 "1", the second is assigned "2", and so on, so that the nth message
\r
244 in a maildrop is assigned a message-number of "n". In POP3 commands
\r
245 and responses, all message-numbers and message sizes are expressed in
\r
246 base-10 (i.e., decimal).
\r
248 Here is the summary for the QUIT command when used in the
\r
249 AUTHORIZATION state:
\r
257 Possible Responses:
\r
262 S: +OK dewey POP3 server signing off
\r
264 5. The TRANSACTION State
\r
266 Once the client has successfully identified itself to the POP3 server
\r
267 and the POP3 server has locked and opened the appropriate maildrop,
\r
268 the POP3 session is now in the TRANSACTION state. The client may now
\r
269 issue any of the following POP3 commands repeatedly. After each
\r
270 command, the POP3 server issues a response. Eventually, the client
\r
271 issues the QUIT command and the POP3 session enters the UPDATE state.
\r
282 Myers & Rose Standards Track [Page 5]
\r
284 RFC 1939 POP3 May 1996
\r
287 Here are the POP3 commands valid in the TRANSACTION state:
\r
294 may only be given in the TRANSACTION state
\r
297 The POP3 server issues a positive response with a line
\r
298 containing information for the maildrop. This line is
\r
299 called a "drop listing" for that maildrop.
\r
301 In order to simplify parsing, all POP3 servers are
\r
302 required to use a certain format for drop listings. The
\r
303 positive response consists of "+OK" followed by a single
\r
304 space, the number of messages in the maildrop, a single
\r
305 space, and the size of the maildrop in octets. This memo
\r
306 makes no requirement on what follows the maildrop size.
\r
307 Minimal implementations should just end that line of the
\r
308 response with a CRLF pair. More advanced implementations
\r
309 may include other information.
\r
311 NOTE: This memo STRONGLY discourages implementations
\r
312 from supplying additional information in the drop
\r
313 listing. Other, optional, facilities are discussed
\r
314 later on which permit the client to parse the messages
\r
317 Note that messages marked as deleted are not counted in
\r
320 Possible Responses:
\r
331 a message-number (optional), which, if present, may NOT
\r
332 refer to a message marked as deleted
\r
338 Myers & Rose Standards Track [Page 6]
\r
340 RFC 1939 POP3 May 1996
\r
344 may only be given in the TRANSACTION state
\r
347 If an argument was given and the POP3 server issues a
\r
348 positive response with a line containing information for
\r
349 that message. This line is called a "scan listing" for
\r
352 If no argument was given and the POP3 server issues a
\r
353 positive response, then the response given is multi-line.
\r
354 After the initial +OK, for each message in the maildrop,
\r
355 the POP3 server responds with a line containing
\r
356 information for that message. This line is also called a
\r
357 "scan listing" for that message. If there are no
\r
358 messages in the maildrop, then the POP3 server responds
\r
359 with no scan listings--it issues a positive response
\r
360 followed by a line containing a termination octet and a
\r
363 In order to simplify parsing, all POP3 servers are
\r
364 required to use a certain format for scan listings. A
\r
365 scan listing consists of the message-number of the
\r
366 message, followed by a single space and the exact size of
\r
367 the message in octets. Methods for calculating the exact
\r
368 size of the message are described in the "Message Format"
\r
369 section below. This memo makes no requirement on what
\r
370 follows the message size in the scan listing. Minimal
\r
371 implementations should just end that line of the response
\r
372 with a CRLF pair. More advanced implementations may
\r
373 include other information, as parsed from the message.
\r
375 NOTE: This memo STRONGLY discourages implementations
\r
376 from supplying additional information in the scan
\r
377 listing. Other, optional, facilities are discussed
\r
378 later on which permit the client to parse the messages
\r
381 Note that messages marked as deleted are not listed.
\r
383 Possible Responses:
\r
384 +OK scan listing follows
\r
385 -ERR no such message
\r
389 S: +OK 2 messages (320 octets)
\r
394 Myers & Rose Standards Track [Page 7]
\r
396 RFC 1939 POP3 May 1996
\r
406 S: -ERR no such message, only 2 messages in maildrop
\r
412 a message-number (required) which may NOT refer to a
\r
413 message marked as deleted
\r
416 may only be given in the TRANSACTION state
\r
419 If the POP3 server issues a positive response, then the
\r
420 response given is multi-line. After the initial +OK, the
\r
421 POP3 server sends the message corresponding to the given
\r
422 message-number, being careful to byte-stuff the termination
\r
423 character (as with all multi-line responses).
\r
425 Possible Responses:
\r
426 +OK message follows
\r
427 -ERR no such message
\r
432 S: <the POP3 server sends the entire message here>
\r
439 a message-number (required) which may NOT refer to a
\r
440 message marked as deleted
\r
443 may only be given in the TRANSACTION state
\r
450 Myers & Rose Standards Track [Page 8]
\r
452 RFC 1939 POP3 May 1996
\r
456 The POP3 server marks the message as deleted. Any future
\r
457 reference to the message-number associated with the message
\r
458 in a POP3 command generates an error. The POP3 server does
\r
459 not actually delete the message until the POP3 session
\r
460 enters the UPDATE state.
\r
462 Possible Responses:
\r
463 +OK message deleted
\r
464 -ERR no such message
\r
468 S: +OK message 1 deleted
\r
471 S: -ERR message 2 already deleted
\r
479 may only be given in the TRANSACTION state
\r
482 The POP3 server does nothing, it merely replies with a
\r
485 Possible Responses:
\r
498 may only be given in the TRANSACTION state
\r
501 If any messages have been marked as deleted by the POP3
\r
502 server, they are unmarked. The POP3 server then replies
\r
506 Myers & Rose Standards Track [Page 9]
\r
508 RFC 1939 POP3 May 1996
\r
511 with a positive response.
\r
513 Possible Responses:
\r
518 S: +OK maildrop has 2 messages (320 octets)
\r
520 6. The UPDATE State
\r
522 When the client issues the QUIT command from the TRANSACTION state,
\r
523 the POP3 session enters the UPDATE state. (Note that if the client
\r
524 issues the QUIT command from the AUTHORIZATION state, the POP3
\r
525 session terminates but does NOT enter the UPDATE state.)
\r
527 If a session terminates for some reason other than a client-issued
\r
528 QUIT command, the POP3 session does NOT enter the UPDATE state and
\r
529 MUST not remove any messages from the maildrop.
\r
538 The POP3 server removes all messages marked as deleted
\r
539 from the maildrop and replies as to the status of this
\r
540 operation. If there is an error, such as a resource
\r
541 shortage, encountered while removing messages, the
\r
542 maildrop may result in having some or none of the messages
\r
543 marked as deleted be removed. In no case may the server
\r
544 remove any messages not marked as deleted.
\r
546 Whether the removal was successful or not, the server
\r
547 then releases any exclusive-access lock on the maildrop
\r
548 and closes the TCP connection.
\r
550 Possible Responses:
\r
552 -ERR some deleted messages not removed
\r
556 S: +OK dewey POP3 server signing off (maildrop empty)
\r
562 Myers & Rose Standards Track [Page 10]
\r
564 RFC 1939 POP3 May 1996
\r
567 S: +OK dewey POP3 server signing off (2 messages left)
\r
570 7. Optional POP3 Commands
\r
572 The POP3 commands discussed above must be supported by all minimal
\r
573 implementations of POP3 servers.
\r
575 The optional POP3 commands described below permit a POP3 client
\r
576 greater freedom in message handling, while preserving a simple POP3
\r
577 server implementation.
\r
579 NOTE: This memo STRONGLY encourages implementations to support
\r
580 these commands in lieu of developing augmented drop and scan
\r
581 listings. In short, the philosophy of this memo is to put
\r
582 intelligence in the part of the POP3 client and not the POP3
\r
588 a message-number (required) which may NOT refer to to a
\r
589 message marked as deleted, and a non-negative number
\r
590 of lines (required)
\r
593 may only be given in the TRANSACTION state
\r
596 If the POP3 server issues a positive response, then the
\r
597 response given is multi-line. After the initial +OK, the
\r
598 POP3 server sends the headers of the message, the blank
\r
599 line separating the headers from the body, and then the
\r
600 number of lines of the indicated message's body, being
\r
601 careful to byte-stuff the termination character (as with
\r
602 all multi-line responses).
\r
604 Note that if the number of lines requested by the POP3
\r
605 client is greater than than the number of lines in the
\r
606 body, then the POP3 server sends the entire message.
\r
608 Possible Responses:
\r
609 +OK top of message follows
\r
610 -ERR no such message
\r
618 Myers & Rose Standards Track [Page 11]
\r
620 RFC 1939 POP3 May 1996
\r
623 S: <the POP3 server sends the headers of the
\r
624 message, a blank line, and the first 10 lines
\r
625 of the body of the message>
\r
629 S: -ERR no such message
\r
635 a message-number (optional), which, if present, may NOT
\r
636 refer to a message marked as deleted
\r
639 may only be given in the TRANSACTION state.
\r
642 If an argument was given and the POP3 server issues a positive
\r
643 response with a line containing information for that message.
\r
644 This line is called a "unique-id listing" for that message.
\r
646 If no argument was given and the POP3 server issues a positive
\r
647 response, then the response given is multi-line. After the
\r
648 initial +OK, for each message in the maildrop, the POP3 server
\r
649 responds with a line containing information for that message.
\r
650 This line is called a "unique-id listing" for that message.
\r
652 In order to simplify parsing, all POP3 servers are required to
\r
653 use a certain format for unique-id listings. A unique-id
\r
654 listing consists of the message-number of the message,
\r
655 followed by a single space and the unique-id of the message.
\r
656 No information follows the unique-id in the unique-id listing.
\r
658 The unique-id of a message is an arbitrary server-determined
\r
659 string, consisting of one to 70 characters in the range 0x21
\r
660 to 0x7E, which uniquely identifies a message within a
\r
661 maildrop and which persists across sessions. This
\r
662 persistence is required even if a session ends without
\r
663 entering the UPDATE state. The server should never reuse an
\r
664 unique-id in a given maildrop, for as long as the entity
\r
665 using the unique-id exists.
\r
667 Note that messages marked as deleted are not listed.
\r
669 While it is generally preferable for server implementations
\r
670 to store arbitrarily assigned unique-ids in the maildrop,
\r
674 Myers & Rose Standards Track [Page 12]
\r
676 RFC 1939 POP3 May 1996
\r
679 this specification is intended to permit unique-ids to be
\r
680 calculated as a hash of the message. Clients should be able
\r
681 to handle a situation where two identical copies of a
\r
682 message in a maildrop have the same unique-id.
\r
684 Possible Responses:
\r
685 +OK unique-id listing follows
\r
686 -ERR no such message
\r
691 S: 1 whqtswO00WBw418f9t5JxYwZ
\r
692 S: 2 QhdPYR:00WBw1Ph7x7
\r
696 S: +OK 2 QhdPYR:00WBw1Ph7x7
\r
699 S: -ERR no such message, only 2 messages in maildrop
\r
705 a string identifying a mailbox (required), which is of
\r
706 significance ONLY to the server
\r
709 may only be given in the AUTHORIZATION state after the POP3
\r
710 greeting or after an unsuccessful USER or PASS command
\r
713 To authenticate using the USER and PASS command
\r
714 combination, the client must first issue the USER
\r
715 command. If the POP3 server responds with a positive
\r
716 status indicator ("+OK"), then the client may issue
\r
717 either the PASS command to complete the authentication,
\r
718 or the QUIT command to terminate the POP3 session. If
\r
719 the POP3 server responds with a negative status indicator
\r
720 ("-ERR") to the USER command, then the client may either
\r
721 issue a new authentication command or may issue the QUIT
\r
724 The server may return a positive response even though no
\r
725 such mailbox exists. The server may return a negative
\r
726 response if mailbox exists, but does not permit plaintext
\r
730 Myers & Rose Standards Track [Page 13]
\r
732 RFC 1939 POP3 May 1996
\r
735 password authentication.
\r
737 Possible Responses:
\r
738 +OK name is a valid mailbox
\r
739 -ERR never heard of mailbox name
\r
743 S: -ERR sorry, no mailbox for frated here
\r
746 S: +OK mrose is a real hoopy frood
\r
752 a server/mailbox-specific password (required)
\r
755 may only be given in the AUTHORIZATION state immediately
\r
756 after a successful USER command
\r
759 When the client issues the PASS command, the POP3 server
\r
760 uses the argument pair from the USER and PASS commands to
\r
761 determine if the client should be given access to the
\r
762 appropriate maildrop.
\r
764 Since the PASS command has exactly one argument, a POP3
\r
765 server may treat spaces in the argument as part of the
\r
766 password, instead of as argument separators.
\r
768 Possible Responses:
\r
769 +OK maildrop locked and ready
\r
770 -ERR invalid password
\r
771 -ERR unable to lock maildrop
\r
775 S: +OK mrose is a real hoopy frood
\r
777 S: -ERR maildrop already locked
\r
780 S: +OK mrose is a real hoopy frood
\r
782 S: +OK mrose's maildrop has 2 messages (320 octets)
\r
786 Myers & Rose Standards Track [Page 14]
\r
788 RFC 1939 POP3 May 1996
\r
794 a string identifying a mailbox and a MD5 digest string
\r
798 may only be given in the AUTHORIZATION state after the POP3
\r
799 greeting or after an unsuccessful USER or PASS command
\r
802 Normally, each POP3 session starts with a USER/PASS
\r
803 exchange. This results in a server/user-id specific
\r
804 password being sent in the clear on the network. For
\r
805 intermittent use of POP3, this may not introduce a sizable
\r
806 risk. However, many POP3 client implementations connect to
\r
807 the POP3 server on a regular basis -- to check for new
\r
808 mail. Further the interval of session initiation may be on
\r
809 the order of five minutes. Hence, the risk of password
\r
810 capture is greatly enhanced.
\r
812 An alternate method of authentication is required which
\r
813 provides for both origin authentication and replay
\r
814 protection, but which does not involve sending a password
\r
815 in the clear over the network. The APOP command provides
\r
816 this functionality.
\r
818 A POP3 server which implements the APOP command will
\r
819 include a timestamp in its banner greeting. The syntax of
\r
820 the timestamp corresponds to the `msg-id' in [RFC822], and
\r
821 MUST be different each time the POP3 server issues a banner
\r
822 greeting. For example, on a UNIX implementation in which a
\r
823 separate UNIX process is used for each instance of a POP3
\r
824 server, the syntax of the timestamp might be:
\r
826 <process-ID.clock@hostname>
\r
828 where `process-ID' is the decimal value of the process's
\r
829 PID, clock is the decimal value of the system clock, and
\r
830 hostname is the fully-qualified domain-name corresponding
\r
831 to the host where the POP3 server is running.
\r
833 The POP3 client makes note of this timestamp, and then
\r
834 issues the APOP command. The `name' parameter has
\r
835 identical semantics to the `name' parameter of the USER
\r
836 command. The `digest' parameter is calculated by applying
\r
837 the MD5 algorithm [RFC1321] to a string consisting of the
\r
838 timestamp (including angle-brackets) followed by a shared
\r
842 Myers & Rose Standards Track [Page 15]
\r
844 RFC 1939 POP3 May 1996
\r
847 secret. This shared secret is a string known only to the
\r
848 POP3 client and server. Great care should be taken to
\r
849 prevent unauthorized disclosure of the secret, as knowledge
\r
850 of the secret will allow any entity to successfully
\r
851 masquerade as the named user. The `digest' parameter
\r
852 itself is a 16-octet value which is sent in hexadecimal
\r
853 format, using lower-case ASCII characters.
\r
855 When the POP3 server receives the APOP command, it verifies
\r
856 the digest provided. If the digest is correct, the POP3
\r
857 server issues a positive response, and the POP3 session
\r
858 enters the TRANSACTION state. Otherwise, a negative
\r
859 response is issued and the POP3 session remains in the
\r
860 AUTHORIZATION state.
\r
862 Note that as the length of the shared secret increases, so
\r
863 does the difficulty of deriving it. As such, shared
\r
864 secrets should be long strings (considerably longer than
\r
865 the 8-character example shown below).
\r
867 Possible Responses:
\r
868 +OK maildrop locked and ready
\r
869 -ERR permission denied
\r
872 S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>
\r
873 C: APOP mrose c4c9334bac560ecc979e58001b3e22fb
\r
874 S: +OK maildrop has 1 message (369 octets)
\r
876 In this example, the shared secret is the string `tan-
\r
877 staaf'. Hence, the MD5 algorithm is applied to the string
\r
879 <1896.697170952@dbc.mtview.ca.us>tanstaaf
\r
881 which produces a digest value of
\r
883 c4c9334bac560ecc979e58001b3e22fb
\r
885 8. Scaling and Operational Considerations
\r
887 Since some of the optional features described above were added to the
\r
888 POP3 protocol, experience has accumulated in using them in large-
\r
889 scale commercial post office operations where most of the users are
\r
890 unrelated to each other. In these situations and others, users and
\r
891 vendors of POP3 clients have discovered that the combination of using
\r
892 the UIDL command and not issuing the DELE command can provide a weak
\r
893 version of the "maildrop as semi-permanent repository" functionality
\r
894 normally associated with IMAP. Of course the other capabilities of
\r
898 Myers & Rose Standards Track [Page 16]
\r
900 RFC 1939 POP3 May 1996
\r
903 IMAP, such as polling an existing connection for newly arrived
\r
904 messages and supporting multiple folders on the server, are not
\r
907 When these facilities are used in this way by casual users, there has
\r
908 been a tendency for already-read messages to accumulate on the server
\r
909 without bound. This is clearly an undesirable behavior pattern from
\r
910 the standpoint of the server operator. This situation is aggravated
\r
911 by the fact that the limited capabilities of the POP3 do not permit
\r
912 efficient handling of maildrops which have hundreds or thousands of
\r
915 Consequently, it is recommended that operators of large-scale multi-
\r
916 user servers, especially ones in which the user's only access to the
\r
917 maildrop is via POP3, consider such options as:
\r
919 * Imposing a per-user maildrop storage quota or the like.
\r
921 A disadvantage to this option is that accumulation of messages may
\r
922 result in the user's inability to receive new ones into the
\r
923 maildrop. Sites which choose this option should be sure to inform
\r
924 users of impending or current exhaustion of quota, perhaps by
\r
925 inserting an appropriate message into the user's maildrop.
\r
927 * Enforce a site policy regarding mail retention on the server.
\r
929 Sites are free to establish local policy regarding the storage and
\r
930 retention of messages on the server, both read and unread. For
\r
931 example, a site might delete unread messages from the server after
\r
932 60 days and delete read messages after 7 days. Such message
\r
933 deletions are outside the scope of the POP3 protocol and are not
\r
934 considered a protocol violation.
\r
936 Server operators enforcing message deletion policies should take
\r
937 care to make all users aware of the policies in force.
\r
939 Clients must not assume that a site policy will automate message
\r
940 deletions, and should continue to explicitly delete messages using
\r
941 the DELE command when appropriate.
\r
943 It should be noted that enforcing site message deletion policies
\r
944 may be confusing to the user community, since their POP3 client
\r
945 may contain configuration options to leave mail on the server
\r
946 which will not in fact be supported by the server.
\r
948 One special case of a site policy is that messages may only be
\r
949 downloaded once from the server, and are deleted after this has
\r
950 been accomplished. This could be implemented in POP3 server
\r
954 Myers & Rose Standards Track [Page 17]
\r
956 RFC 1939 POP3 May 1996
\r
959 software by the following mechanism: "following a POP3 login by a
\r
960 client which was ended by a QUIT, delete all messages downloaded
\r
961 during the session with the RETR command". It is important not to
\r
962 delete messages in the event of abnormal connection termination
\r
963 (ie, if no QUIT was received from the client) because the client
\r
964 may not have successfully received or stored the messages.
\r
965 Servers implementing a download-and-delete policy may also wish to
\r
966 disable or limit the optional TOP command, since it could be used
\r
967 as an alternate mechanism to download entire messages.
\r
969 9. POP3 Command Summary
\r
971 Minimal POP3 Commands:
\r
973 USER name valid in the AUTHORIZATION state
\r
977 STAT valid in the TRANSACTION state
\r
985 Optional POP3 Commands:
\r
987 APOP name digest valid in the AUTHORIZATION state
\r
989 TOP msg n valid in the TRANSACTION state
\r
997 Note that with the exception of the STAT, LIST, and UIDL commands,
\r
998 the reply given by the POP3 server to any command is significant
\r
999 only to "+OK" and "-ERR". Any text occurring after this reply
\r
1000 may be ignored by the client.
\r
1010 Myers & Rose Standards Track [Page 18]
\r
1012 RFC 1939 POP3 May 1996
\r
1015 10. Example POP3 Session
\r
1017 S: <wait for connection on TCP port 110>
\r
1018 C: <open connection>
\r
1019 S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>
\r
1020 C: APOP mrose c4c9334bac560ecc979e58001b3e22fb
\r
1021 S: +OK mrose's maildrop has 2 messages (320 octets)
\r
1025 S: +OK 2 messages (320 octets)
\r
1031 S: <the POP3 server sends message 1>
\r
1034 S: +OK message 1 deleted
\r
1037 S: <the POP3 server sends message 2>
\r
1040 S: +OK message 2 deleted
\r
1042 S: +OK dewey POP3 server signing off (maildrop empty)
\r
1043 C: <close connection>
\r
1044 S: <wait for next connection>
\r
1046 11. Message Format
\r
1048 All messages transmitted during a POP3 session are assumed to conform
\r
1049 to the standard for the format of Internet text messages [RFC822].
\r
1051 It is important to note that the octet count for a message on the
\r
1052 server host may differ from the octet count assigned to that message
\r
1053 due to local conventions for designating end-of-line. Usually,
\r
1054 during the AUTHORIZATION state of the POP3 session, the POP3 server
\r
1055 can calculate the size of each message in octets when it opens the
\r
1056 maildrop. For example, if the POP3 server host internally represents
\r
1057 end-of-line as a single character, then the POP3 server simply counts
\r
1058 each occurrence of this character in a message as two octets. Note
\r
1059 that lines in the message which start with the termination octet need
\r
1060 not (and must not) be counted twice, since the POP3 client will
\r
1061 remove all byte-stuffed termination characters when it receives a
\r
1062 multi-line response.
\r
1066 Myers & Rose Standards Track [Page 19]
\r
1068 RFC 1939 POP3 May 1996
\r
1073 [RFC821] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC
\r
1074 821, USC/Information Sciences Institute, August 1982.
\r
1076 [RFC822] Crocker, D., "Standard for the Format of ARPA-Internet Text
\r
1077 Messages", STD 11, RFC 822, University of Delaware, August 1982.
\r
1079 [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,
\r
1080 MIT Laboratory for Computer Science, April 1992.
\r
1082 [RFC1730] Crispin, M., "Internet Message Access Protocol - Version
\r
1083 4", RFC 1730, University of Washington, December 1994.
\r
1085 [RFC1734] Myers, J., "POP3 AUTHentication command", RFC 1734,
\r
1086 Carnegie Mellon, December 1994.
\r
1088 13. Security Considerations
\r
1090 It is conjectured that use of the APOP command provides origin
\r
1091 identification and replay protection for a POP3 session.
\r
1092 Accordingly, a POP3 server which implements both the PASS and APOP
\r
1093 commands should not allow both methods of access for a given user;
\r
1094 that is, for a given mailbox name, either the USER/PASS command
\r
1095 sequence or the APOP command is allowed, but not both.
\r
1097 Further, note that as the length of the shared secret increases, so
\r
1098 does the difficulty of deriving it.
\r
1100 Servers that answer -ERR to the USER command are giving potential
\r
1101 attackers clues about which names are valid.
\r
1103 Use of the PASS command sends passwords in the clear over the
\r
1106 Use of the RETR and TOP commands sends mail in the clear over the
\r
1109 Otherwise, security issues are not discussed in this memo.
\r
1111 14. Acknowledgements
\r
1113 The POP family has a long and checkered history. Although primarily
\r
1114 a minor revision to RFC 1460, POP3 is based on the ideas presented in
\r
1115 RFCs 918, 937, and 1081.
\r
1117 In addition, Alfred Grimstad, Keith McCloghrie, and Neil Ostroff
\r
1118 provided significant comments on the APOP command.
\r
1122 Myers & Rose Standards Track [Page 20]
\r
1124 RFC 1939 POP3 May 1996
\r
1127 15. Authors' Addresses
\r
1130 Carnegie-Mellon University
\r
1132 Pittsburgh, PA 15213
\r
1134 EMail: jgm+@cmu.edu
\r
1138 Dover Beach Consulting, Inc.
\r
1140 Mountain View, CA 94043-2186
\r
1142 EMail: mrose@dbc.mtview.ca.us
\r
1178 Myers & Rose Standards Track [Page 21]
\r
1180 RFC 1939 POP3 May 1996
\r
1183 Appendix A. Differences from RFC 1725
\r
1185 This memo is a revision to RFC 1725, a Draft Standard. It makes the
\r
1186 following changes from that document:
\r
1188 - clarifies that command keywords are case insensitive.
\r
1190 - specifies that servers must send "+OK" and "-ERR" in
\r
1193 - specifies that the initial greeting is a positive response,
\r
1194 instead of any string which should be a positive response.
\r
1196 - clarifies behavior for unimplemented commands.
\r
1198 - makes the USER and PASS commands optional.
\r
1200 - clarified the set of possible responses to the USER command.
\r
1202 - reverses the order of the examples in the USER and PASS
\r
1203 commands, to reduce confusion.
\r
1205 - clarifies that the PASS command may only be given immediately
\r
1206 after a successful USER command.
\r
1208 - clarified the persistence requirements of UIDs and added some
\r
1209 implementation notes.
\r
1211 - specifies a UID length limitation of one to 70 octets.
\r
1213 - specifies a status indicator length limitation
\r
1214 of 512 octets, including the CRLF.
\r
1216 - clarifies that LIST with no arguments on an empty mailbox
\r
1219 - adds a reference from the LIST command to the Message Format
\r
1222 - clarifies the behavior of QUIT upon failure
\r
1224 - clarifies the security section to not imply the use of the
\r
1225 USER command with the APOP command.
\r
1227 - adds references to RFCs 1730 and 1734
\r
1229 - clarifies the method by which a UA may enter mail into the
\r
1234 Myers & Rose Standards Track [Page 22]
\r
1236 RFC 1939 POP3 May 1996
\r
1239 - clarifies that the second argument to the TOP command is a
\r
1242 - changes the suggestion in the Security Considerations section
\r
1243 for a server to not accept both PASS and APOP for a given user
\r
1244 from a "must" to a "should".
\r
1246 - adds a section on scaling and operational considerations
\r
1248 Appendix B. Command Index
\r
1250 APOP ....................................................... 15
\r
1251 DELE ....................................................... 8
\r
1252 LIST ....................................................... 6
\r
1253 NOOP ....................................................... 9
\r
1254 PASS ....................................................... 14
\r
1255 QUIT ....................................................... 5
\r
1256 QUIT ....................................................... 10
\r
1257 RETR ....................................................... 8
\r
1258 RSET ....................................................... 9
\r
1259 STAT ....................................................... 6
\r
1260 TOP ........................................................ 11
\r
1261 UIDL ....................................................... 12
\r
1262 USER ....................................................... 13
\r
1290 Myers & Rose Standards Track [Page 23]
\r