Skip to content
unicornopsPublic

About

Repo for the zmail project

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Zmail

Zmail is a fast, local-first email client for the desktop and the terminal, written in Rust. It speaks IMAP, JMAP and SMTP, keeps an encrypted copy of your mail on your computer so browsing never waits for the network, and treats every message as untrusted. The desktop app is built on GPUI and reads unchanged Zed theme files; the terminal UI works like Pine and Alpine.

Note

Zmail is beta software. Reading, searching and sending mail over IMAP, JMAP and SMTP, the encrypted local store, the desktop app on macOS, Windows and Linux, and the terminal UI all work and are tested in CI against live test mail servers, but expect bugs and some changes between releases. Keep your mail on the server and back up anything that matters; native Proton Mail support is still marked Experimental.

Zmail's desktop app in the light theme: the sidebar with accounts and folders, the Inbox, and a conversation open in the reader The same view in the dark theme

The terminal UI (zmail-app tui), on the same store and accounts:

Zmail's terminal UI in a dark terminal: the Message Index of the Work inbox on the left, with four conversations (one flagged, two unread, one from a Japanese sender with a Japanese subject), and the preview pane on the right showing the selected two-message conversation and its numbered link; the command bar of keys along the bottom

Screenshots show synthetic test mail, captured for each release (how they are kept current): the desktop ones from the UI screenshot matrix, the terminal ones from the terminal UI's snapshot tests. Terminal UI has more screens, and the Message Index as text.

Download

Get the latest release from GitHub Releases:

System File
macOS (Apple silicon) Zmail-<version>.dmg (signed and notarised), or zmail-macos.app.zip; zmail-macos.tar.gz is the zmail-app binary alone, handy for the terminal UI
Windows (x86-64) zmail-windows-x86_64.msi (installer), or zmail-windows-x86_64.zip
Debian and Ubuntu (x86-64) zmail-linux-x86_64.deb
Other Linux (x86-64) zmail-linux-x86_64.tar.gz

The macOS DMG is signed with an Apple Developer ID and notarised; the Windows and Linux downloads are not signed. Installing Zmail explains each file, HTML mail on Linux, upgrading, and where Zmail keeps its data.

Check your download

Checksums. Each release has SHA256SUMS-Linux, SHA256SUMS-macOS and SHA256SUMS-Windows. Download the one for your system into the folder with your download, then check just that file:

grep zmail-linux-x86_64.deb SHA256SUMS-Linux | sha256sum --check      # Linux
grep Zmail-0.44.0.dmg SHA256SUMS-macOS | shasum -a 256 --check        # macOS (use your version)

On Windows, compare (Get-FileHash .\zmail-windows-x86_64.msi).Hash (PowerShell) with the file's line in SHA256SUMS-Windows. A checksum shows the download is intact, but it comes from the same release page, so it cannot show who built the file.

Build provenance. Every release asset also has a build provenance attestation, signed through Sigstore by the release workflow. It shows that the file was built by unicornops/zmail's release workflow on GitHub Actions, and from which commit. Check it with the GitHub CLI, from the folder you downloaded to; it exits with status 0 when the file matches, and fails otherwise:

# macOS
gh attestation verify Zmail-0.44.0.dmg --repo unicornops/zmail      # use your version
gh attestation verify zmail-macos.app.zip --repo unicornops/zmail
gh attestation verify zmail-macos.tar.gz --repo unicornops/zmail
# Windows
gh attestation verify zmail-windows-x86_64.msi --repo unicornops/zmail
gh attestation verify zmail-windows-x86_64.zip --repo unicornops/zmail
# Linux
gh attestation verify zmail-linux-x86_64.deb --repo unicornops/zmail
gh attestation verify zmail-linux-x86_64.tar.gz --repo unicornops/zmail

Add --format json to see the workflow, commit and tag the file was built from. Check your download has more.

Features

  • Desktop app for macOS, Windows and Linux, and a terminal UI, sharing one store and one set of accounts.
  • IMAP, JMAP and SMTP, with OAuth2 sign-in; account setup finds the server settings and tests the sign-in before saving. Native Proton Mail accounts (paid plans) are Experimental.
  • Local-first: the mail is mirrored into a SQLCipher-encrypted store, so browsing, search and mail actions never wait for the network; sync and sending run in the background.
  • Full-text search with operators such as from:, has:attachment and after:30d, asking the server too until every message is indexed.
  • HTML mail in a locked-down web view with remote content blocked until you allow it, or as plain text; sender-safety warnings for look-alike domains and misleading names.
  • Compose with drafts, attachments, undo-send and an outbox; multiple identities.
  • Passwords and the store key in the system keychain; no telemetry.

What Zmail has is the full list.

Quick start

  1. Install Zmail from the latest release.
  2. Start it from your applications menu or Start menu, or run zmail-app. With no account yet, it shows a welcome screen: choose your provider and sign in, and Zmail finds the server settings, tests the connection, saves the account and starts the first sync.
  3. Gmail needs an app password or an OAuth client of your own; the Add Account flow explains both.
  4. For the terminal UI, run zmail-app tui; S on its Main Menu adds an account. To sign in to an account again without removing it, choose it in Setup → Accounts, press C, then Enter on the first row: a new password, the browser for OAuth, or Proton's sign-in (whether or not Proton has ended Zmail's session). Its mail stays and nothing downloads again.
  5. To open mailto: links in Zmail, make it your default mail app: in Mail's Settings > General on macOS, Settings > Apps > Default apps on Windows, or your desktop's default apps (or xdg-mime default ie.unicornops.zmail.desktop x-scheme-handler/mailto) on Linux. Make Zmail your mail app has the details.

Zmail needs the system keychain: Keychain on macOS, Credential Manager on Windows, or a Secret Service such as GNOME Keyring or KWallet on Linux. Over SSH, see Using Zmail over SSH or on a headless machine.

Settings → Mail

The desktop app's Settings window has a Mail section; each choice applies as soon as it changes. Settings → Mail has the details.

  • HTML mail: Formatted (the locked-down web view, remote content blocked until you allow it) or As Plain Text for every message. A message's More menu still switches that one message. Setting ZMAIL_WEB_RENDERER=0 in the environment turns the web view off whatever this row says: HTML mail is then always plain text, and the row says why and cannot be changed. The same happens in a build without a web renderer.
  • New mail notifications: On (the default) or Off, for new mail that arrives while Zmail is not the window in front. Notification content chooses Sender and subject (the default) or Only 'New mail', which leaves the sender and subject out, for a lock screen or a shared screen.
  • Background indexing: downloads the IMAP messages you have not opened, newest first and within each account's disk budget, so search finds words in them. On battery power and On metered connections each choose Pause (the default) or Keep Indexing. So far Zmail can tell it runs on battery only on Linux, and cannot tell when a connection is metered, so on other systems indexing never pauses for battery, and the metered setting changes nothing yet.

The command line

zmail-app with no command opens the desktop app; with a command it works on the same store and accounts, for scripts, quick checks and machines without a window. The command line has every command.

zmail-app --help                    # every command (or -h)
zmail-app move --help               # one command's arguments and options; runs nothing
zmail-app --version                 # or -V

An unknown command or option, a missing argument or one too many is a usage error: Zmail prints what was wrong and the command's usage, runs nothing, and exits with status 2 (any other failure exits with status 1):

$ zmail-app move 42
error: move needs MAILBOX
Usage: zmail-app move THREAD MAILBOX
Run `zmail-app move --help` for more.
$ echo $?
2

Accounts. add-imap and add-jmap ask for the account's details at prompts, then test the sign-in on the incoming and the outgoing server before anything is stored; if either fails, Zmail says why and adds nothing. An IMAP endpoint is imaps://host:993 (TLS), imap+starttls://host:143 (STARTTLS, never falling back to clear text) or imap://host:143. A server without TLS (imap://, http:// for JMAP, or SMTP security plain) is refused unless it is on this machine or --allow-cleartext is given:

zmail-app add-imap
zmail-app add-jmap --allow-cleartext    # e.g. a test server on your network without TLS
zmail-app list-accounts
zmail-app sync all

Mailboxes and moving. mailboxes ACCOUNT lists an account's mailboxes with their ids, roles and conversation counts. move takes a mailbox by its id, its role (inbox, drafts, sent, archive, junk or trash) or its name:

zmail-app mailboxes 1
zmail-app move 42 7
zmail-app move 42 archive
zmail-app move 42 "Old projects"

Deleting for good and saving attachments. delete moves a conversation to the Trash; one already in the Trash, or in an account with no Trash, is deleted for good instead. That, and empty-trash, ask first in a terminal and need --yes anywhere else (a script, a pipe). save-attachment never replaces a file of the same name unless --overwrite is given:

zmail-app delete 42
zmail-app empty-trash 1 --yes
zmail-app attachments 42
zmail-app save-attachment 12 ~/Downloads --overwrite

For scripts. --json prints one JSON document instead of text (indented on a terminal, on one line in a pipe or a file), for list-accounts, mailboxes, search, read, attachments, drafts, draft, outbox and dead-ops; other commands refuse it as a usage error. Fields are snake_case and ids are numbers; strings are as stored, with every control character written as a \u escape, so the output is safe in a terminal. A failed command still exits with status 1 and prints {"error": "…"} on standard error. The format is unstable while Zmail is alpha; JSON for scripts lists each command's fields.

zmail-app list-accounts --json | jq '.[] | {id, display_name}'
zmail-app search 1 invoice --json | jq '.hits[].thread_id'

Test servers. launch-imap-fixture opens the window on a test IMAP server with nothing saved. It reads the password from the ZMAIL_FIXTURE_SECRET environment variable, or else from standard input, never from the command line:

ZMAIL_FIXTURE_SECRET=phase2-password zmail-app launch-imap-fixture imap://127.0.0.1:3143 phase2 phase2@localhost

Performance

Zmail has numeric budgets for the interactions that should feel immediate, measured in the real window over synthetic mailboxes of 10,000, 100,000 and 1,000,000 conversations. The latest numbers, from a Ryzen 5 3600 on Linux (CPU time on the main thread, release build), with 100,000 conversations and with 1,000,000:

Interaction Budget 100,000 1,000,000
Cold start to the first painted list 500 ms (proposed) 77 ms 257 ms
Scrolling the thread list, per frame 8.3 ms 4.7 ms 4.7 ms
Mark read, flag or archive 100 ms 16–17 ms 111–113 ms
Opening a folder 100 ms 15 ms 15 ms
First page of search results, after the debounce 100 ms 25 ms 183 ms
Memory at idle (Linux) none yet 46 MiB 49 MiB

To reproduce them from a checkout (ZMAIL_PERF_THREADS sets the size; 100,000 without it):

cargo test --release -p zmail-ui --lib performance_budgets -- --ignored --nocapture
ZMAIL_PERF_THREADS=1000000 cargo test --release -p zmail-ui --lib performance_budgets -- --ignored --nocapture

Performance has every budget and number, how each is measured and what it leaves out. CI runs the 100,000 mailbox on pull requests that touch the UI or the store and uploads the results.

Documentation

The documentation is published at docs.zmail.unicornops.ie (the latest release, with main under /dev/), built from the pages below.

Read For
Installing Zmail downloads, checking them, first run, making Zmail your mail app, upgrading, SSH and headless machines, where data is kept, platform notes
What Zmail has the full feature list, Settings → Mail, and the desktop app's keymap file for your own keys
Terminal UI keys, triage, compose, accounts, and the keymap file for your own keys
The command line every zmail-app command, with examples
Searching mail the search language, search scope and server search
Gmail with your own OAuth client signing in to Gmail with OAuth
Development building from source, tests, the live mail harness, UI screenshots, design documents
Architecture decisions the ADRs: JMAP, GPUI pin, Proton Mail, store encryption, HTML mail, terminal UI
Performance performance budgets and the latest numbers
Hardening and release policy accessibility, crash reporting, packaging, signing and releases
Security policy how to report a vulnerability
Changelog what changed in each release

Licence

Zmail is licensed under GPL-3.0-only. Dependency policy is enforced through deny.toml and prepared for cargo-about via about.toml.

Linux builds embed the Inter UI font (4.1, SIL Open Font License 1.1, assets/fonts/inter/LICENSE.txt); the .deb installs its licence under /usr/share/doc/zmail-app/. All builds embed Lucide icons (ISC, with the Feather-derived icons also under MIT, assets/icons/LICENSE.txt), and code ported from GPUI is Apache-2.0 (crates/zmail-ui/LICENSE-APACHE). The local store is encrypted with SQLCipher (BSD-3-Clause, crates/zmail-store/LICENSE-SQLCIPHER), which on Linux and Windows links a statically built OpenSSL (Apache-2.0, crates/zmail-store/LICENSE-OPENSSL); see ADR 0005. Bundled non-crate assets and ported source files are listed in about.toml.

About

Repo for the zmail project

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages