$ 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": []
}- Features
- Installation
- Configuration
- Usage
- Alternatives
- AI policy
- License
- Social
- Contributing
- Sponsoring
- 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
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 updateThen install Himalaya:
sudo apt install himalayaFedora, 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 himalayaHomebrew (macOS, Linux)
brew install himalayaPre-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 shAs a regular user:
curl -sSL https://raw.githubusercontent.com/pimalaya/himalaya/master/install.sh | PREFIX=~/.local shThese 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 himalayaFor a build of master:
cargo install --locked --git https://github.com/pimalaya/himalaya.gitNix
nix profile install github:pimalaya/himalayaSources
Requires Rust 1.89 or later:
git clone https://github.com/pimalaya/himalaya
cd himalaya
cargo build --release --lockedThe binary lands at target/release/himalaya.
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.
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"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"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"]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"]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"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"Step 1: once your first account is configured, check that every backend answers:
himalaya account checkStep 2: list the envelopes of the inbox:
himalaya envelope listStep 3: read a message by its id:
himalaya message read 42Every 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- 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
This project is licensed under either of:
- Chat on Matrix
- News on Mastodon or RSS
- Mail at pimalaya.org@posteo.net
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:
