POP3 Post Office Agreement - Version 3 1. Introduction For a relatively small node on the network, the support message transfer system (MTS) is not practical. For example, a workstation may not have sufficient resource to allow SMTP servers and a comparable local mail transfer system to remain resident and continue to run. Similarly, the cost of connecting a personal computer for a long time in the IP type network is also considerable (resource for nodes is called "liability"). Noneto, it is very useful to allow administrative emails on such a summary point, and these nodes often support one user agent to manage messages. To solve this problem, it is possible to support MTS's nodes to provide mail storage features for these unfilled nodes. The post office protocol - Version 3 thus enables such a workstation to access the storage mail stored on the server with a relatively practical approach. Usually, this means that the workstation can get the message from the server, and the server is temporarily saved for mail. Hereinafter, the client host refers to the host using the POP3 service, and the server host refers to a host that provides a POP3 service. 2. Brief Description Do not specify how the customer host is sent to the transfer system in this document. Here is an explanation here: When the user agent needs to send the information to the transfer system, it establishes SMTP connections on the relay host (these relay host can be a POP3 host, or may not be). 3. When the basic operation is initially, the server starts POP3 service by listening to TCP port 110. When the client host needs to use the service, it will establish a TCP connection with the server host. When the connection is established, POP3 sends a confirmation message. Customer and POP3 servers (separate) exchange commands and responses, this process has always been continued to terminate. The pop3 command consists of a command and some parameters. All commands end in a CRLF pair. Commands and parameters consist of printed ASCII characters, which are spaced between spaces. Commands are generally three to four letters, and each parameter can reach 40 characters. The POP3 response consists of a status code and a command that may follow additional information. All responds are also ended by CRLF pairs. There are now two status codes, "determination" (" OK") and "fail" ("-err"). The response to a particular command is made up of many characters. In these cases, the following statement: Any additional information line is transmitted after sending a first row response and a CRLF, and they are also ended by the CRLF. When all the information is transmitted, the last line is sent, including an end character (decimal code 46, which is ".") And a CRLF pair. If any of the lines in the information starts with end characters, this line is filling by the end of the end of the line. Therefore, multi-line response is ended by five CRLF.CRLF. When a multi-row response is detected, the customer is detected to confirm whether the line begins with the end character. If yes, and after the characters are not CRLF, the first character (end character) of this row will be abandoned; if it followed the CRLF, the response from the POP server terminates, including .crlf's row is not It is considered part of the multi-line response. In the life cycle, POP3 sessions have several different states. Once the TCP connection is opened, and the POP3 server sends a confirmation information, this process enters the "confirmation" state. In this state, the customer must confirm that it is its customer to the POP3 server. Once the confirmation is successful, the server gets resources related to the customer mail, and this process enters the "operation" state. In this state, the customer puts forward the service when the customer issues a Quit command, and this process enters the "Update" state. In this state, the POP3 server is released in the "Operation" state, and the message is sent, and the connection is terminated.
The POP3 server can have a batch that automatically exits the login. This timer must be at least 10 minutes. This will be refreshed from the message sent from the customer. When the timer is invalid, the POP3 session does not enter the "update" status, but close the TCP connection, and does not delete any messages and do not send any responses to customers. 4. "Confirm" Status For a time TCP connection is opened by POP3, and the POP3 server sends a single line of confirmation. This message can be any character over the CRLF. For example, it can be: S: OK POP3 Server Ready Note: This message is a POP3 response. POP3 servers should give a "determination" response as an acknowledgment. At this point, the POP3 session enters the "confirmation" state. At this point, the customer must prove its identity to the server. In the documentation, two possible processing mechanisms are introduced, one is the user and pass commands, the other is the apop command to be introduced later. Use the user and pass command to confirm the process, the customer must first send the user command, if the POP3 server responds to the "confirm" status code, the customer can send the pass command to complete the confirmation, or send the quit command to terminate the POP3 session. If the POP3 server returns a "failed" status code, the customer can send a confirmation command, or send the quit command. When the customer sends a pass command, the server determines whether to allow access to the corresponding storage email based on the additional information of the user and pass commands. Once the server is determined by these data to allow the customer to access the mail, the server adds a row lock on the message to prevent changes in the mail before entering the "update" state. If the row lock is successfully obtained, the server returns a "confirmation" status code. The session enters the "Operating Status" and does not have any messages to be marked as delete. If a message cannot be opened because some reason can be opened (for example, the lock can not be obtained, the customer cannot access the corresponding message or mail cannot be gramatic analysis), the server will return "failed" status code. After returning the "failed" status code, the server will turn off the connection. If the server does not turn off the connection, the customer can resend the confirmation command, start, or send the quit command. After the server opens the message, it specifies a message number for each message and represents the length of each message with an octave. The first message is specified as 1, and the second message is specified as 2, so that the nth message is specified as N. In the POP3 command and response, the message number and length is represented in decimal. The following is a summary of the above three commands:
Command format parameter limit Response Example User Name Specifies the string of the mailbox, which is critical to the server only after the user and pass command fails or in the "confirmation" status OK: effective mailbox; -ERR: invalid mailbox C: user Mrose S: OK MROSE IS A REAL HOOPY FROOD ... C: User Frated S: -err sorry, no mailbox for Frated Herepass String Password only in the "confirm" status (because this command has only one parameter Therefore, the space is no longer a separator, and as part of the password OK: mail is ready; -RR invalid password or unable to lock mail C: user mroky s: Ok MROSE IS A REAL HOOPY FROOD C : Pass Secret S: Ok Mrose's Maildrop Has 2 Messages (320 OCTS) ... C: User Mrose S: Ok Mrose Is A Real Hoopy Frood C: Pass Secret S: -ERR MAILDROP ALREADY LOCKEDQUIT (None) OKC: Quit S: OK DEGEY POP3 Server Signing Off 5. "Operation" Status Once the customer successfully confirms its identity to the server, the server will lock and open the corresponding message, then the POP3 session enters the "Operation" status . Now customers can repeat the POP3 command below, and they will return to each command server. Finally, the customer sends a quit command, the session enters the "Update" status. Here is the command available in the "Operation" state:
Command Parameter Limit Description Response Example Stat is available only in the "operation" state. The server is "confirmed" in response to mail information. To simplify grammar analysis, all servers require a specific format of the mailing list. "Confirm" responds by a space, a space and mail size indicated by an octal representation. This is the minimum implementation, and advanced implementation requires other information. Note: The letters marked as deleted are not here. OK: NN MMC: Stat S: OK 2 320List [MSG] The number of letters (optional), if there is, not including letters marked as deletion. Only available in the "operation" state. If the parameters are given, and the POP3 server returns a "confirmation" including the above information, the line is referred to as "scanning table". If there is no parameters, the server returns "confirm" response, which is given more than many lines. After the initial OK, the server gives the corresponding response for each letter. To simplify the grammatic analysis, all servers require a specific format of the scan table. It includes spaces, the exact size of each message. This is the minimum implementation, and advanced implementation requires other information. Note: The letters marked as deleted are not here. OK: After followed by the table; -ERR: No scan. C: List s: OK 2 Messages (320 OCTES) S: 1 120 S: 2 200 s: ... C: List 2 S: OK 2 200 ... C: List 3 s: -err no such Message, Only 2 Messages In MaildropRetr MSG does not include the number of letters marked as delete. Only available in the "operation" state. If the server returns "confirm", the response given is multi-line. After the initial OK, the server sends information corresponding to the given information number, pays attention to the byte fill terminator for multi-line responses. OK: The message is after the next; -ERR: There is no message thereafter. C: Retr 1 S: OK 120 OCTS S:
Command Parameter Limit Description Response Example Quit (None) The server deletes all the letters marked as deleted, then releases the lock lock and returns the status code of these operations. Finally, the TCP connection was interrupted. OKC: Quit S: OK DEEY POP3 Server Signing Off (Empty Tag Mail) ... C: Quit S: OK DEGEY POP3 Server Signing Off 7. Optional POP3 commands The commands discussed above are the minimum for POP3 services. achieve. The optional commands described below allow customers to more easily process letters, which is a relatively general POP3 service implementation.
Command Parameter Limit Description Response Example TOP MSG N is the number of letters that are not marked as delete, and the other is a non-negative number (must be provided) only in the "operation" state. If the server returns "confirm", the response is multi-line. After the initial OK, the server sends a letter head, one space separated the letter header and the letter, and pay attention to the byte fill terminator for multi-line responses. Note: If the number of rows required by the customer is larger than the number of rows in the letters, the server will send the entire letter. OK: There is a letter header; -ERR: There is no similar message thereafter. C: TOP 1 10 S: OK S:
S: OK POP3 server ready <1896.697170952@dbc.mtview.ca.us> C: APOP mrose c4c9334bac560ecc979e58001b3e22fb S: OK maildrop has 1 message (369 octets) In this example, the shared key <1896.697170952@dbc.mtview. CA.us> TanSTAAF is generated by the MD5 algorithm, which produces a Digest value, C4C9334BAC560ECC979E58001BAC560ECC979E58001BAC560ECC979E58001B3E222FB 8. POP3 command summary foundation POP3 command: user name In "Confirm" Status Valid Pass String Quit Stat In "Operation" status List [MSG] Retri MSG Dele Msg NOOP RSET Quit In "Update" status Valid optional pop3 command: APOP Name Digest In "Confirm" Status Top Msg N In "Operation" Status Valid UIDL [MSG] POP3 Response: OK -ERR Note: In addition to In addition to the response of STAT, LIST, and UIDL, the response of other commands is " ok" and "-err". All text after the response will be ignored by the client. 9. POP3 session example S: