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