Part of twisted.mail.pop3client View Source View In Hierarchy
Instances of this class provide a convenient, efficient API for retrieving and deleting messages from a POP3 server.
Instance Variable | startedTLS | Whether TLS has been negotiated successfully. (type: bool ) |
Instance Variable | allowInsecureLogin | Indicate whether login() should be allowed if the server offers no
authentication challenge and if our transport does not offer any protection
via encryption. (type: bool ) |
Instance Variable | serverChallenge | Challenge received from the server (type: str or None ) |
Instance Variable | timeout | Number of seconds to wait before timing out a connection. If the number is
<= 0, no timeout checking will be performed. (type: int ) |
Method | sendShort | Undocumented |
Method | sendLong | Undocumented |
Method | connectionMade | Called when a connection is made. |
Method | timeoutConnection | Called when the connection times out. |
Method | connectionLost | Called when the connection is shut down. |
Method | lineReceived | Override this for when each line is received. |
Method | lineLengthExceeded | Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way. |
Method | state_WELCOME | Undocumented |
Method | state_WAITING | Undocumented |
Method | state_SHORT | Undocumented |
Method | state_LONG_INITIAL | Undocumented |
Method | state_LONG | Undocumented |
Method | serverGreeting | Called when the server has sent us a greeting. |
Method | startTLS | Initiates a 'STLS' request and negotiates the TLS / SSL Handshake. |
Method | login | Log into the server. |
Method | apop | Perform APOP login. |
Method | user | Send the user command. |
Method | password | Send the password command. |
Method | delete | Delete a message from the server. |
Method | capabilities | Retrieve the capabilities supported by this server. |
Method | noop | Do nothing, with the help of the server. |
Method | reset | Remove the deleted flag from any messages which have it. |
Method | retrieve | Retrieve a message from the server. |
Method | stat | Get information about the size of this mailbox. |
Method | listSize | Retrieve a list of the size of all messages on the server. |
Method | listUID | Retrieve a list of the UIDs of all messages on the server. |
Method | quit | Disconnect from the server. |
Method | _blocked | Undocumented |
Method | _unblock | Undocumented |
Method | _startTLS | Undocumented |
Method | _startedTLS | Undocumented |
Method | _getContextFactory | Undocumented |
Method | _login | Undocumented |
Method | _loginTLS | Undocumented |
Method | _plaintext | Undocumented |
Method | _apop | Undocumented |
Method | _consumeOrSetItem | Undocumented |
Method | _consumeOrAppend | Undocumented |
Inherited from LineOnlyReceiver:
Class Variable | delimiter | The line-ending delimiter to use. By default this is '\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. |
Inherited from Protocol (via LineOnlyReceiver):
Method | logPrefix | Return a prefix matching the class name, to identify log messages related to this protocol instance. |
Inherited from BaseProtocol (via LineOnlyReceiver, Protocol):
Method | makeConnection | Make a connection to a transport and a server. |
Inherited from TimeoutMixin:
Class Variable | timeOut | The number of seconds after which to timeout the connection. |
Method | callLater | Wrapper around reactor.callLater for test purpose. |
Method | resetTimeout | Reset the timeout count down. |
Method | setTimeout | Change the timeout period |
Method | __timedOut | Undocumented |
bool
)
int
)
This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
Override to define behavior other than dropping the connection.
Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Parameters | line | The line which was received with the delimiter removed. (type: str ) |
Parameters | greeting | The status message sent with the server greeting. For servers implementing
APOP authentication, this will be a challenge string. . (type: str or None ) |
Returns | A Deferred which fires when the transport has been secured according to the given contextFactory, or which fails if the transport cannot be secured. |
If APOP is available it will be used. Otherwise, if TLS is available an 'STLS' session will be started and plaintext login will proceed. Otherwise, if the instance attribute allowInsecureLogin is set to True, insecure plaintext login will proceed. Otherwise, InsecureAuthenticationDisallowed will be raised (asynchronously).
Parameters | username | The username with which to log in. |
password | The password with which to log in. | |
Returns | A deferred which fires when login has completed. (type: Deferred ) |
This should be used in special circumstances only, when it is known that
the server supports APOP authentication, and APOP authentication is
absolutely required. For the common case, use login
instead.
Parameters | username | The username with which to log in. |
digest | The challenge response to authenticate with. |
This performs the first half of plaintext login. Unless this is
absolutely required, use the login
method instead.
Parameters | username | The username with which to log in. |
This performs the second half of plaintext login. Unless this is
absolutely required, use the login
method instead.
Parameters | password | The plaintext password with which to authenticate. |
Parameters | index | The index of the message to delete. This is 0-based. (type: int ) |
Returns | A deferred which fires when the delete command is successful, or fails if
the server returns an error. (type: Deferred ) |
Not all servers support this command. If the server does not support this, it is treated as though it returned a successful response listing no capabilities. At some future time, this may be changed to instead seek out information about a server's capabilities in some other fashion (only if it proves useful to do so, and only if there are servers still in use which do not support CAPA but which do support POP3 extensions that are useful).
Parameters | useCache | If set, and if capabilities have been retrieved previously, just return the
previously retrieved results. (type: bool ) |
Returns | A Deferred which fires with a dict mapping str to
None or list s of str . For example:
C: CAPA S: +OK Capability list follows S: TOP S: USER S: SASL CRAM-MD5 KERBEROS_V4 S: RESP-CODES S: LOGIN-DELAY 900 S: PIPELINING S: EXPIRE 60 S: UIDL S: IMPLEMENTATION Shlemazle-Plotz-v302 S: . will be lead to a result of: | {'TOP': None, | 'USER': None, | 'SASL': ['CRAM-MD5', 'KERBEROS_V4'], | 'RESP-CODES': None, | 'LOGIN-DELAY': ['900'], | 'PIPELINING': None, | 'EXPIRE': ['60'], | 'UIDL': None, | 'IMPLEMENTATION': ['Shlemazle-Plotz-v302']} |
No operation is performed. The returned Deferred fires when the server responds.
The returned Deferred fires when the server responds.
If consumer
is not None, it will be called with each line
of the message as it is received. Otherwise, the returned Deferred will be
fired with a list of all the lines when the message has been completely
received.
The returned Deferred will be fired with a tuple containing the number or messages in the mailbox and the size (in bytes) of the mailbox.
If consumer
is not None, it will be called with two-tuples
of message index number and message size as they are received. Otherwise, a
Deferred which will fire with a list of only message sizes will be
returned. For messages which have been deleted, None will be used in place
of the message size.
If consumer
is not None, it will be called with two-tuples
of message index number and message UID as they are received. Otherwise, a
Deferred which will fire with of list of only message UIDs will be
returned. For messages which have been deleted, None will be used in place
of the message UID.