Email IMAP/SMTP for Openclaw

A robust automation skill for interacting with email mailboxes via standard IMAP and SMTP protocols using password or OAuth2 authentication.

wazixuan
v0.1.0
Mar 12, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install email-imap-smtp

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 email-imap-smtp 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 Email IMAP/SMTP?

The Email IMAP/SMTP skill provides a standardized interface for AI agents to perform complex mailbox operations. Built for integration with Openclaw Skills, it allows for reliable sending and receiving of emails across mainstream providers such as Gmail, Outlook, Yahoo, and Zoho. The tool handles the intricacies of IMAP for reading and searching messages, as well as SMTP for sending HTML emails with attachments, ensuring high-fidelity communication automation.

By leveraging this skill, developers can implement secure mail workflows using modern authentication standards. It emphasizes security by supporting OAuth2 flows and environment variable configuration, making it suitable for both local development and production-grade AI agent deployments within the Openclaw Skills ecosystem.

Email IMAP/SMTP Use Cases

  • Automating the sorting and summarization of unread emails from specific senders.
  • Building auto-reply systems that respond to inquiries with HTML-formatted content.
  • Programmatically retrieving attachments from recent emails for data processing.
  • Monitoring mailboxes for specific triggers or alerts to initiate downstream agent workflows.
  • Refreshing OAuth2 tokens to maintain persistent access to corporate mailboxes.

How Email IMAP/SMTP Works

  1. The system identifies the provider and preferred authentication mode, such as app passwords or OAuth2.
  2. A connection check is performed using the check command to verify IMAP and SMTP reachability.
  3. The agent queries the mailbox using the list or search commands to identify relevant email UIDs.
  4. Detailed message content, including headers and body text, is retrieved via the read command.
  5. New communications are dispatched using the send command, supporting both plain text and HTML formats.

Email IMAP/SMTP Setup

To use this skill, ensure your environment is configured with the necessary Python dependencies. Set your credentials as environment variables to maintain security.

# Set core environment variables
export EMAIL_ADDRESS="[email protected]"
export EMAIL_PROVIDER="gmail"
export EMAIL_AUTH_MODE="password"
export EMAIL_APP_PASSWORD="your-app-password"

# Run the help command to explore available subcommands
python scripts/email_ops.py --help

Email IMAP/SMTP Data Schema & Taxonomy

The skill manages data through structured command-line arguments and environment variables, mapping them to standard IMAP/SMTP attributes.

Attribute Description
EMAIL_PROVIDER Preset configurations for hosts like gmail, outlook, qq, and icloud.
EMAIL_AUTH_MODE Defines the security layer: auto, password, or oauth2.
UID Unique identifier used to fetch specific email contents.
Mailbox The folder to operate within (defaults to INBOX).
Attachments List of file paths to be included in outgoing SMTP payloads.

Email IMAP/SMTP Advanced Features

  • OAuth2 support including authorization URL generation and token refresh workflows.
  • Integrated provider presets for common IMAP/SMTP host and port configurations.
  • Support for multi-attachment handling and HTML body rendering in outgoing emails.
  • Masked terminal output for sensitive authentication tokens to prevent accidental data leaks.
  • Flexible searching capabilities filtering by sender, subject, date, or read status.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*