class documentation
A minimal IMAP4 client for MicroPython.
| Method | __init__ |
Connect to an IMAP server over SSL. |
| Method | login |
Authenticate with the server. |
| Method | logout |
Close the IMAP session. |
| Method | select |
Select a mailbox. |
| Method | uid |
Fetch a body part by UID. |
| Method | uid |
Search by UID. |
| Method | uid |
Set flags on a message by UID. |
| Method | _cmd |
Send a tagged IMAP command and return its tag. |
| Method | _read |
Read exactly n bytes from the socket. |
| Method | _read |
Read a single line from the socket. |
| Method | _read |
Read a literal, keeping only the first max_literal bytes. |
| Method | _response |
Read responses until the tagged response for tag. |
| Instance Variable | _sock |
Undocumented |
| Instance Variable | _tag |
Undocumented |
Connect to an IMAP server over SSL.
| Parameters | |
host:str | The server hostname. |
port:int | The server port. Defaults to 993. |
Authenticate with the server.
| Parameters | |
username:str | The login username. |
password:str | The login password. |
| Returns | |
bool | True on success. |
Select a mailbox.
| Parameters | |
mailbox:str | The mailbox name. Defaults to "INBOX". |
| Returns | |
tuple | (ok, response data). |
Fetch a body part by UID.
| Parameters | |
uid:str | The message UID. |
parts:str | The body part specifier. |
maxint | Maximum literal bytes to keep. Defaults to 0. |
| Returns | |
bytes or None | The literal bytes. |
Search by UID.
| Parameters | |
criteria:str | The search criteria. Defaults to "UNSEEN". |
| Returns | |
list | UID strings. |
Set flags on a message by UID.
| Parameters | |
uid:str | The message UID. |
flags:str | The flags to set. Defaults to "(Seen)". |
| Returns | |
bool | True on success. |
Send a tagged IMAP command and return its tag.
| Parameters | |
command:str | The IMAP command. |
| Returns | |
bytes | The command tag. |
Read exactly n bytes from the socket.
| Parameters | |
n:int | The number of bytes to read. |
| Returns | |
bytes | The bytes read. |
Read a literal, keeping only the first max_literal bytes.
| Parameters | |
size:int | The literal size. |
maxint | Maximum bytes to keep. Defaults to 0. |
| Returns | |
bytes | The literal bytes. |