POP3 protocol command source code and working principle

Source: Internet
Author: User
The offline model of the DownloadFilesS structure has been developed to the third edition, POP3. Offline models cannot be operated online, unlike IMAP4 (netscape supports IMAP4) 2. when the client connects to the server and queries new emails, all emails specified by the client that will be downloaded by SyntaxHighlighter

The offline model of the DownloadFilesS structure has been developed to the third edition, POP3. Offline models cannot be operated online, unlike IMAP4 (netscape supports IMAP4) 2. when the client connects to the server and queries new emails, all emails specified by the client that will be downloaded to the client. after the download, the email client can delete or modify any email without further interaction with the email server. 3. the POP3 client sends a command to the POP3 server and waits for a response. The POP3 command adopts the command line format and uses ASCII code. A server response is composed of a single command line or multiple command lines, the first line of the response uses ASCII text + OK or-ERR to indicate whether the operation is successful or failed. the POP3 protocol has three statuses: approval status, processing status, and update status. When the client establishes a connection with the server, once the client provides its own identity and successfully confirms the status, it is transferred from the recognized status to the processing status. after the corresponding operations are completed, the client issues the quit command, then the system enters the update status and returns to the approval status after the update. For example, wait for the quit command to confirm the connection identity -- | accept | ----- | handle | ------ | update | ______________________________ | return to the approval status 5. in general, most existing POP3 customers and servers use ASCII plain text to send user names and passwords, and send connections when the customer is in a recognized status or waiting for connection, the command userpass sends the plaintext user name and password on the network to the server for identity confirmation. Once confirmed, it is transferred to the processing status. To avoid sending plaintext passwords, there is a new authentication method. the command is APOP and the password is encrypted before transmission. When connecting to the server for the first time, the POP3 server sends an ASCII greeting to the client. This greeting is composed of a string of characters and is unique to each client. it is related to the time at that time, then, the client attaches its plain text password to the string received by the server, and then calculates the MD5 single-output function message digest of the result string, the client sends the user name and MD5 message digest together as parameters of the APOP command. Currently, most mail client software on windows does not support APOP commands, and qpopper does. 6. POP3 command code: command parameter status description ------------------------------------------------ USER username recognizes that this command and the following pass command are successful, which leads to status conversion PASS password recognition APOP Name, digest recognizes that Digest is the MD5 message Digest ------------------------------------------ STAT None processes the request server to send back mailbox statistics, such as the total number of emails and total bytes UIDL [Msg #] the unique identifier for processing the returned mail, each identifier of a POP3 session will be the unique LIST [Msg #] number of returned mails processed and the size of each email RETR [Msg #] process and return all text DELE of the email identified by the parameter [Msg #] The processing server marks the email marked by the parameter as deleted, run the quit command to run RSET The None processing server resets all emails marked as deleted. it is used to undo the TOP [Msg #] DELE command. the processing server returns the first n lines of Mail marked by parameters, n must be a positive integer NOOP None. the processing server returns a positive response ---------------------------------------- QUIT None update. the client wants to end the session B. if the server is in the 'process' status, it will enter the 'update' status to delete any emails marked as deleted. changes from the processing status to the update status and returns to the approval status d. if the server is in the 'approval' status when the command is issued, the session ends without 'update. 7. POP3 protocol waits for the customer connection request on the TCP110 port. 8. if the password is plain text, how can I listen? The following command shows the POP3 connection and command sending process on the screen after the server runs: # sniffit-a-. -p 110-B-s 192.169.11.12 note @ 192.168.11.12 is the client IP address. you need to install the sniffit port listening program 9 in advance. in this case, if the customer is receiving 15 emails waiting for receiving, but due to line problems, the customer is disconnected when receiving 10th emails, why does the last 10 emails still start from the first one, that is, why are they not deleted from the server? All emails must be deleted after the quit command is sent. emails marked as deleted are still in the processing status due to disconnection, there is no chance to execute the quit command to convert the status. 10. pop3 session is locked by another session, please wait 10 minutes then try again. due to abnormal operations, the internal mechanism of the POP3 program locks this session. 11. the processing mechanism of Foxmail and OE (outlook express) is different. A. assume that there are three emails waiting for the client to receive on the server. The difference between foxmail and OE is that each mark received by foxmail deletes one, while OE marks all received records as deleted and finally executes the quit command. Foxmail OE ------------------------------- retr 1 retr 1 dele 1 retr 2 retr 2 retr 3 dele 2 dele 1 retr 3 dele 2 dele 3 dele 3 quit B. foxmail remote mail management is an excellent management tool. assume that there are three emails on the server. for the first one, we do not want to receive them and want to delete them directly from the server. for the second one, if you want to receive but do not delete the third message, you do not want to receive it this time. after marking them, The Last Command sent by foxmail is dele 1 retr 2 quit c. if there is no foxmail, just a few large emails are blocked. I don't want to accept it. I want to delete it directly or check who sent the two emails? Run the command line in the DOS window of windows, for example: # telnet my.isp.net 110 user username pass password list dele 3 dele 5 quit Jephe Wu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.