Skip to content
CAI
Software that uses CAICheck a score

pimalaya/himalaya

67.7

Adequate · 29 September 2026

29.4k

lines of production code

Rust

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Himalaya is a command-line email client that manages messages across multiple protocols and local storage formats. It provides a unified interface for interacting with IMAP, JMAP, Gmail, Microsoft Graph, and ManageSieve servers, as well as local Maildir and m2dir stores. The system supports core email operations including mailbox management, message retrieval, searching, flagging, and sending via SMTP.

How it got here

2020–2023 — Himalaya v2 architectural refactor

8 changes.

This period centered on the major v2 architectural refactor, restructuring the application around an I/O-free pattern with protocol-specific subcommands and a unified email domain model. The work expanded backend support to include IMAP, SMTP, Maildir, Gmail, Microsoft Graph, and ManageSieve, while introducing dedicated CLI interfaces and account management utilities for each.

2026 — multi-protocol CLI expansion

20 changes.

This period focused on significantly expanding the command-line interface to support a wide array of email protocols and storage backends, including IMAP, JMAP, Gmail, Microsoft Graph, and various local stores like Maildir and m2dir. It introduced a unified shared infrastructure for message and mailbox management, replacing ad-hoc search logic with a structured query language and adding specialized commands for server-side scripting via ManageSieve.

Features

Add IMAP flag listing and storing commands

Users can now inspect and modify IMAP message flags via new CLI commands. The \imap flag list\ command displays the flags a mailbox supports and which are permanent, presenting the data in a table. The \imap store\ command allows users to add, remove, or replace flags on specific messages using raw RFC 3501 tokens, with options to target message sequences by number or UID.

src/imap/flag · high confidence

Add IMAP message management commands (copy, move, save)

Users can now manage messages across mailboxes using three new IMAP commands: \copy\ to duplicate messages to another mailbox, \move\ to transfer messages (supporting RFC 6851 MOVE), and \save\ to append messages from files, strings, or stdin. These commands allow specifying sequence sets and target mailboxes, with the save command also supporting raw IMAP flag setting.

src/imap/message · high confidence

Add JMAP mailbox and submission management commands

Users can now manage JMAP mailboxes and email submissions via the CLI. The \jmap mailbox\ command family supports creating, querying, getting, updating, and deleting mailboxes, with query options for filtering by parent, role, name, and subscription status, as well as sorting and pagination. The \jmap submission\ command family allows submitting drafts for sending, querying submission status (pending, final, canceled), getting specific submissions, and canceling pending submissions.

src/jmap/mailbox · high confidence

Add m2dir command family for local mailbox management

Users can now manage local m2dir mailboxes directly via the new \m2dir\ CLI command group. This includes subcommands to create and delete folders (\m2dir create\, \m2dir delete\), list available folders (\m2dir list\), and manage messages and flags (\m2dir message\, \m2dir flag\). The implementation provides a backend adapter that bridges the shared email client interface with the underlying content-addressed m2dir storage, handling operations like listing envelopes, searching, copying, moving, and flagging messages.

src/m2dir · high confidence

Add m2dir message save command

Users can now store raw messages into an m2dir folder using the new \m2dir message save\ command. This command accepts message content from a file path, inline string, or piped standard input, and allows attaching arbitrary UTF-8 flags (e.g., \$seen\, \custom\) via the \-f\ option. Upon successful storage, it outputs the message ID and file path.

src/m2dir/message · high confidence

Add maildir flag management commands

The \maildir flag\ command family is now available, allowing users to manage Maildir info flags (Passed, Replied, Seen, Trashed, Draft, Flagged) stored in message filenames. This includes \maildir flag list\ to display the standard flags, \maildir flag add\ to append flags, \maildir flag remove\ to delete specific flags, and \maildir flag set\ to replace the entire flag set for selected messages.

src/jmap/identity, src/m2dir/flag, src/maildir/flag · high confidence

Add maildir message commands for saving, copying, and moving messages

Users can now manage individual message files within a Maildir store using the new \maildir message\ command family. This includes \save\ to deliver raw messages (from a file, string, or stdin) into a specified subdirectory with optional flags, \copy\ to duplicate messages to another folder or subdirectory, and \move\ to relocate messages between folders. These commands interact directly with the Maildir's \new\ and \cur\ directories, providing granular control over message storage and organization.

src/maildir/message · high confidence

Add pimdir support for local offline store access

Users can now interact with a local pimdir store (an offline cache populated by a sync engine) via the new \himalaya pimdir\ command family. This includes listing mailboxes and envelopes, searching messages, and managing the write queue with \himalaya pimdir queue list\ and \himalaya pimdir queue cancel\ to retract staged creations before they are synced.

src/pimdir · high confidence

Initial JMAP protocol support

Users can now access mail via the JMAP protocol through the new \jmap\ CLI command group. This includes subcommands for managing mailboxes, emails, threads, identities, email submissions, and vacation responses, as well as a raw \query\ command for sending arbitrary JMAP method calls. The implementation provides a client wrapper that handles session management, authentication (Bearer, Basic, Header), proxy configuration, and mailbox indexing.

src/jmap · high confidence

Interactive wizard for discovering and configuring email accounts

The \himalaya configure\ command now provides an interactive wizard that discovers email providers from an address, URL, or local folder path, tests the connection, and writes the account configuration. The wizard supports IMAP/SMTP, JMAP, Gmail REST API, Microsoft Graph, and local Maildir/m2dir backends, handling SASL mechanism selection, credential prompts, and OAuth token broker integration.

src/wizard · high confidence

Introduce Maildir backend and CLI commands

Users can now manage local Maildir stores via a new \maildir\ command family. This includes subcommands to create, rename, and delete mailboxes, list available folders, and manage messages (listing, reading, flagging, copying, moving, and deleting). The implementation adds a new backend adapter that bridges the application's shared email types with the \io-maildir\ library, supporting Dovecot keywords and configurable keyword headers.

src/maildir · high confidence

Introduce ManageSieve script management commands

Adds a new \sieve\ command family to manage server-side Sieve scripts via the ManageSieve protocol (RFC 5804). Users can now list installed scripts, upload and validate scripts, activate or deactivate the active script, rename or delete scripts, and query server capabilities. The implementation includes a dedicated ManageSieve client that handles connection configuration (including proxy support and SASL authentication) and exposes the full set of script management operations through the CLI.

src/sieve · high confidence

Introduce SMTP send and raw commands

Added the \smtp send\ and \smtp raw\ CLI commands to allow users to send messages and execute raw SMTP commands directly. The \smtp send\ command performs an explicit RFC 5321 transaction (MAIL FROM, RCPT TO, DATA) using provided envelope parameters, while \smtp raw\ acts as a byte-for-byte passthrough to the server for single-line commands. These commands utilize a new SMTP client wrapper built on \io-smtp\ to handle connections, TLS, and SASL authentication.

src/smtp · high confidence

Introduce dedicated Gmail REST API support

Adds a new \gmail\ command group that exposes the full Gmail REST API surface, including commands for managing messages, drafts, labels, threads, attachments, and history. This provides a dedicated interface for Gmail-specific operations alongside the existing shared email commands.

src/gmail · high confidence

Introduce dedicated IMAP command-line interface and backend

The application now includes a comprehensive \imap\ command group that exposes IMAP operations as distinct subcommands mirroring the RFC 3501 protocol structure. Users can now manage mailboxes (create, delete, rename, list, subscribe), manipulate messages (fetch, search, sort, copy, move, save, delete), and control flags directly via the CLI. The implementation introduces a dedicated \ImapClient\ wrapper that handles session initialization, SASL authentication, TLS configuration, and proxy support, while the backend adapter translates these CLI commands into wire-level operations using the \io-imap\ library.

src/imap · high confidence

Introduce shared email client and protocol-agnostic command infrastructure

The \src/shared\ module now provides the central \EmailClient\ that dispatches operations to configured backends (IMAP, JMAP, Gmail, MS Graph, Maildir, M2dir, Pimdir) and handles SMTP transport for sending. This change introduces a unified interface for shared subcommands, including paginated listing support with cursor tracking, raw protocol command execution with automatic CRLF normalization, and table output styling compatible with the upgraded \comfy-table\ v8.

src/shared · high confidence

New IMAP envelope commands for searching, sorting, and threading messages

Users can now use the \imap search\, \imap sort\, and \imap thread\ commands to find, order, and group messages directly from the CLI. The search command supports filtering by headers (From, To, Subject, etc.), dates, size, and message flags, returning UIDs or sequence numbers. The sort command orders results by date, arrival, sender, recipient, subject, or size, with an option to reverse the order. The thread command groups messages into conversation trees using either References/In-Reply-To headers or an ordered-subject algorithm, displaying subjects for readability. All commands respect the \--no-select\ flag to avoid modifying mailbox state and support both UID and sequence number modes.

src/imap/envelope · high confidence

New IMAP mailbox management commands

The \src/imap/mailbox\ module now provides a complete set of commands for managing IMAP mailboxes, implementing RFC 3501 operations including \create\, \delete\, \rename\, \list\, \subscribe\, \unsubscribe\, \select\, \close\, \unselect\, \expunge\, and \status\. Users can now directly manipulate mailbox structures and view detailed status information (such as message counts, UID validity, and unseen counts) through the CLI, with the \list\ command offering both subscribed and all-mailbox views and the \status\ command supporting modern extensions like CONDSTORE and RFC 9208 deleted-storage metrics.

(repo-wide) · high confidence

New JMAP CLI commands for email, threads, and vacation responses

This change introduces the \jmap email\, \jmap thread\, and \jmap vacation-response\ command families to the CLI, enabling direct interaction with JMAP servers. The \jmap email\ command supports retrieving, querying, reading, updating, deleting, copying, exporting, importing, and parsing emails via RFC 8621 methods like \Email/get\, \Email/query\, \Email/set\, \Email/copy\, \Email/import\, \Email/export\, and \Email/parse\. The \jmap thread\ command allows fetching thread details using \Thread/get\, while \jmap vacation-response\ enables managing auto-reply settings through \VacationResponse/get\ and \VacationResponse/set\. These commands integrate with the existing account context and JMAP client to provide a comprehensive command-line interface for JMAP-based email management.

src/jmap/email · high confidence

New Microsoft Graph command-line interface

This change introduces the \msgraph\ CLI command group, providing direct access to Microsoft Graph mail resources. It includes subcommands for managing mail folders (\mail-folders\), messages (\messages\), and attachments (\attachments\), allowing users to list, create, update, move, copy, and delete these items. The implementation adds the necessary client wrapper, backend adapter, and CLI dispatch logic to support these operations.

src/msgraph · high confidence

New account management commands for listing and validating configurations

Users can now inspect and validate their email account settings using the new \himalaya account list\ and \himalaya account check\ commands. The list command displays all configured accounts, their active backends (IMAP, JMAP, Gmail, MS Graph, Maildir, M2Dir, SMTP, Sieve), and default status in a table. The check command validates connectivity for every configured backend, ensuring credentials and endpoints work before attempting real operations, which helps catch configuration errors early during setup or troubleshooting.

src/account · high confidence

New envelope listing and search commands

Added the \envelope\ command family, providing \envelope list\ (alias \ls\) and \envelope search\ (alias \sr\) to view and filter mailbox contents. These commands display a paginated table of message headers (ID, flags, subject, sender/recipient, date, size) with configurable page sizes, column widths, and attachment indicators. The search subcommand supports a shared query language for filtering by date, sender, recipient, subject, body, and flags, and includes improved error reporting for invalid search queries using the ariadne library for colored, labeled output.

src/shared/envelope · high confidence

New mailbox management command and argument handling

Users can now use the new \mailbox\ command to list mailboxes for the active account, with options to include total and unread counts and control table width. Additionally, all shared commands now support a \-m/--mailbox\ flag that resolves mailbox names using configured aliases, backend-known roles (like inbox, sent, drafts), or backend-native IDs, defaulting to the inbox when omitted.

src/shared/mailbox · high confidence

Behavioural changes

Himalaya v2: Major architectural refactor and API overhaul

This release introduces Himalaya v2, a significant behavioral change that restructures the application around an I/O-free (Sans I/O) pattern, resulting in a binary approximately three times smaller than v1. The shared backend abstraction has been removed in favor of protocol-specific subcommands (e.g., \himalaya imap\, \himalaya jmap\), exposing the full native capability of each backend. Key behavioral shifts include: renaming \folders\ to \mailboxes\ and \--folder\ to \-m/--mailbox\; removing interactive composition in favor of CLI-driven flags and external tools via \pimalaya/mml\; moving OAuth and keyring management to external utilities (\pimalaya/ortie\, password managers); and simplifying configuration by removing \display-name\, \signature\, and \pgp\ top-level entries. The \read\ command no longer renders human-readable text by default, requiring \--raw\ for raw output. TLS providers are now selectable at build time (\rustls\ or \native-tls\).

(repo-wide) · high confidence

Introduce global --backend flag for cross-protocol commands

Users can now use the new \--backend\ global flag to explicitly select which backend (IMAP, JMAP, Gmail, Microsoft Graph, Maildir, m2dir, pimdir, SMTP, or ManageSieve) shared, cross-protocol commands like \mailbox\, \envelope\, \message\, and \attachment\ should target. The default \auto\ mode continues to pick the first configured backend the command supports, but specifying a named backend pins the operation to that specific protocol, failing if the account lacks that configuration or the command has no implementation for it. Protocol-specific subcommands (e.g., \imap\, \jmap\) ignore this flag and always use their own backend.

src · high confidence

Introduce shared email domain types and mailbox roles

The email module now defines a unified set of domain types—Address, Envelope, Flag, and Mailbox—that serve as the least-common-denominator representation across all supported protocols. This change replaces the previous \io-email\ crate with local definitions, allowing the CLI to own its shared types while protocol-specific adapters produce these structures. Key additions include a \MailboxRole\ enum (Inbox, Sent, Trash, etc.) for identifying special-use folders, normalized \Flag\ handling that collapses wire spellings (like \\\Seen\ and \$seen\) into logical equivalents, and an \Envelope\ structure that includes \in\_reply\_to\ for threading and normalized \message\_id\ for stable cross-backend comparison.

src/email · high confidence

New structured email search and sort syntax

The email search command now uses a dedicated, structured query language instead of the previous ad-hoc parsing. Users can combine filter conditions—such as \from\, \to\, \subject\, \body\, \date\, \after\, and \flag\—using logical operators (\and\, \or\, \not\) and parentheses. Results can be ordered using \order by\ followed by one or more sort keys (\date\, \from\, \to\, \subject\) with optional \asc\ or \desc\ directions. This change introduces a new parser and evaluation engine for these queries, replacing the old search implementation.

src/email/search · high confidence

Dependencies

Himalaya v2.1.0: Rust 2024 edition, pimalaya ecosystem migration, and expanded backend support

The email CLI has been upgraded to version 2.1.0, moving to the Rust 2024 edition and requiring Rust 1.89. The project has migrated its dependencies to the pimalaya ecosystem, replacing the previous \himalaya-lib\ with a suite of \io-\*\ crates (such as \io-imap\, \io-smtp\, \io-jmap\, \io-gmail\, \io-msgraph\, \io-maildir\, and \io-managesieve\) and \pimalaya-cli\. This update introduces new backend capabilities including Gmail REST API (\gmail\), Microsoft Graph (\msgraph\), and ManageSieve (\sieve\), alongside Maildir support. Configuration handling has shifted to \pimalaya-config\ and \toml\ 1.1, and the build profile now enables fat LTO and symbol stripping for optimized release binaries.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 68 → 68 (-0.5)
  • Rubric changed (rubric-2026.09.9 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 94 → 94 (-0.0)
  • Architecture 100 → 85 (-14.5)
  • Maturity 59 → 59 (+0.0)
  • Readiness 69 → 68 (-0.5)
  • Security 68 → 77 (+9.0)

Resolved (15)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no licence statement (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (13 lines × 2) (src/gmail/backend.rs)
  • Duplicated block (13 lines × 3) (src/shared/message/compose.rs)
  • Duplicated block (21 lines × 2) (src/gmail/backend.rs)
  • Duplicated block (6 lines × 2) (src/shared/attachment/download.rs)
  • Duplicated block (8 lines × 2) (src/imap/client.rs)
  • Duplicated block (9 lines × 3) (src/gmail/client.rs)
  • Hotspot: src/account/context.rs (src/account/context.rs)
  • Hotspot: src/imap/backend.rs (src/imap/backend.rs)
  • Hotspot: src/imap/cli.rs (src/imap/cli.rs)
  • Hotspot: src/imap/envelope/search.rs (src/imap/envelope/search.rs)
  • Hotspot: src/jmap/email/read.rs (src/jmap/email/read.rs)
  • TodoComment (src/wizard/mailbox.rs)

New (16)

  • Dependency hygiene PARTLY measured — Cargo dependencies read, dependency currency not (crates.io unreachable)
  • Duplicated block (12 lines × 2) (src/gmail/drafts/create.rs)
  • Duplicated block (14 lines × 2) (src/account/check.rs)
  • Duplicated block (15 lines × 3) (src/shared/message/compose.rs)
  • Duplicated block (16 lines × 2) (src/gmail/backend.rs)
  • Duplicated block (5 lines × 2) (src/shared/message/forward.rs)
  • Duplicated block (6 lines × 2) (src/shared/attachment/download.rs)
  • Duplicated block (7 lines × 2) (src/gmail/client.rs)
  • Duplicated block (8 lines × 2) (src/imap/client.rs)
  • Duplicated block (8 lines × 3) (src/gmail/client.rs)
  • Low cohesion: GmailClient (LCOM4 8) (src/gmail/client.rs)
  • Low cohesion: ImapClient (LCOM4 6) (src/imap/client.rs)
  • Low cohesion: JmapClient (LCOM4 7) (src/jmap/client.rs)
  • Low cohesion: MsgraphClient (LCOM4 7) (src/msgraph/client.rs)
  • Projects may be oversized for their cohesion
  • TodoComment (src/config.rs)

Changes since last survey

  • 20 commits — 9 feature/other, 11 fixes

By area

  • (root) — 11 commits
  • src/gmail — 3 commits
  • src/shared — 3 commits
  • cairn/changes — 2 commits
  • src/email — 1 commit

Notable commits

  • fix: fix(gmail): retain added-message details in history output
  • fix: fix(gmail): retain thread MIME payloads in JSON
  • fix: fix(gmail): return structured draft write identities
  • fix: fix(imap): move without the MOVE extension
  • fix: fix(imap): terminate the last raw command with CRLF
  • fix: fix(imap): utf-8 charset
  • fix: fix(smtp): stop transmitting the Bcc field
  • fix: fix: message composition args
  • fix: fix: parse display names in To, Cc and Bcc the same way as From
  • fix: fix: remove value delimiter for message composition
  • fix: fix: strip surrounding quotes from quoted search patterns
  • change: build: bump all deps
  • change: docs(readme): fix wrong flag add command
  • change: docs(readme): remove nix from sources install section
  • change: feat: add mailbox role
  • change: feat: add proxy entry to config file
  • change: fix: typos in prev commit
  • change: refactor: adjust pimdir
  • change: refactor: improve secret resolution
  • change: refactor: normalize path expansion

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

pimalaya/himalaya was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 29 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 136d20ad44f9a899ef2c71d64228711344ed6e52 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-c4983f2d4e5c.