A POP3 client protocol.

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). (type: int)
Instance Variable command The command most recently sent to the server. (type: bytes)
Instance Variable welcomeRe A regular expression which matches the APOP challenge in the server greeting. (type: RegexObject)
Instance Variable welcomeCode The APOP challenge passed in the server greeting. (type: bytes)
Method __init__ Issue deprecation warning.
Method sendShort Send a POP3 command to which a short response is expected.
Method sendLong Send a POP3 command to which a long response is expected.
Method handle_default Handle responses from the server for which no other handler exists.
Method handle_WELCOME Handle a server response which is expected to be a server greeting.
Method lineReceived Dispatch a received line for processing.
Method apopAuthenticate Perform an authenticated login.
Method apop Send an APOP command to perform authenticated login.
Method retr Send a RETR command to retrieve a message from the server.
Method dele Send a DELE command to delete a message from the server.
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 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.
Method password Perform the second half of a plaintext login.
Method quit Send a QUIT command to disconnect from the server.
Method _dispatch Dispatch a response from the server for handling.

Inherited from LineOnlyReceiver:

Class Variable delimiter The line-ending delimiter to use. By default this is b'\r\n'.
Class Variable MAX_LENGTH The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped). Default is 16384.
Method dataReceived Translates bytes into lines, and calls lineReceived.
Method sendLine Sends a line to the other end of the connection.
Method lineLengthExceeded Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.

Inherited from Protocol (via LineOnlyReceiver):

Method logPrefix Return a prefix matching the class name, to identify log messages related to this protocol instance.
Method connectionLost Called when the connection is shut down.

Inherited from BaseProtocol (via LineOnlyReceiver, Protocol):

Method makeConnection Make a connection to a transport and a server.
Method connectionMade Called when a connection is made.
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). (type: int)
command =
The command most recently sent to the server. (type: bytes)
welcomeRe =
A regular expression which matches the APOP challenge in the server greeting. (type: RegexObject)
welcomeCode =
The APOP challenge passed in the server greeting. (type: bytes)
def __init__(self): (source)

Issue deprecation warning.

def sendShort(self, command, params=None): (source)

Send a POP3 command to which a short response is expected.

ParameterscommandA POP3 command. (type: bytes)
paramsCommand arguments. (type: stringifyable object or None)
def sendLong(self, command, params): (source)

Send a POP3 command to which a long response is expected.

ParameterscommandA POP3 command. (type: bytes)
paramsCommand arguments. (type: stringifyable object)
def handle_default(self, line): (source)

Handle responses from the server for which no other handler exists.

ParameterslineA received line. (type: bytes)
def handle_WELCOME(self, line): (source)

Handle a server response which is expected to be a server greeting.

ParameterslineA received line. (type: bytes)
def _dispatch(self, command, default, *args): (source)

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.

ParameterscommandThe command. (type: bytes)
defaultThe default handler. (type: callable that takes bytes or None)
argsArguments to the handler function. (type: tuple or None)
def lineReceived(self, line): (source)

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().

ParameterslineA received line. (type: bytes)
def apopAuthenticate(self, user, password, magic): (source)

Perform an authenticated login.

ParametersuserThe username with which to log in. (type: bytes)
passwordThe password with which to log in. (type: bytes)
magicThe challenge provided by the server. (type: bytes)
def apop(self, user, digest): (source)

Send an APOP command to perform authenticated login.

ParametersuserThe username with which to log in. (type: bytes)
digestThe challenge response with which to authenticate. (type: bytes)
def retr(self, i): (source)

Send a RETR command to retrieve a message from the server.

ParametersiA 0-based message index. (type: int or bytes)
def dele(self, i): (source)

Send a DELE command to delete a message from the server.

ParametersiA 0-based message index. (type: int or bytes)
def list(self, i=''): (source)

Send a LIST command to retrieve the size of a message or, if no message is specified, the sizes of all messages.

ParametersiA 0-based message index or the empty string to specify all messages. (type: int or bytes)
def uidl(self, i=''): (source)

Send a UIDL command to retrieve the unique identifier of a message or, if no message is specified, the unique identifiers of all messages.

ParametersiA 0-based message index or the empty string to specify all messages. (type: int or bytes)
def user(self, name): (source)

Send a USER command to perform the first half of a plaintext login.

ParametersnameThe username with which to log in. (type: bytes)
def password(self, password): (source)

Perform the second half of a plaintext login.

ParameterspasswordThe plaintext password with which to authenticate. (type: bytes)
def quit(self): (source)

Send a QUIT command to disconnect from the server.

API Documentation for Twisted, generated by pydoctor at 2019-11-11 15:02:42.