RFC1939-POP3 protocol Chinese version

zhaozj2021-02-08  243

1. Brief introduction For a smaller node on the network, the support message transmission 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: 5. Operation state Once the customer successfully confirms its identity to the server, the server will lock and open the corresponding message, and the POP3 session enters the "Operation" state. 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: 6. "Update" Status When the customer sends the quit command in the "Operation" state, the session enters the "Update" state. (Note: If the customer sends QUIT in the "confirmation" state, the session does not enter the "update" state.

If the session is interrupted because the reason for the quit command is interrupted, the session does not enter the "update" status, nor does any letters from the server. 7. Optional POP3 commands The commands discussed above are minimal implementations for POP3 services. The optional commands described below allow customers to more easily process letters, which is a relatively general POP3 service implementation. . Top Msg N [Parameter] One is not marked as deleted, the other is a non-negative number (must be provided) [restriction] is only used in "operation". [Description] 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. [Response] OK: There is a letter header; -ERR: There is no similar message thereafter. [Example] C: TOP 1 10 S: OK S: s: ... C: TOP 100 3 s: -err no sudh message. UIDL [MSG] [Parameter] The number of letters (optional). If the number of letters is given, the letter marked as deletion is not included. [Restriction] Use only in the "operation" state. [Description] If the parameters are given, and the POP3 server returns "confirmation" including the above information, the line is referred to as "independent-ID 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. This line is called the "independent-ID table" of the letter. To simplify the grammatic analysis, all servers require a specific format of the independent-ID table. It includes independent-ID of spaces and letters. The independent -ID of the letter consists of 0x21 to 0x7e character, which will not be repeated in a given storage message. Note: Letters do not include letters marked as delete. [Response] OK: thereafter is independent-ID table; -ERR: There is no similar letter thereafter. [Example] C: UIDL S: OK S: 1 WHQTSWO00WBW418F9T5JXYWZ S: 2 QHDPYR: 00WBW1PH7X7 S: 00w1ph7x7 s: ... C: UIDL 2 S: OK 2 QHDPYR: 00WBW1PH7X7 ... C: UIDL 3 S: -ERR NO Such Message, ONLY 2 Messages in maildrop. APOP Name Digest [Parameter] Specifies the string of the mailbox and the MD5 summary string. [Restriction] Use only in the "confirmation" state after POP3 confirmation. [Description] Usually, each POP3 session begins with user / pass interchange. This leads to explicit transmission of username and password on the network, which will not cause any danger. However, many customers are often connected to service check letters. Usually the interval is relatively short, which increases the possibility of leakage. Another way to provide a "confirm" process is to use the APOP command. The server that implements the APOP command includes a timestamp confirmed by a tag. For example, using the syntax of the APOP command on UNIX: Process-id.clock@hostname, where the process-ID is the decimal number of the process, the clock is the decimal representation of the system clock, the host name is consistent with the POP3 server name. The client records this timestamp, then to send the apop command.

The Name syntax is consistent with the USER command. Digest is a string that includes the timestamp and shared key generated by the MD5 algorithm. This key is a customer and server condominations. You should pay attention to protect this key. If you discise, anyone can enter the server as a user. If the server is connected to the APOP command, it verifies Digest, if correct, the server returns "confirm" and goes to "Operation" status; otherwise, give "failure" and stay in the "confirmation" state. Note: The length of the shared key is increased, and the difficulty of interpretation is also increased accordingly. This key should be a long string. [Response] OK: Mail is locked and ready; -ERR: Reject the request. [Examples] 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, C4C9334BAC560ECC979E58001B3E22FB

转载请注明原文地址:https://www.9cbs.com/read-1612.html

New Post(0)