跳到正文
Hacker News (official RSS)(tangled.org)·· 7 天前品質評分52

Parcel 用 Zig 打造 Linux 桌面郵件程式,整合 Gmail 和 Fastmail

Parcel: A desktop mail client for Linux, built with Zig

重點導讀

在 Linux 桌面上檢視不同郵件帳號,常要切換服務或回到伺服器搜尋。

  • Parcel 是用 Zig 和 siv 打造的郵件程式,可連線 Gmail、Fastmail 和支援 JMAP 的伺服器,並把郵件放在同一個清單中,讓你用標籤篩選、鍵盤操作和搜尋來整理信件。
  • 它會在本機建立郵件索引,多數搜尋完成後可直接查索引,不必每次都問伺服器。
  • 尚未登入時,程式會先顯示範例郵件。

AI 伴隨問答

自備 Key 深度分析

針對這篇報導有疑問?可直接點選快捷問題或向 AI 追問背景脈絡與技術細節:

正文

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 under a rule of its own, 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 #

Parcel opens on sample mail under its Add account page until it has an account; after that, the palette's Add account (Ctrl+K) opens the page. Sign in with Google, Fastmail, or another JMAP server; the account opens as soon as you have, named for the address you signed in with.

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. Rename an account by renaming its directory while parcel is not running.

Gmail #

Gmail signs in in the browser with Parcel's own Google client, which release builds carry. An account's refresh token is kept in its directory's google-token, readable only by you.

Where a Google Workspace admin blocks apps they have not approved, ask them to trust Parcel's client ID. Or use a client of your own, which Parcel prefers whenever it is there; a build from source without -Dgoogle-client-secret needs one too:

  1. In the Google Cloud console, enable the Gmail API for a project: your organization's, where Workspace trusts its own apps.
  2. Under Google Auth Platform, create a client of type Desktop app. For a project outside your organization, add yourself as a test user.
  3. Download the client's JSON and save it as ~/.config/parcel/google-client.json.
  4. Add the account, and sign in in the browser it opens.

A sign-in works only with the client that made it, so an account signed in with your own client keeps needing its file. While your project's app is in testing, Google expires the sign-in after seven days; sign in again then with parcel login gmail NAME.

Fastmail and other JMAP servers #

Fastmail signs in in the browser: Parcel registers itself with Fastmail as it signs in, so there is nothing to set up. Another JMAP server does the same where it offers OAuth for desktop apps; give it the server's address. Either one also takes a token in place of the browser: for Fastmail, make one in Settings, Privacy & Security, Manage API tokens, with access to Email and Email submission; a token of the form user:password goes as Basic authorization.

The sign-in is kept in the account's directory, readable only by you: jmap-oauth for the browser's, jmap-token for a token. From a terminal, parcel login fastmail NAME and parcel login jmap NAME https://mail.example.org/.well-known/jmap sign in with a token too.

Work on it #

mise installs the toolchain, including bs, the Debug-mode compiler used for development builds, which also lints: mise install, then just setup for the baskingspot lint rules. just --list shows the recipes, and just ci builds parcel and runs the tests and lint. AGENTS.md has the conventions.

讀者討論

理性交流 · 即時討論