POP3 protocol command source code and working principle

Source: Internet
Author: User
Tags md5
Http://www.linuxforum.net Jephe Wu (18:17:49)
1 Introduction:
1. POP is applicable to the offline model email protocol of the C/S structure. It has been developed to the third edition, POP3. Offline models cannot be Online
Unlike IMAP4 (netscape supports IMAP4)
2. When the client connects to the server and queries new emails, all emails that will be downloaded specified by the client will be downloaded
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 is indicated by ASCII text + OK or-ERR.
The operation status is successful or failed.
4. There are three statuses in POP3 protocol: approval status, processing status, and update status.
When the client establishes a connection with the server, once the client provides its own identity and is successfully confirmed, it is transferred from the recognized status to the processing status,
After the corresponding operation is completed, the client issues the quit command and enters the update status. After the update, the client returns to the approval status. See the following figure.
Wait for the quit command to confirm the connection identity
-- | Approval | ----- | processing | ------ | update |
| __________________________________ |
Return to approval status
5. Command statements in the approval status
Generally, most existing POP3 customers and servers use ASCII plain text to send user names and passwords, and are in the recognized status.
When the customer connects, the customer issues a connection and sends the plaintext user name and password to the server through the command user/pass.
Confirm your identity. 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 you connect to the server for the first time, the POP3 server sends an ASCII greeting to the client, which consists of a string of characters for each customer.
The user is unique and related to the time. Then, the client attaches its plain text password to the string received by the server,
Then calculate 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.
Go out.
Currently, most mail client software on windows does not support APOP commands, and qpopper does.
6. The POP3 command code is as follows:
Command parameter status description

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.