RFC 918
Post Office Protocol
POST OFFICE PROTOCOL π
Title block, the tea β
- RFC: 918
- Title: POST OFFICE PROTOCOL
- Author: J. K. Reynolds, ISI
- Date: October 1984
- Status: experimental, a proposed protocol for the ARPA-Internet community π§ͺ
- Obsoletes / Updates: nothing listed, so this one isn't replacing or patching any other RFC π«Ά
Status of this Memo
Okay so this RFC is basically suggesting a simple way for workstations to dynamically grab mail from a mailbox server π¬ It's a proposed protocol for the ARPA-Internet community, and the author is literally begging for discussion and suggestions to make it better π₯Ή
Introduction
The whole point of the Post Office Protocol (POP) is to let a user's workstation access mail from a mailbox server π¦ Mail is expected to be posted from the workstation to the mailbox server through the Simple Mail Transfer Protocol (SMTP). If you want the deets on that, check out RFC-821 [1] and RFC-822 [2] π
Its status is experimental, and it depends on TCP π§΅
The Protocol
The server is the one waiting around for a connection π When a connection opens, the server sends a greeting and then waits for commands. When commands come in, it acts on them and sends back replies π
The client opens a connection and waits for that greeting, then sends USER and then PASS to get authorized to access mailboxes π Next, the client starts a mail reading transaction with either RDEL (read and delete all messages from a mailbox) or RETR (just read all the messages without deleting anything) π₯ The server opens and locks the mailbox and replies with the number of characters in it π Then the client asks for the data by sending RCEV, and the server sends the mail data π Once all the data has arrived, the client sends RCVD. If the transaction started with RDEL, the server now deletes the mail data from the mailbox ποΈ Either way, the server closes and unlocks the mailbox π Finally, the client ends the session with QUIT π
The Normal Scenario
It's giving sequence diagram energy π€©
Client Server
------ ------
Wait for Connection
Open Connection -->
<-- +OK
Wait for Command
USER Fred -->
<-- +OK
Wait for Command
PASS password -->
<-- +OK
Wait for Command
RDEL mailbox --> (open and lock mailbox)
<-- #xxx
Wait for Command
RCEV -->
<-- (send a copy of mail)
Wait for Command
RCVD --> (deletes mail from mailbox, unlock
and close mailbox)
<-- +OK
Wait for Command
QUIT -->
<-- +OK
Close connection --> <-- Close connection
Wait for Connection (go back to start)
Definitions of Commands and Replies
Here's where it gets spicy πΆοΈ This is the official list of everything you can say and everything you can get back π
Summary of Commands and Replies
Commands Replies
-------- -------
USER name +OK
PASS password -Error
RETR mailbox #xxx
RDEL mailbox
RCEV
RCVD
QUIT
NOOP
RSET
Commands
USER name
This command identifies the user to the server πͺͺ It MUST be followed by the PASS command, no exceptions bestie π«
Possible responses: +OK or -ERR β¨
PASS password
PASS carries the password that authenticates this user π Together, the USER name and PASS password are how the server controls access to the mailboxes π°
Possible responses: +OK or -ERR β¨
RETR mailbox
This command starts a mail reading transaction π RETR is for reading all the messages in a mailbox without deleting them πΈ It MUST be followed by the RCEV command π
Possible responses: #xxx or -ERR β¨
RDEL mailbox
This command also starts a mail reading transaction π§Ή RDEL reads all the messages in a mailbox AND deletes them, so be careful with it π It MUST be followed by the RCEV command π
Possible responses: #xxx or -ERR β¨
RCEV
This one is the client's "I'm ready, send it" moment π It confirms the client is ready to receive the mail data. It MUST be followed by the RCVD command π
Possible responses: +OK or (connection aborted) π
RCVD
RCVD confirms that the client has received and accepted the mail π¬ It ends the mail reading transaction π With an RDEL transaction, the mail is not necessarily deleted. That shows up as an error reply, so check your replies π
Possible responses: +OK or -ERR β¨
QUIT
QUIT means the client is done with the session π The server sends an OK, then closes the connection πͺ
Possible response: +OK then Close π¦
NOOP
NOOP is the no operation command, which means it does absolutely nothing except send back an OK π΄ Iconic behavior, honestly π
Possible response: +OK β¨
RSET
RSET makes the server abort the current transaction and go back to waiting for a command (one of RDEL, RETR, QUIT, NOOP, or RSET) π When aborting, the server MUST take care to properly close and unlock the mailbox π No leaving things hanging, periodt π
Possible response: +OK β¨
Acknowledgment
The author wants to give a big shoutout to Jon Postel, Joel Goldberger, Dale Chase, and Michael Butler for helping develop the Post Office Protocol π«Άπ
References
[1] Postel, J., "Simple Mail Transfer Protocol", RFC-821, USC/Information Sciences Institute, August 1982. π
[2] Crocker, D., "Standard for the Format of ARPA-Internet Text Messages", RFC-822, University of Delaware, August 1982. π
Diagram
Here's the whole flow in one picture, and it's giving main character energy π¦
+---+ +---+ +---+ +---+ +---+
Open | | +OK | | | | +OK | | | | +OK
----->| S |--+-->| C |------>| S |------>| C |------>| S |---->+
| | ^ | | USER | | | | PASS | | |
+---+ | +---+ +---+ +---+ +---+ |
| | -ERR | -ERR |
| V V |
+<-----------+<----------------+<----------------------+ |
| |
V +---+ +---+ |
+----->| | QUIT | | +OK |
| C |------>| S |----->Close |
+----->| | | | |
^ +---+ +---+ |
| V
+<-------------------------------------------------------------+
| ^
| +---+ +---+ +---+ +---+ +---+ +---+ |
| | |RETR | | #xxx | |RECV | |DATA | |RCVD | |+OK |
+->| C |---->| S |----->| C |---->| S |---->| C |---->| S |--->+
| | | or | | | | | | | | | | ^
| +---+ RDEL+---+ +---+ +---+ +---+ +---+ |
| | -ERR | | | | -ERR |
| V | V | | |
+<-------------+ | Abort | | |
| V V V |
| +<---------------+-------------------+ +----->+
| V
| +---+ +---+
| | | RSET | | +OK
+----->| C |------>| S |----->+
| | | | | |
| +---+ +---+ |
| V
+<----------------------------+
| ^
| +---+ +---+ |
| | | NOOP | | +OK |
+----->| C |------>| S |----->+
| | | |
+---+ +---+
π¦ where this page comes from
- ietf: rfc918 1984-10
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms