home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 900s / rfc918.txt < prev    next >
Text File  |  1992-09-21  |  10KB  |  291 lines

  1.  
  2.  
  3. Network Working Group                                     J. K. Reynolds
  4. Request for Comments: 918                                            ISI
  5.                                                             October 1984
  6.  
  7.  
  8.                           POST OFFICE PROTOCOL
  9.  
  10.  
  11. Status of this Memo
  12.  
  13.    This RFC suggests a simple method for workstations to dynamically
  14.    access mail from a mailbox server.  This RFC specifies a proposed
  15.    protocol for the ARPA-Internet community, and requests discussion and
  16.    suggestions for improvement.
  17.  
  18. Introduction
  19.  
  20.    The intent of the Post Office Protocol (POP) is to allow a user's
  21.    workstation to access mail from a mailbox server.  It is expected
  22.    that mail will be posted from the workstation to the mailbox server
  23.    via the Simple Mail Transfer Protocol (SMTP).  For further
  24.    information see RFC-821 [1] and RFC-822 [2].
  25.  
  26.    The status of this protocol is experimental, and this protocol is
  27.    dependent upon TCP.
  28.  
  29. The Protocol
  30.  
  31.    The protocol is for the server to be listening for a connection.
  32.    When a connection is opened the server sends a greeting message and
  33.    waits for commands.  When commands are received the server acts on
  34.    them and responds with replies.
  35.  
  36.    The client opens a connection, waits for the greeting, then sends the
  37.    USER and then the PASS commands to establish authorization to access
  38.    mailboxes.  The client begins a mail reading transaction with either
  39.    an RDEL (to read and delete all messages from a mailbox) or a RETR
  40.    (to simply read all messages from a mailbox).  The server opens and
  41.    locks the mailbox, and responds with the number of characters in the
  42.    mailbox.  Then the client asks for the data to be sent by issuing the
  43.    RCEV command.  The server responds by sending the mail data.  When
  44.    all the data has been received the client sends the RCVD command.  If
  45.    the transaction started with the RDEL command the server now deletes
  46.    the mail data from the mailbox. In any case, the server closes and
  47.    unlocks the mailbox.  The client terminates the session with the QUIT
  48.    command.
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. Reynolds                                                        [Page 1]
  58.  
  59.  
  60.  
  61. Post Office Protocol                                             RFC 918
  62.  
  63.  
  64.    The Normal Scenario
  65.  
  66.            Client                    Server
  67.            ------                    ------
  68.                                 Wait for Connection
  69.       Open Connection  -->
  70.                            <--  +OK
  71.                                 Wait for Command
  72.       USER Fred        -->
  73.                            <--  +OK
  74.                                 Wait for Command
  75.       PASS password    -->
  76.                            <--  +OK
  77.                                 Wait for Command
  78.       RDEL mailbox     -->      (open and lock mailbox)
  79.                            <--  #xxx
  80.                                 Wait for Command
  81.       RCEV             -->   
  82.                            <--  (send a copy of mail)
  83.                                 Wait for Command
  84.       RCVD             -->      (deletes mail from mailbox, unlock
  85.                                 and close mailbox)
  86.                            <--  +OK
  87.                                 Wait for Command
  88.       QUIT             -->
  89.                            <--  +OK
  90.       Close connection --> <--  Close connection
  91.                                 Wait for Connection (go back to start)
  92.  
  93. Definitions of Commands and Replies
  94.  
  95.    Summary of Commands and Replies
  96.  
  97.       Commands                          Replies
  98.       --------                          -------
  99.       USER name                         +OK
  100.       PASS password                     -Error
  101.       RETR mailbox                      #xxx
  102.       RDEL mailbox
  103.       RCEV
  104.       RCVD
  105.       QUIT
  106.       NOOP
  107.       RSET
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. Reynolds                                                        [Page 2]
  116.  
  117.  
  118.  
  119. Post Office Protocol                                             RFC 918
  120.  
  121.  
  122.    Commands
  123.  
  124.       USER name
  125.  
  126.          This command identifies the user to the server.  It must be
  127.          followed by the PASS command.
  128.  
  129.             Possible responses:  "+OK" or "-ERR"
  130.  
  131.       PASS password
  132.  
  133.          The PASS command carries the password authenticating this user.
  134.          Together the USER name and PASS password are used by the server
  135.          to control access to the mailboxes.
  136.  
  137.             Possible responses:  "+OK" or "-ERR"
  138.  
  139.       RETR mailbox
  140.  
  141.          This command begins a mail reading transaction.  The RETR
  142.          command is used to read all the messages in a mailbox without
  143.          deleting them.  It must be followed by the RCEV command.
  144.  
  145.             Possible responses:  "#xxx" or "-ERR"
  146.  
  147.       RDEL mailbox
  148.  
  149.          This command begins a mail reading transaction.  The RDEL
  150.          command is used to read all the messages in a mailbox and
  151.          delete them.  It must be followed by the RCEV command.
  152.  
  153.             Possible responses:  "#xxx" or "-ERR"
  154.  
  155.       RCEV
  156.  
  157.          This command confirms that the client is ready to receive the
  158.          mail data.  It must be followed by the RCVD command.
  159.  
  160.             Possible responses:  "+OK" or (connection aborted)
  161.  
  162.       RCVD
  163.  
  164.          This command confirms that the client has received and accepted
  165.          the mail.  The RCVD command ends the mail reading transaction.
  166.          In the case of the RDEL transaction, it is possible that the
  167.          mail is not necessarily deleted.  This is indicated by an error
  168.          reply.
  169.  
  170.             Possible responses:  "+OK" or "-ERR"
  171.  
  172.  
  173. Reynolds                                                        [Page 3]
  174.  
  175.  
  176.  
  177. Post Office Protocol                                             RFC 918
  178.  
  179.  
  180.       QUIT
  181.  
  182.          This command indicates the client is done with the session.
  183.          The server sends an OK response and then closes the connection.
  184.  
  185.             Possible responses:  "+OK" then Close
  186.  
  187.       NOOP
  188.  
  189.          This is the no operation command.  It causes no action on the
  190.          part of the server except an OK response.
  191.  
  192.             Possible response:  "+OK"
  193.  
  194.       RSET
  195.  
  196.          This command causes the server to abort the current transaction
  197.          and return to waiting for a command (one of RDEL, RETR, QUIT,
  198.          NOOP, or RSET).  When aborting a transaction the server must
  199.          take care to properly close and unlock the mailbox.
  200.  
  201.             Possible response:  "+OK"
  202.  
  203. Acknowledgment
  204.  
  205.    I would like to acknowledge the contributions of Jon Postel, Joel
  206.    Goldberger, Dale Chase, and Michael Butler in the development of the
  207.    Post Office Protocol.
  208.  
  209. References
  210.  
  211.    [1]  Postel, J., "Simple Mail Transfer Protocol", RFC-821,
  212.    USC/Information Sciences Institute, August 1982.
  213.  
  214.    [2]  Crocker, D., "Standard for the Format of ARPA-Internet Text
  215.    Messages", RFC-822, University of Delaware, August 1982.
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231. Reynolds                                                        [Page 4]
  232.  
  233.  
  234.  
  235. Post Office Protocol                                             RFC 918
  236.  
  237.  
  238. Diagram
  239.          +---+      +---+       +---+       +---+       +---+      
  240.    Open  |   | +OK  |   |       |   | +OK   |   |       |   | +OK  
  241.    ----->| S |--+-->| C |------>| S |------>| C |------>| S |---->+
  242.          |   |  ^   |   | USER  |   |       |   | PASS  |   |     |
  243.          +---+  |   +---+       +---+       +---+       +---+     |
  244.                 |                 | -ERR                  | -ERR  |
  245.                 |                 V                       V       |
  246.    +<-----------+<----------------+<----------------------+       |
  247.    |                                                              |
  248.    V      +---+       +---+                                       |
  249.    +----->|   | QUIT  |   | +OK                                   |
  250.           | C |------>| S |----->Close                            |
  251.    +----->|   |       |   |                                       |
  252.    ^      +---+       +---+                                       |
  253.    |                                                              V
  254.    +<-------------------------------------------------------------+
  255.    |                                                              ^
  256.    |  +---+     +---+      +---+     +---+     +---+     +---+    |
  257.    |  |   |RETR |   | #xxx |   |RECV |   |DATA |   |RCVD |   |+OK |
  258.    +->| C |---->| S |----->| C |---->| S |---->| C |---->| S |--->+
  259.    |  |   | or  |   |      |   |     |   |     |   |     |   |    ^
  260.    |  +---+ RDEL+---+      +---+     +---+     +---+     +---+    |
  261.    |              | -ERR     |         |         |         | -ERR |
  262.    |              V          |         V         |         |      |
  263.    +<-------------+          |       Abort       |         |      |
  264.    |                         V                   V         V      |
  265.    |        +<---------------+-------------------+         +----->+
  266.    |        V                                                      
  267.    |      +---+       +---+                                        
  268.    |      |   | RSET  |   | +OK                                    
  269.    +----->| C |------>| S |----->+                                 
  270.    |      |   |       |   |      |                                 
  271.    |      +---+       +---+      |                                 
  272.    |                             V                                 
  273.    +<----------------------------+                                 
  274.    |                             ^                                 
  275.    |      +---+       +---+      |                                 
  276.    |      |   | NOOP  |   | +OK  |                                 
  277.    +----->| C |------>| S |----->+                                 
  278.           |   |       |   |                                        
  279.           +---+       +---+                                        
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289. Reynolds                                                        [Page 5]
  290.  
  291.