---
title: "list mailboxes · RUAL Documentation"
description: "Lists the mailboxes (folders) on the account, with their special-use role (inbox, sent, trash, …) and, optionally, their message counts. A RUAL imap block."
canonical: https://docs.rual.nl/block-types/imap/imapconnection_list_mailboxes
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Blueprint Language](https://docs.rual.nl/engine)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# list mailboxes

This block is part of the [`imap`](https://docs.rual.nl/block-types/imap) group and was last modified in core [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

Lists the mailboxes (folders) on the account, with their special-use role (inbox, sent, trash, …) and, optionally, their message counts.

- flow `flow`

- connection required `imapconnection`

- pattern `value` LIST pattern. `*` (default) lists every mailbox; `%` the top level only.

Default `*`

- with status `condition` Also report messages, unseen, uid_next and uid_validity per mailbox.

Default `false`

- flow `flow`

- connection `imapconnection`

- success `condition`

- error `value`

- mailboxes `array`

- count `number`

Runs LIST on the connection and outputs mailboxes: [{ name, delimiter, attributes[], role, has_children, selectable }] plus count. role is 'inbox', 'sent', 'drafts', 'trash', 'junk', 'archive', 'all', 'flagged', 'important' or '' : use it to find the Trash or Sent folder without guessing its localized name. with_status=true adds messages, unseen, uid_next and uid_validity per selectable mailbox (one STATUS per mailbox on servers without LIST-STATUS, so leave it off when you only need names). pattern is an IMAP LIST pattern ('*' for everything, 'INBOX/%' for the inbox's direct children). Suppressed in a simulation.

| `folders` |
| --- |
| `imap list` |

A typical wiring for [list mailboxes](https://docs.rual.nl/block-types/imap/imapconnection_list_mailboxes): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [move messages](https://docs.rual.nl/block-types/imap/imapconnection_move) feeds the `connection` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%2520ui/state_debug).

[![Studio canvas example for the list mailboxes block: typical wiring for list mailboxes.](https://docs.rual.nl/canvas-examples/imapconnection_list_mailboxes.png)](https://docs.rual.nl/canvas-examples/imapconnection_list_mailboxes.png?v=3)

## Version history

Introduced in [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

- [Back to `imap`](https://docs.rual.nl/block-types/imap): Return to the main group to view all sub-groups

- [Back to `imap`](https://docs.rual.nl/block-types/imap?group=imap): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
