| 1 |
IMAPClient Class |
| 2 |
~~~~~~~~~~~~~~~~ |
| 3 |
The primary class used by the imapclient package is the IMAPClient |
| 4 |
class. All interaction with a remote IMAP server is performed via an |
| 5 |
IMAPClient instance. |
| 6 |
|
| 7 |
.. autoclass:: imapclient.IMAPClient |
| 8 |
:members: |
| 9 |
|
| 10 |
.. autoclass:: imapclient.SocketTimeout |
| 11 |
:members: |
| 12 |
|
| 13 |
Fetch Response Types |
| 14 |
~~~~~~~~~~~~~~~~~~~~ |
| 15 |
Various types may be used in the data structures returned by |
| 16 |
:py:meth:`.IMAPClient.fetch` when certain response types |
| 17 |
are encountered during parsing. |
| 18 |
|
| 19 |
.. automodule:: imapclient.response_types |
| 20 |
:members: |
| 21 |
|
| 22 |
Exceptions |
| 23 |
~~~~~~~~~~ |
| 24 |
IMAPClient wraps exceptions raised by imaplib to ease the error handling. |
| 25 |
All the exceptions related to IMAP errors are defined in the module |
| 26 |
`imapclient.exceptions`. The following general exceptions may be raised: |
| 27 |
|
| 28 |
* IMAPClientError: the base class for IMAPClient's exceptions and the |
| 29 |
most commonly used error. |
| 30 |
* IMAPClientAbortError: raised if a serious error has occurred that |
| 31 |
means the IMAP connection is no longer usable. The connection should |
| 32 |
be dropped without logout if this occurs. |
| 33 |
* IMAPClientReadOnlyError: raised if a modifying operation was |
| 34 |
attempted on a read-only folder. |
| 35 |
|
| 36 |
|
| 37 |
More specific exceptions existed for common known errors: |
| 38 |
|
| 39 |
.. automodule:: imapclient.exceptions |
| 40 |
:members: |
| 41 |
|
| 42 |
|
| 43 |
Exceptions from lower layers are possible, such as networks error or unicode |
| 44 |
malformed exception. In particular: |
| 45 |
|
| 46 |
* socket.error |
| 47 |
* socket.timeout: raised if a timeout was specified when creating the |
| 48 |
IMAPClient instance and a network operation takes too long. |
| 49 |
* ssl.SSLError: the base class for network or SSL protocol errors when |
| 50 |
``ssl=True`` or ``starttls()`` is used. |
| 51 |
* ssl.CertificateError: raised when TLS certification |
| 52 |
verification fails. This is *not* a subclass of SSLError. |
| 53 |
|
| 54 |
Utilities |
| 55 |
~~~~~~~~~ |
| 56 |
.. automodule:: imapclient.testable_imapclient |
| 57 |
:members: |
| 58 |
|
| 59 |
TLS Support |
| 60 |
~~~~~~~~~~~ |
| 61 |
|
| 62 |
.. automodule:: imapclient.tls |
| 63 |
:members: |
| 64 |
|
| 65 |
Thread Safety |
| 66 |
~~~~~~~~~~~~~ |
| 67 |
Instances of IMAPClient are NOT thread safe. They should not be shared and |
| 68 |
accessed concurrently from multiple threads. |