Table: imap_mailbox - Query IMAP Mailboxes using SQL
IMAP (Internet Message Access Protocol) is a standard email protocol that stores email messages on a mail server and allows the end user to view and manipulate the messages as though they were stored locally on the end user's computing device(s). The IMAP protocol is designed to enable users to view, organize and sort their email messages in various ways. It is particularly useful for people who need to access their email on multiple devices or from different locations.
Table Usage Guide
The imap_mailbox
table provides insights into mailboxes within an IMAP server. As a system administrator, explore mailbox-specific details through this table, including mailbox size, message count, and associated metadata. Utilize it to uncover information about mailboxes, such as those with high message count, the size of each mailbox, and the organization of emails.
Examples
List all mailboxs
Discover the segments that encompass all your mailboxes, providing a comprehensive view of your email landscape. This is useful for gaining an overall understanding of your email organization and management.
select *from imap_mailbox;
select *from imap_mailbox;
Get a specific mailbox
Explore the specific mailbox that has been marked as important or noteworthy in your email system. This is useful to quickly identify and access important communications without having to manually search through all your emails.
select *from imap_mailboxwhere name = '[Gmail]/Starred';
select *from imap_mailboxwhere name = '[Gmail]/Starred';
Mailboxes by message count
Explore which mailboxes contain the highest number of messages to better manage storage and prioritize clean-up efforts.
select name, messagesfrom imap_mailboxorder by messages desc;
select name, messagesfrom imap_mailboxorder by messages desc;
Mailboxes with unseen messages
Identify mailboxes that contain unread messages to prioritize checking and responding to these communications.
select name, unseenfrom imap_mailboxwhere unseen > 0order by unseen desc;
select name, unseenfrom imap_mailboxwhere unseen > 0order by unseen desc;
Get all mailboxes with the Important attribute
Explore which mailboxes have been marked as important. This is useful for prioritizing email management and focusing on high-priority communications.
select *from imap_mailboxwhere attributes ? '\Important'
Error: SQLite does not support querying JSON objects with a specific key using the '?' operator.
Schema for imap_mailbox
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
attributes | jsonb | Attributes set on the mailbox. | |
delimiter | text | The server's path separator. | |
flags | jsonb | The mailbox flags. | |
messages | bigint | The number of messages in this mailbox. | |
name | text | = | Name of the mailbox, e.g. 'INBOX', '[Gmail]/Drafts'. |
permanent_flags | jsonb | The mailbox permanent flags. | |
read_only | boolean | True if the mailbox is open in read-only mode. | |
recent | bigint | The number of messages not seen since the last time the mailbox was opened. | |
unseen | bigint | The number of unread messages. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- imap
You can pass the configuration to the command with the --config
argument:
steampipe_export_imap --config '<your_config>' imap_mailbox