Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the processing status of Pop3 protocol

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly talks about "what is the processing status of the Pop3 protocol". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the processing status of the Pop3 protocol?"

1. Basic operation

Initially, the server starts the POP3 service by listening on TCP port 110. When the customer host needs to use the service, it establishes an TCP connection with the server host. When the connection is established, POP3 sends a confirmation message. The client and the POP3 server exchange commands and responses with each other until the connection is terminated.

The POP3 command consists of a command and some parameters. All commands end with a CRLF pair. Commands and arguments are made up of printable ASCII characters separated by spaces. Commands are usually three to four letters, but each parameter can be up to 40 characters long.

The POP3 response consists of a status code and a command that may have additional information. All responses are also terminated by CRLF pairs. There are now two status codes, "OK" ("+ OK") and "failure" ("- ERR").

The response to a specific command is made up of many characters. In these cases, the following statement is made: after the first line of response and a CRLF are sent, any additional lines of information are sent, and they are also terminated by the CRLF pair. When all messages are sent, the last line is sent, including an ending character (decimal code 46, that is, ".") and a CRLF pair. If any line in the message begins with an end character, the line is populated by preloading the end on that line. Therefore, the multiline response ends with five CRLF.CRLF. When a multiline response is detected, the customer detects to confirm whether the line begins with an ending character. If yes, and the character that follows is not CRLF, the first character (ending character) of this line is discarded; if it is followed by CRLF, the response from the POP server terminates, and the line including .CRLF is no longer considered part of the multiline response.

POP3 sessions have several different states during the lifecycle. Once the TCP connection is opened and the POP3 server sends a confirmation message, the process enters the "confirm" state. In this state, the customer must confirm to the POP3 server that he or she is their customer. Once the success is confirmed, the server acquires the resources related to the customer's mail, and the process enters the "operation" state. In this state, the customer proposes the service, and when the customer issues the QUIT command, the process enters the "update" state. In this state, the POP3 server releases the resources obtained in the Action state and sends a message to terminate the connection.

The POP3 server can have a timer that automatically logs out. This timer must be able to record at least 10 minutes. In this way, messages sent from the customer can refresh this timer. When the timer fails, the POP3 session does not enter the "update" state, but closes the TCP connection without deleting any message or sending any response to the customer.

2. "confirm" status

For a moment, the TCP connection is opened by the POP3 client, and the POP3 server sends a single-line confirmation. This message can be any character that ends with CRLF. For example, it can be:

S: + OK POP3 server ready

Note: this message is an POP3 reply. The POP3 server should give an "OK" response as an acknowledgement.

At this point, the POP3 session enters the confirm state. At this point, the customer must prove its identity to the server. Two possible processing mechanisms are described in the document, one is the USER and PASS commands, and the other is the APOP command that will be described later.

To perform the confirmation process with the USER and PASS commands, the customer must first send the USER command, and if the POP3 server responds with an "acknowledge" 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 "failure" status code, the customer can send a confirmation command or a QUIT command.

When the customer sends the PASS command, the server decides whether to allow access to the corresponding stored mail based on the additional information of the USER and PASS commands.

Once the server decides to allow the customer access to the stored message through this data, the server adds an exclusive lock on the message to prevent changes to the message before entering the "update" state. If the exclusive lock is successfully obtained, the server returns a confirmation status code. The session entered the operational state, and no messages were marked for deletion. If the message cannot be opened for some reason (for example, the exclusive lock cannot be obtained, the customer cannot access the corresponding message, or the message cannot be parsed), the server returns a failure status code. After returning the failure status code, the server closes the connection. If the server does not close the connection, the customer can resend the confirmation command, restart, or send the QUIT command.

After the server opens the message, it assigns a message number to each message and represents the length of each message in octal. The first message is specified as 1, the second message is specified as 2, and so on, the Nth message is specified as N. In POP3 commands and responses, all message numbers and lengths are expressed in decimal.

4. "Operation" status

Once the client successfully confirms his identity to the server, the server locks and opens the corresponding message, and the POP3 session enters the "operation" state. Now the customer can repeat the following POP3 command, and a reply will be returned for each command server. Finally, the customer sends a QUIT command, and the session enters the "update" state.

The following commands are available in the Action state:

5. 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 confirm state, the session does not enter the Update state. )

If the session is interrupted for reasons other than the QUIT command, the session does not enter the "update" state, nor does it delete any messages from the server.

At present, most mail encryption products in the market need to re-register a mailbox or redeploy a mail system, resulting in the original mailbox can not be used, that is to say, users need to change their habits. It is difficult for large companies to upgrade their mail systems.

It is a good choice to choose email encryption products that are transparent to users. For example, the secret mail launched by Tianyu Yunan ensures that the email content is encrypted, and the deployment is also transparent to users, which can be said to be very user-friendly.

At this point, I believe you have a deeper understanding of "what is the processing status of the Pop3 protocol?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report