README.md

parcel #

A mail client for Gmail and Fastmail on the Linux desktop, built with Zig and siv.

Parcel's mail list, light and dark

Parcel shows mail as one list, chosen by label filters you stack: Inbox, or Inbox and Work, or any label alone. Every action has a key, and Ctrl+K lists them all. It reads your Gmail, Fastmail, or any JMAP server once you sign in, and shows sample mail until then. Each account has its own list, and the header switches between them.

A look around #

A thread opens over the list. Quoted replies nest, each level in its own color, and HTML mail shows as its sender laid it out.

A thread open in the reader, its quoted replies nested

r replies, over a quote of what you answer. The editor has Vim's keys and a toolbar for marks, links, quotes, and lists.

A reply being written over the nested quote of the thread

/ searches as you type, with Gmail's operators, whichever account it is. Right after an operator such as from:, it suggests the people, labels, or values it takes. Parcel keeps its own index of your mail, and once it has been through all of it, answers most searches without asking the server.

A search for Lisbon, suggesting people for from:

The mail in these screenshots is made up.

Build it #

Parcel needs Zig 0.17.1, just, a Wayland compositor, and the development files for libcurl, Wayland, xkbcommon, Fontconfig, and the Vulkan headers:

sudo apt install just libcurl4-openssl-dev libwayland-dev libxkbcommon-dev libfontconfig-dev libvulkan-dev  # Debian, Ubuntu
sudo dnf install just libcurl-devel wayland-devel libxkbcommon-devel fontconfig-devel vulkan-headers        # Fedora
sudo pacman -S just curl wayland libxkbcommon fontconfig vulkan-headers                                     # Arch

Then:

just run

Install it #

just install

This puts parcel in ~/.local/bin, and its desktop entry and icon in ~/.local/share, so app launchers list Parcel. Pass another prefix to install elsewhere, such as just install /usr/local (with sudo).

Sign in #

Gmail #

Parcel signs in to Gmail with an OAuth client of your own, until it has one to ship:

  1. In the Google Cloud console, enable the Gmail API for a project.
  2. Under Google Auth Platform, add yourself as a test user, then create a client of type Desktop app.
  3. Download the client's JSON and save it as ~/.config/parcel/google-client.json.
  4. Run parcel login, and sign in in the browser it opens.

Each account has a name, its directory's under ~/.local/state/parcel/accounts, which the header shows and Ctrl+1 to Ctrl+9 count in sorted order. parcel login signs in to one named Gmail; parcel login gmail Work adds another, or signs in to it again. Rename an account by renaming its directory while parcel is not running.

An account's refresh token is kept in its directory's google-token, readable only by you. While the Cloud project's app is in testing, Google expires it after seven days; run parcel login again then.

Fastmail #

  1. In Fastmail's Settings, under Privacy & Security, Manage API tokens, make a token with access to Email and Email submission.
  2. Run parcel login fastmail, and paste the token.

parcel login fastmail Work names the account something other than Fastmail. Another JMAP server takes its session URL, as in parcel login jmap Home https://mail.example.org/.well-known/jmap; a token of the form user:password goes as Basic authorization. The token is kept in the account's jmap-token, readable only by you.

Work on it #

nix develop provides the toolchain, including bs, the Debug-mode compiler used for development builds. just --list shows the recipes, and just ci builds parcel and runs the tests and lint. AGENTS.md has the conventions.