
Himalaya
CLICommand-line email client supporting IMAP, SMTP, JMAP, Gmail and Microsoft Graph, with multiple accounts and --json output, so agents can check, search, compose and send mail. A first-run wizard auto-detects your mailbox settings.
$ himalaya envelope search --json --sort newest-first from:alice date:2026-11-02..
{
"envelopes": [
{
"id": "2",
"messageId": "slides@example.org",
"inReplyTo": [],
"flags": [],
"subject": "Slides for the review",
"from": [{ "name": "Alice", "email": "alice@example.org" }],
"to": [{ "name": null, "email": "me@example.org" }],
"date": "2026-11-19T09:15:00+01:00",
"size": 355,
"hasAttachment": true
},
{
"id": "1",
"messageId": "lunch@example.org",
"inReplyTo": [],
"flags": [{ "raw": "\\Seen", "iana": "seen" }],
"subject": "Lunch on Friday?",
"from": [{ "name": "Alice", "email": "alice@example.org" }],
"to": [{ "name": null, "email": "me@example.org" }],
"date": "2026-11-18T12:30:00+01:00",
"size": 162,
"hasAttachment": false
}
],
"nextPage": null,
"total": null,
"errors": []
}
Table of contents
- Features
- Installation
- Configuration
- Usage
- Alternatives
- AI policy
- License
- Social
- Contributing
- Sponsoring
Features
- JSON output of every command, described by
himalaya json-schema, for scripts, frontends and agents - Unified API for mailboxes, envelopes, flags, messages and attachments, the same on every backend
- Protocol-specific APIs exposing the full surface of IMAP, SMTP, ManageSieve, JMAP, Gmail and Microsoft Graph
- Local stores: Maildir, mbox and pimdir, the offline store Neverest syncs
- One query language to search envelopes, whatever the backend
- REPL and MCP server running commands over connections kept for the session
- TOML configuration with several accounts, secrets read from any password manager
- Plain text output for a person: one item per line, no border, no colour
Installation
Debian, Ubuntu
Himalaya is not in the official repositories yet, but the signed APT repository of pkg.pimalaya.org ships the latest release with its man pages and shell completions. Add the repository once:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://pkg.pimalaya.org/pimalaya.asc | sudo tee /etc/apt/keyrings/pimalaya.asc >/dev/null
sudo tee /etc/apt/sources.list.d/pimalaya.sources >/dev/null <<EOF
Types: deb
URIs: https://pkg.pimalaya.org/apt
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/pimalaya.asc
EOF
sudo apt update
Then install Himalaya:
sudo apt install himalaya
Fedora, RHEL, Rocky Linux, AlmaLinux
Himalaya is not in the official repositories yet, but the signed DNF repository of pkg.pimalaya.org ships the latest release with its man pages and shell completions:
sudo curl -fsSL -o /etc/yum.repos.d/pimalaya.repo https://pkg.pimalaya.org/pimalaya.repo
sudo dnf install himalaya
Homebrew (macOS, Linux)
brew install himalaya
Pre-built binary
For other systems, Himalaya can be installed with the installer:
As root:
curl -sSL https://raw.githubusercontent.com/pimalaya/himalaya/master/install.sh | sudo sh
As a regular user:
curl -sSL https://raw.githubusercontent.com/pimalaya/himalaya/master/install.sh | PREFIX=~/.local sh
These commands install the latest release, built with the default cargo features. For a build of master, check out the releases GitHub workflow and look for the Artifacts section.
Cargo
cargo install --locked himalaya
For a build of master:
cargo install --locked --git https://github.com/pimalaya/himalaya.git
Nix
nix profile install github:pimalaya/himalaya
Sources
Requires Rust 1.89 or later:
git clone https://github.com/pimalaya/himalaya
cd himalaya
cargo build --release --locked
The binary lands at target/release/himalaya.
Configuration
A TOML configuration is loaded from every existing path among the following, each one deep-merged on top of the ones before:
$XDG_CONFIG_HOME/himalaya/config.toml$HOME/.config/himalaya/config.toml$HOME/.himalayarc
Override the path with -c <PATH>, repeated to merge several files. The same file backs himalaya-tui, its own keys under [tui].
[!TIP] See config.sample.toml for a complete configuration of one example account with commented fields; rename the account and uncomment what you need, or start from a provider below.
Proton Mail
Run Proton Bridge, which serves Proton on a local IMAP and SMTP endpoint; the password is the one the Bridge generates, not your account's.
[accounts.proton]
imap.server = "imap://127.0.0.1:1143"
imap.sasl.plain.username = "example@proton.me"
imap.sasl.plain.password.command = "pass show proton-bridge"
smtp.server = "smtp://127.0.0.1:1025"
smtp.sasl.plain.username = "example@proton.me"
smtp.sasl.plain.password.command = "pass show proton-bridge"
Fastmail
Use an app password for IMAP and SMTP, or an API token for JMAP, replacing both blocks.
[accounts.fastmail]
imap.server = "imaps://imap.fastmail.com"
imap.sasl.plain.username = "example@fastmail.com"
imap.sasl.plain.password.command = "pass show fastmail"
smtp.server = "smtps://smtp.fastmail.com"
smtp.sasl.plain.username = "example@fastmail.com"
smtp.sasl.plain.password.command = "pass show fastmail"
# jmap.server = "https://api.fastmail.com/jmap/session"
# jmap.auth.bearer.token.command = "pass show fastmail"
Gmail
Use the Gmail API with an OAuth 2.0 token from Ortie's Google account.
[accounts.gmail]
gmail.auth.token.command = ["ortie", "token", "show", "-a", "google"]
Or IMAP and SMTP, with an app password or the same Ortie token over xoauth2 (in place of plain, as for Outlook below). Special mailboxes live under [Gmail]/, so alias them.
[accounts.gmail-imap]
imap.server = "imaps://imap.gmail.com:993"
imap.sasl.plain.username = "example@gmail.com"
imap.sasl.plain.password.command = "pass show gmail"
smtp.server = "smtps://smtp.gmail.com:465"
smtp.sasl.plain.username = "example@gmail.com"
smtp.sasl.plain.password.command = "pass show gmail"
mailbox.alias.sent = "[Gmail]/Sent Mail"
mailbox.alias.drafts = "[Gmail]/Drafts"
mailbox.alias.trash = "[Gmail]/Trash"
mailbox.alias.archive = "[Gmail]/All Mail"
# imap.sasl.xoauth2.username = "example@gmail.com"
# imap.sasl.xoauth2.token.command = ["ortie", "token", "show", "-a", "google"]
# smtp.sasl.xoauth2.username = "example@gmail.com"
# smtp.sasl.xoauth2.token.command = ["ortie", "token", "show", "-a", "google"]
Outlook
Microsoft refuses passwords: use xoauth2 with a token from Ortie, or the Microsoft Graph API, replacing both blocks.
[accounts.outlook]
imap.server = "imaps://outlook.office365.com:993"
imap.sasl.xoauth2.username = "example@outlook.com"
imap.sasl.xoauth2.token.command = ["ortie", "token", "show", "-a", "outlook"]
smtp.server = "smtp://smtp-mail.outlook.com:587"
smtp.starttls = true
smtp.sasl.xoauth2.username = "example@outlook.com"
smtp.sasl.xoauth2.token.command = ["ortie", "token", "show", "-a", "outlook"]
# msgraph.auth.token.command = ["ortie", "token", "show", "-a", "msgraph"]
Posteo
Standard IMAP and SMTP with the account password.
[accounts.posteo]
imap.server = "imaps://posteo.de"
imap.sasl.plain.username = "example@posteo.net"
imap.sasl.plain.password.command = "pass show posteo"
smtp.server = "smtps://posteo.de"
smtp.sasl.plain.username = "example@posteo.net"
smtp.sasl.plain.password.command = "pass show posteo"
iCloud Mail
Use an app-specific password; the IMAP login is the address's name, the SMTP login the full address.
[accounts.icloud]
imap.server = "imaps://imap.mail.me.com:993"
imap.sasl.plain.username = "johnappleseed"
imap.sasl.plain.password.command = "pass show icloud"
smtp.server = "smtp://smtp.mail.me.com:587"
smtp.starttls = true
smtp.sasl.plain.username = "johnappleseed@icloud.com"
smtp.sasl.plain.password.command = "pass show icloud"
mailbox.alias.sent = "Sent Messages"
Usage
Step 1: once your first account is configured, check that every backend answers:
himalaya account check
Step 2: list the envelopes of the inbox:
himalaya envelope list
Step 3: read a message by its id:
himalaya message read 42
Every command runs on the default account unless -a names another, and its --help details its flags, exit codes and JSON output. More use cases:
# Search the newest messages from Alice of the last two days
himalaya envelope search --sort newest-first from:alice date:2d
# Reply and send at once
himalaya message reply 42 --body "Thanks!" --send
# Mark messages as seen
himalaya flag add --flag seen 1 2 3
# Send a raw IMAP command
himalaya imap raw 'a1 NAMESPACE'
# Serve the account to an AI agent, writes allowed
himalaya mcp --allow-write
Alternatives
- NeoMutt: a terminal mail client, driven from its own interface rather than scripted
- aerc: a terminal mail client for IMAP, JMAP, Maildir and notmuch
- mblaze: Unix utilities over a Maildir, local mail only
- gog: a Google Workspace CLI with JSON output, Gmail only for mail
License
This project is licensed under either of:
Social
- Chat on Matrix
- News on Mastodon or RSS
- Mail at pimalaya.org@posteo.net
Sponsoring
Special thanks to the NLnet foundation and the European Commission that have been financially supporting the project for years:
- 2022 → 2023: NGI Assure
- 2023 → 2024: NGI Zero Entrust
- 2024 → 2026: NGI Zero Core
- 2026 → 2027: NGI Zero Commons Fund
This program is part of Pimalaya, free software funded entirely by grants and donations. If you find it useful, consider sponsoring its development:
Похожие ресурсы

mcp-email-server
MCPLets agents read, search, organize and send email over IMAP/SMTP with any provider that supports them, across multiple accounts, with a local web UI for setup. Needs your email password or app password.
Wh1isper/mcp-email-server413
Gmail
PluginOpenAI's official Codex plugin that uses the Gmail connector to search mail, read threads, draft replies and tidy your inbox. The plugin bundles no extra skills; authorize your Google account in Codex.
openai/plugins8.5k
Spark CLI Skills
SkillOfficial Spark mail skills: agents read mail, calendar, contacts and teams, with flows for morning briefs, inbox zero, meeting prep, follow-ups and weekly reports. Needs Spark desktop on macOS or Windows with the CLI enabled; set read-only, organize or send access per account.
readdle/spark-cli-skills160
gws (Google Workspace CLI)
CLIOne CLI for Gmail, Drive, Calendar, Docs, Sheets and other Google Workspace APIs, with commands generated from the Discovery service, JSON output and 100+ Agent Skills. From the googleworkspace org but not officially supported; needs OAuth via a Google Cloud project.
googleworkspace/cli32.6k
gog (gogcli)
CLIGoogle Workspace CLI for scripts and agents covering Gmail, Calendar, Drive, Docs, Sheets, Contacts and Tasks, with JSON output, read-only mode and command allowlists; can also run as a read-only-by-default MCP server. Bring your own Google OAuth client.
openclaw/gogcli8.6k
Enterprise Search
PluginAnthropic's official knowledge work plugin: one question searches your connected chat, email, cloud docs, wiki and project tools at once and returns a sourced answer; can also produce daily or weekly digests. Preset MCP connectors for Slack, Notion, Atlassian, Asana and more, each needing auth.
anthropics/knowledge-work-plugins37.4k
