Getting started

Install the package from Pypi:

pip install redbox

Configuring Email Box

You can configure your email box by:

from redbox import EmailBox

box = EmailBox(
    host='<IMAP HOST>',
    port='<IMAP PORT>',


The correct IMAP port is typically 993.

There are guides to set up the following email providers:


By default, Red Box uses IMAP4_SSL as the protocol. This is suitable for majority of cases but if you need to use other protocols, see Custom Configuration.

List of Folders

Get list of available email folders:


Selecting a Folder

To select a folder, you can index the box:

inbox = box["INBOX"]

Alternatively you can choose the inbox using:

inbox = box.inbox

Reading Emails

To query emails, you can just use search method:

Next tutorial covers reading emails more thoroughly.