Logo
ClawHub Skills Lib
HomeCategoriesUse CasesTrendingBlog
HomeCategoriesUse CasesTrendingBlog
ClawHub Skills Lib
ClawHub Skills Lib

Browse 26,000+ community-built AI agent skills for OpenClaw. Updated daily from clawhub.ai.

Explore

  • Home
  • Trending
  • Use Cases
  • Blog

Categories

  • Development
  • AI & Agents
  • Productivity
  • Communication
  • Data & Research
  • Business
  • Platforms
  • Lifestyle
  • Education
  • Design

Use Cases

  • Security Auditing
  • Workflow Automation
  • Finance & Fintech
  • MCP Integration
  • Crypto Trading
  • Web3 & DeFi
  • Data Analysis
  • Social Media
  • 中文平台技能
  • All Use Cases →
© 2026 ClawHub Skills Lib. All rights reserved.Built with Next.js · Supabase · Prisma
Home/Blog/himalaya: Terminal Email for AI Agents — IMAP, SMTP, and MML Composition
skill-spotlightproductivityhimalayaclawhubopenclawemailimapsmtpcli

himalaya: Terminal Email for AI Agents — IMAP, SMTP, and MML Composition

March 17, 2026·6 min read

With 10,600+ downloads and 316 installs — one of the highest install-to-download ratios on ClawHub — himalaya is the standard email skill for OpenClaw power users. It wraps Himalaya, a Rust-built CLI email client from the Pimalaya project with 5,700+ GitHub stars, into an OpenClaw skill that gives agents complete email management capabilities: read, compose, reply, forward, search, and organize, across multiple accounts, entirely from the terminal.

The Problem It Solves

Email automation usually means either a heavyweight browser-use approach (fragile, slow) or a narrow API wrapper tied to one provider (Gmail-only, Outlook-only). Neither works well for agents that need to manage email across multiple accounts, access emails from self-hosted mail servers, or handle complex MIME attachments.

Himalaya solves this with a backend-agnostic IMAP/SMTP implementation. Any email provider that supports standard protocols works: Gmail, Outlook, Fastmail, Protonmail Bridge, self-hosted Postfix, iCloud — configure once in TOML and your agent has full access.

Core Concept

Himalaya is a Rust CLI tool with excellent performance and standards compliance. The OpenClaw skill wraps it with:

  1. A SKILL.md that teaches agents the right commands for each email task
  2. Reference docs for configuration and MIME composition
  3. Standard OpenClaw installation (via brew install himalaya)

Once configured, every email operation is a himalaya command.

Deep Dive

Configuration

# ~/.config/himalaya/config.toml
 
[accounts.personal]
email = "[email protected]"
display-name = "Your Name"
default = true
 
backend.type = "imap"
backend.host = "imap.example.com"
backend.port = 993
backend.encryption.type = "tls"
backend.login = "[email protected]"
backend.auth.type = "password"
backend.auth.cmd = "pass show email/imap"  # reads from password-store
 
message.send.backend.type = "smtp"
message.send.backend.host = "smtp.example.com"
message.send.backend.port = 587
message.send.backend.encryption.type = "start-tls"
message.send.backend.login = "[email protected]"
message.send.backend.auth.type = "password"
message.send.backend.auth.cmd = "pass show email/smtp"

The auth.cmd field is the key to secure password management: instead of storing passwords in plaintext config, it runs any shell command to retrieve the credential. Pass, keyring, Bitwarden CLI, 1Password CLI — all work here.

For interactive setup:

himalaya account configure

Reading Emails

# List inbox (default: 20 most recent)
himalaya envelope list
 
# Paginate
himalaya envelope list --page 1 --page-size 50
 
# List a specific folder
himalaya envelope list --folder "Sent"
himalaya envelope list --folder "Archive"
 
# Read a specific message (by ID from envelope list)
himalaya message read 42

Search

himalaya envelope list --query "from:[email protected] subject:urgent"
himalaya envelope list --query "since:2026-01-01 before:2026-02-01"
himalaya envelope list --query "body:invoice"

Search syntax follows IMAP search conventions. The --query flag supports complex boolean expressions for fine-grained filtering.

Composing and Sending

Himalaya uses MML (MIME Meta Language) for email composition — a human-readable format for specifying MIME structure:

From: [email protected]
To: [email protected]
Subject: Project update

Hi,

Here's the project update for this week.

<#part type=text/plain>
See the attached report.
</#part>

<#part type=application/pdf filename=report.pdf>
./report.pdf
</#part>

Send directly from a file:

himalaya message send --account personal < draft.eml

Or use the template command:

himalaya template forward 42    # Generates forward template for message 42
himalaya template reply 42      # Generates reply template

Edit the template, then pipe to himalaya message send.

Reply and Forward Workflows

# Generate reply template for message ID 42
himalaya template reply 42 > reply.eml
 
# Edit the template (agent fills in the body)
# ...
 
# Send
himalaya message send < reply.eml

This pattern — template → fill → send — is how agents handle reply and forward without reinventing the MIME headers.

Organizing Mail

# Move message to folder
himalaya message move 42 Archive
 
# Copy message
himalaya message copy 42 "Important"
 
# Delete
himalaya message delete 42
 
# Flag as seen/unseen
himalaya flag add 42 seen
himalaya flag remove 42 seen

Multiple Accounts

# Specify account explicitly
himalaya --account work envelope list
himalaya --account personal envelope list
 
# Default account (set in config) used when not specified
himalaya envelope list

Setup

clawhub install himalaya

Install himalaya CLI:

brew install himalaya           # macOS
# Or: pip install himalaya       # via pip (if brew unavailable)

Configure ~/.config/himalaya/config.toml with your IMAP/SMTP credentials.

Comparison: Email CLI Tools for Agents

ToolBackend SupportComposition FormatAgent-nativeMulti-account
himalayaIMAP/SMTP/NotmuchMML✅ skill✅
mutt/neomuttIMAP/POP3/SMTPRFC 2822❌✅
aercIMAP/SMTPplain text❌✅
Gmail APIGmail onlyJSON⚠️⚠️
Browser-use emailAny (browser)UI interaction❌✅

Himalaya's Rust implementation makes it reliably fast — envelope list on a 50,000 message inbox completes in under a second on a good IMAP connection.

Practical Tips

  1. Use auth.cmd for credentials — never store passwords in plaintext config; point to your password manager CLI
  2. Set one account as default = true — simplifies most commands; use --account name only when switching
  3. Use template reply before writing — the generated template includes the correct headers (In-Reply-To, References) for proper threading; writing from scratch will break thread context
  4. Pipe JSON output for agent processing — most commands support --output json for structured output
  5. Search with --query for task-specific views — instead of scrolling through inbox, search for subject:invoice or from:[email protected] to surface relevant emails directly

Considerations

  • IMAP connection required: Himalaya connects live to your IMAP server on each command. Slow or unreliable IMAP servers will make the agent feel sluggish.
  • MML learning curve: Composing emails with MML is unfamiliar compared to standard email clients. Agents need to learn the <#part> syntax for attachments.
  • No OAuth UI flow: OAuth providers (Gmail, Outlook) require an initial browser-based authorization flow. This is a one-time setup but can't be automated — a human must complete it.
  • Rate limits: Some providers (Gmail, Outlook) throttle aggressive IMAP polling. For monitoring use cases, consider using a dedicated email monitoring service rather than polling via himalaya.

The Bigger Picture

Email remains the backbone of business communication, and yet most AI agents treat it as an afterthought — relying on fragile browser automation or single-provider API wrappers. Himalaya's standards-based IMAP/SMTP implementation means an agent configured with this skill can manage email across any provider, with the same commands, the same reliability, and the same composable output format. For agents that need to read, triage, respond to, and organize email as part of their work, himalaya is the foundation.


View the skill on ClawHub: himalaya

← Back to Blog