A POP3 client protocol.
Method | __init__ |
Issue deprecation warning. |
Method | apop |
Send an APOP command to perform authenticated login. |
Method | apop |
Perform an authenticated login. |
Method | dele |
Send a DELE command to delete a message from the server. |
Method | handle |
Handle responses from the server for which no other handler exists. |
Method | handle_ |
Handle a server response which is expected to be a server greeting. |
Method | line |
Dispatch a received line for processing. |
Method | list |
Send a LIST command to retrieve the size of a message or, if no message is specified, the sizes of all messages. |
Method | password |
Perform the second half of a plaintext login. |
Method | quit |
Send a QUIT command to disconnect from the server. |
Method | retr |
Send a RETR command to retrieve a message from the server. |
Method | send |
Send a POP3 command to which a long response is expected. |
Method | send |
Send a POP3 command to which a short response is expected. |
Method | uidl |
Send a UIDL command to retrieve the unique identifier of a message or, if no message is specified, the unique identifiers of all messages. |
Method | user |
Send a USER command to perform the first half of a plaintext login. |
Instance Variable | command |
The command most recently sent to the server. |
Instance Variable | mode |
The type of response expected from the server. Choices include none (0), a one line response (1), the first line of a multi-line response (2), and subsequent lines of a multi-line response (3). |
Instance Variable | welcome |
The APOP challenge passed in the server greeting. |
Instance Variable | welcome |
A regular expression which matches the APOP challenge in the server greeting. |
Method | _dispatch |
Dispatch a response from the server for handling. |
Inherited from LineOnlyReceiver
:
Method | data |
Translates bytes into lines, and calls lineReceived. |
Method | line |
Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way. |
Method | send |
Sends a line to the other end of the connection. |
Constant | MAX |
The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped). Default is 16384. |
Class Variable | delimiter |
The line-ending delimiter to use. By default this is b'\r\n'. |
Instance Variable | _buffer |
Undocumented |
Inherited from Protocol
(via LineOnlyReceiver
):
Method | connection |
Called when the connection is shut down. |
Method | log |
Return a prefix matching the class name, to identify log messages related to this protocol instance. |
Class Variable | factory |
Undocumented |
Inherited from BaseProtocol
(via LineOnlyReceiver
, Protocol
):
Method | connection |
Called when a connection is made. |
Method | make |
Make a connection to a transport and a server. |
Instance Variable | connected |
Undocumented |
Instance Variable | transport |
Undocumented |
Handle responses from the server for which no other handler exists.
Parameters | |
line:bytes | A received line. |
Handle a server response which is expected to be a server greeting.
Parameters | |
line:bytes | A received line. |
Dispatch a received line for processing.
The choice of function to handle the received line is based on the type of response expected to the command sent to the server and how much of that response has been received.
An expected one line response to command X is handled by handle_X(). The first line of a multi-line response to command X is also handled by handle_X(). Subsequent lines of the multi-line response are handled by handle_X_continue() except for the last line which is handled by handle_X_end().
Parameters | |
line:bytes | A received line. |
Perform the second half of a plaintext login.
Parameters | |
password:bytes | The plaintext password with which to authenticate. |
Send a USER command to perform the first half of a plaintext login.
Parameters | |
name:bytes | The username with which to log in. |
The type of response expected from the server. Choices include none (0), a one line response (1), the first line of a multi-line response (2), and subsequent lines of a multi-line response (3).
Dispatch a response from the server for handling.
Command X is dispatched to handle_X() if it exists. If not, it is dispatched to the default handler.
Parameters | |
command:bytes | The command. |
default:callable that takes bytes or None | The default handler. |
*args:tuple or None | Arguments to the handler function. |