POP3 protocol command original code and working principle

xiaoxiao2021-04-01  223

POP3 protocol command original code and working principle reprint

POP3 protocol command original code and working principle

2001-10-23 07:56

Publisher: NetBull Readings: 878

Introduction:

1. POP is available for an email protocol for offline models of C / S structure, currently developed

To the third edition, called POP3. Offline model is not online, unlike IMAP4

(Netscape supports IMAP4)

2. When the client is connected to the server and query the new email, by the client

All messages that will be downloaded will be downloaded to the client, after downloading,

Email clients can delete or modify arbitrary messages without email

The server is further interacting.

3. POP3 customers send commands to the POP3 server and wait for a response, POP3 commands

Command line form, represented by ASCII code.

The server response is composed of a separate command line, or multiple command lines, sound

The corresponding operation status is successful at the first line according to ASCII text OK or -ERR.

Failed

4. There are three states, accredited status, processing status, and update status in the POP3 protocol.

When the client is established with the server, once the client provides yourself and

The power confirmation, that is, transferred from the recognized state to the processing state, and the corresponding operation

The hoe issued a Quit command, then enters the update state, and then returns the recognition after the update

status. As shown below

Waiting for the connection identity to confirm the quit command

- | Approve | ----- | Hand | ------ | Update |

| _________________________________ |

Return to recognize

5. Command statement of the recognized state

Under normal circumstances, most existing POP3 customers are implemented using ASCII

Text send username and password, in recognizes, etc.

When the customer is connected, the customer issues a connection, and is sent by the command user / pass to send a plaintext username and password to the server.

Perform identity confirmation. Once the confirmation is successful, turn to the processing status.

In order to avoid the issuance of the expressing text, there is a new authentication method, the command is

APOP, using the APOP, password being encrypted before transfer.

When the first time is connected to the server, the POP3 server sends an ASCII to the client.

Code greetings, this greeting is unique to each client by a string character.

Time time is related, then, the client attaches its plain text password to the slave

After receiving the string, then calculate the MD5 single-out function message of the result string

Abstract, the client puts the user name with the MD5 message summary as the parameters of the apop command.

Send out.

Currently, most Windows's mail client software does not support apop commands, QPopper support.

6. The POP3 command code is as follows:

Command parameter status description

------------------------------------------

User UserName Accreditation This command is successful with the following pass command, will result in status conversion

Pass Password approved

APOP NAME, DiGest approved Digest is a summary of MD5 message

------------------------------------------

Stat None Processing Request Server Sends a statistics on the mailbox, such as the total number of emails and total bytes

UIDL [MSG #] Processing the unique identifier returned to the message, each identifier of the POP3 session will be unique

List [MSG #] Processing Returns the number of emails and the size of each message

Retr [MSG #] Processing all texts that return messages identified by the parameter

Dele [MSG #] Processing The server will mark the message named by the parameter to delete, and execute the RSET NONE processing server by the quit command to reset all the mail marked as deleted, used to undo the dele command.

TOP [MSG #] Processing server will return to N-line content in front of the message identified by the parameter, n must be positive integers

NOOOP NONE processing server returns a positive response

------------------------------------------

Quit None update

a. Client hopes to end this session

b. If the server is in 'handling' status, then will enter the 'update' state to delete any marked as deleted

Piece

c. Changes to the processing status to the update state, and returned to the recognized state

d. If this command is issued when the server is in 'recognition' status, end the session, not the 'update' state.

7. The POP3 protocol waits for the customer connection request on the TCP / 110 port.

8. If the password is clear text, how do I listen?

The following command displays the process of displaying the POP3 connection and command on the screen after the server is run:

#nsniffit -a -a. -p 110 -b -s 192.169.11.12

NOTE: 192.168.11.12 is the client IP address

You need to install Sniffit's port listener in advance

9. Consider this situation, if the customer is in charge, it is assumed to wait for the 15th letter waiting to receive, but due to line problems,

By the 10th, it is broken.

Why is the next time I started to start from the first seal, that is, why didn't the first 10 seals are deleted from the server?

Remove the removal of any mail must be deleted after the quit command is issued, due to the middle

Tub-crossline, still

Processing status, there is no chance to execute the Quit command for status conversion.

10. Pop3 session is locked by another session, please wait 10 minutes the then t

Ry again.

Since the abnormal operation causes the internal mechanism of the POP3 program to lock the session.

11. The processing mechanism of Foxmail and OE (Outlook Express) is different.

a. Assume that there are three emails on the server waiting for the client to receive. Different from foxmail and OE lies in

Foxmail deletes a marker, and OE is all labeled as deleting final execution qui.

t 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 quit

b. Foxmail's remote mail management is a very good management tool, assume that there are three letters on the server, and the first seal

, We don't want to receive

I want to delete it directly from the server; for the second seal, I want to receive but don't delete, the third seal, this time I don't want to receive, respectively

Labeled

The last command issued by Foxmail is

Dele 1

Retr 2

quit

c. If there is no foxmail, there is a few big letters. I don't want to receive it, I want to delete it directly, or want

Who is it sent by these two?

Use the command line to operate directly in the Windows DOS window, such as:

# Telnet My.ISP.NET 110

User Username

Pass Password

List

Dele 3

Dele 5

quit

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

New Post(0)