ImapFlow for Openclaw

A modern, promise-based IMAP client for Node.js that simplifies complex email interactions with async iterators and automated extension handling.

openlark
v1.0.0
May 11, 2026
0
598
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install imapflow

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install imapflow using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is ImapFlow?

ImapFlow is a high-performance IMAP client library designed for Node.js environments. It streamlines email integration by automatically detecting and handling advanced IMAP extensions like CONDSTORE, QRESYNC, and IDLE. This ensures that developers can write consistent code that works reliably across various mail providers including Gmail, Outlook, and Yahoo.

Built with modern JavaScript patterns in mind, it utilizes an async/await API and async iterators for efficient message streaming. As part of the ecosystem of Openclaw Skills, it provides a robust foundation for building email automation, monitoring systems, and custom email clients with built-in support for security features like SOCKS/HTTP proxies and OAuth2 authentication.

ImapFlow Use Cases

  • Building custom email dashboards or specialized mail clients.
  • Automating email processing workflows such as invoice scraping or support ticket creation.
  • Monitoring mailboxes in real-time for new messages using IDLE push notifications.
  • Managing complex mailbox structures including folder creation, renaming, and message movement.
  • Integrating Gmail-specific features like labels, threads, and raw search queries.

How ImapFlow Works

  1. Initialize the ImapFlow client with server credentials, security settings (TLS), and optional provider-specific configurations.
  2. Establish a connection to the IMAP server using the client.connect() method.
  3. Secure a mailbox lock (e.g., for 'INBOX') to ensure exclusive access during sensitive operations.
  4. Execute commands such as searching for specific criteria, fetching message metadata, or streaming full message sources.
  5. Handle real-time updates through event listeners for new messages (exists), deletions (expunge), or flag changes.
  6. Release the mailbox lock and gracefully logout to close the connection.

ImapFlow Setup

Install the library using npm or yarn:

npm install imapflow

Basic connection setup:

const { ImapFlow } = require('imapflow');
const client = new ImapFlow({
    host: 'imap.example.com',
    port: 993,
    secure: true,
    auth: { user: '[email protected]', pass: 'password' }
});

ImapFlow Data Schema & Taxonomy

ImapFlow organizes message data through a structured FetchQueryObject. The schema allows for granular data retrieval to optimize bandwidth:

Field Type Description
uid Number Unique identifier for the message
envelope Object Parsed headers (subject, from, to, date)
bodyStructure Object MIME structure tree of the message
flags Array Message flags like \Seen or \Deleted
source Buffer Full RFC822 message source
labels Array Gmail-specific X-GM-LABELS
threadId String Gmail-specific thread identifier

ImapFlow Advanced Features

  • Automatic IDLE management: Maintains a persistent connection to receive push notifications without polling.
  • Gmail Extensions: Full support for X-GM-RAW searches, thread IDs, and label management.
  • Proxy Support: Built-in compatibility with SOCKS and HTTP proxies for secure routing.
  • Mailbox Locking: Sophisticated concurrency management to prevent command collisions during async operations.
  • Streamed Fetches: Use of async iterators to process thousands of emails without overloading system memory.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*