wax

User guide

Install Wax, sign in with Google, and learn the keys, labels, plugins, themes and settings files.

Install

Wax builds from source on an Apple silicon Mac.

git clone https://github.com/tekanic/wax.git && cd wax
scripts/install.sh

install.sh makes a release build, signs it with your Apple Development certificate if you have one, builds the plugins, installs ~/Applications/Wax.app and opens it. Run it again to update. You'll need Rust and a Google OAuth client for sign-in; see Accounts.

Accounts

Add accounts in Settings → Accounts. Gmail and Google Workspace accounts use Sign in with Google: your browser opens Google's sign-in page and the app never sees your password. Tokens are kept in the macOS Keychain (service gpui-mail-google). Each account has its own sender name, default signatures, From addresses and sender rules, and its own new-mail watcher.

The sidebar keeps All Inboxes, All Sent and your accounts pinned at the top (visible however short the window), with the folders of the account on screen below. All Inboxes merges every account's Inbox, newest first, each row tagged with its account; All Sent does the same for Sent, and a search there covers every account's sent mail; reading, replying, archiving, starring and sender decisions there act on the message's own account.

Google sign-in needs an OAuth client:

Test a login without the UI: cargo run -- --check (first account).

Keyboard

Shortcuts are defined once in src/keys.rs; the same table drives the key bindings, the hint bar at the bottom of the window and the g menu. ~/.config/wax/keymap.toml changes any of them: a section per place ([list], [writing], [global]…), lines like "shift-e" = "archive", and "none" to switch a key off. Mistakes show in the status bar and Settings → Problems.

Keys Where Does
j / k, ↓ / ↑ list next / previous message
u, ⇧⌘U list toggle read / unread
/, ⌘F list, anywhere search
g then i s t d a list go to Inbox, Starred, Sent, Drafts, All Mail
⏎, ↓ search box jump into the results
esc search box, list clear the search
c / r / a / f list compose / reply / reply all / forward
⌘⏎ writing send (8 s to undo with ⌘Z)
⌘S writing save draft to Gmail, keep writing
esc writing save draft to Gmail and close
⇧⌘⌫ writing discard
⌘B ⌘I ⌘⇧X writing bold / italic / strikethrough (again to remove)
⌘K writing link (uses a copied URL)
⌘E writing inline code, or a code block for several lines
⌘⇧8 ⌘⇧7 ⌘' writing bulleted list / numbered list / quote
⌘⇧P writing preview the message as it will arrive
⌘⇧A writing attach files
⌘⇧B writing Bcc on / off
⌘⇧K writing make a block of the selection
tab writing next placeholder; after a block's shortcut (;quote), insert it; in a table, next cell (and recalculate)
⏎ Drafts folder edit the draft
x / ⌘A list mark one / mark all loaded (esc clears)
e list archive marked (or current); in Trash, Spam and Screened Out: back to the Inbox
s / i list star / mark important (again to undo)
b list block the sender (Screened Out); in Screened Out: allow them back
! list report spam: move to Spam, and the spam filter learns from it
⇧R / ⇧C list file everything from the sender in Reading / Records
right-click list menu of everything above, for the message or the selection
two-finger swipe list right: read / unread; left: archive (or the folder's e)
⌫, # list delete marked (or current) to Trash
⌘Z list undo the last archive, delete or sender decision (8 s)
g w list open the Sweep
r / c / x / i Sweep Reading / Records / screen out / keep (set in the Sweep plugin's config.toml)
l list label the message(s); ⇧⏎ in the picker also archives
⌘/ anywhere hide / show the hint bar

Single-letter keys only act when the search box isn't focused, so they can be typed into a search.

Blocks

Blocks are pieces you write often, kept as Markdown files in ~/.config/wax/blocks/. Drag one from the Blocks panel into a message, click it to add it at the cursor, or type its shortcut and press tab.

Placeholders. {{client}} marks text to fill in, {{qty:1}} gives it a default. Inserting a block selects the first placeholder: type over it, tab to the next, ⇧tab back. A placeholder that appears twice is typed once. {{first name}} and {{recipient}} come from the To field, {{me}} is your name, {{today}} and {{tomorrow}} are dates, and {{cursor}} is where you end up.

Making blocks. Select part of a message and press ⌘⇧K (or New block… in the panel). The editor beside the message turns a selection into a placeholder and suggests some itself: the recipient's name, amounts, days and dates. A shortcut is written at the top of the file:

---
shortcut: ;quote
---
Hi {{first name}}, here's the quote for {{project}}:

Tables that add up. Tables recalculate whenever tab moves between cells:

The Quote starter (;quote) puts all of this together.

Labels

Press l on a message (or on marked messages, or pick "Label…" from the right-click menu) to open the label picker: type to filter, the message's current labels are ticked, ⏎ adds or removes the highlighted label, typing a new name offers to create it, and ⇧⏎ labels and archives. In All Inboxes it uses the message's own account's labels.

Settings → Labels lists each account's Gmail labels: create (use / to nest), rename (nested labels and sender rules follow) or delete (asks twice; the messages stay in All Mail, only the label goes). The Sweep's Reading, Records and Screened Out are managed from the Sweep.

Plugins

New mail goes through one path (src/plugins.rs). Sender rules, built in because the Sweep, the Lobby and block/allow all write them, file mail from senders you've decided about. What's left goes to the WebAssembly plugins before it's shown or announced, so mail a plugin moves (the Screener's Lobby, a Filter rule) never flashes into the Inbox or sets off a notification.

The plugins live in ~/.config/wax/plugins/<id>/plugin.wasm (interface: wit/plugin.wit, wax:plugin@0.5.0). Each call runs on a fresh instance with no files, no network, 64 MB of memory and a fuel limit: a call that runs out of time is skipped, and a plugin that keeps doing it is switched off. A new plugin starts off; Settings → Plugins shows what it asks for and switches it on, which writes its grants.toml. Actions beyond what was granted are refused. Each plugin reads its own config.toml.

scripts/build-plugins.sh            # build plugins/* and install them

Writing one: the plugin guide (source). The interface is MIT licensed, so a plugin can use any license.

The Sweep (plugins/sweep) is a plugin: it ranks senders and sets the keys and where each one files a sender's mail (r = "Reading" # newsletters in its config.toml). Wax draws the view and keeps the sender rules, which the Screener and block/allow use too.

Snooze & follow-up (plugins/snooze): z (or the Snooze button) hides a message or conversation under a Snoozed label until a time, then puts it back in the Inbox unread; w on a message you sent brings it back if nobody has replied by then. Pick a time or type one: fri 9am, 12/3 5pm, in 2 days, tomorrow. Reminders live in the local cache, survive restarts and are checked every 30 seconds; snoozing again replaces the time, "Back to the Inbox now" unsnoozes. Its config.toml sets the morning and evening hours.

Phishing warnings (plugins/phishing): new mail from someone you don't know gets a Suspicious label when it adds up to phishing, and the status bar says why: a display name claiming a known brand (PayPal, Microsoft, banks, carriers…) from a domain that isn't theirs, a lookalike of a brand's or a correspondent's domain (paypa1.com, ernco.com), a brand's name inside a stranger's domain, an address shown in the name that isn't the sender's, a punycode domain, or a contact's name from a new domain plus pressure wording ("quick favor", "gift card", "bank details"). With read-bodies it also reads the message: Gmail's DMARC/SPF/DKIM verdict, a Reply-To pointing elsewhere, links that show a brand's or contact's site but go somewhere else, links to lookalike domains or bare IP addresses, and program or web-page attachments. Its config.toml sets the label, trusted domains and extra brands to protect. On 1,684 past messages from one-time senders it flagged 2, both reasonable; on 315 recent messages it flagged none of the Inbox and 32 of 135 in Spam (mostly forged senders). When it's switched on it sweeps the mail you already have (outside Spam and Trash), and it checks a message again when you open it or move it out of Spam, so a suspect message carries a ⚠ banner with the reasons wherever you read it.

Spam filter (plugins/spam) learns what spam looks like to you: from mail you report with !, senders you block with b, and mail you rescue from Spam or Screened Out. When first switched on it also learns from what you already have: Screened Out as junk, older mail you kept as good. Once it has seen enough of both, it moves new mail it's at least 97% sure of to Spam, with a ⚠ banner saying why; press e there and it learns it was wrong. It never touches mail from people you know. Its config.toml sets how sure it must be.

Spelling and grammar (plugins/spelling) checks what you write a moment after you stop typing: typos against an English (US) dictionary with suggested fixes, plus repeated words, "a" and "an", a lowercase "i" and sentences that start in lowercase. Quoted replies, code and links are left alone. Fixes show under the message; click one to apply it, or + to add a word to dictionary.txt.

Filter rules (plugins/filter-rules) acts on new mail, one rule per line:

subject contains "invoice" => label "Receipts"
from ends-with "@github.com" => move "GitHub"

Themes

Wax uses Zed's theme format, so any Zed theme works unchanged. Built in: Wax Dark and Wax Light, plus Zed's One, Ayu and Gruvbox families (MIT licensed; see assets/themes/*/LICENSE). Settings → General picks a light theme, a dark theme, and whether to match the Mac, use light or use dark. Drop more themes into ~/.config/wax/themes/ (themes in ~/.config/zed/themes/ show up too). Saving a theme file restyles Wax within two seconds, so you can tune one while you look at it.

Wax reads these Zed colors and works out anything a theme leaves out:

Zed key In Wax
editor.background Reading pane, compose
panel.background Sidebar
surface.background Message list
elevated_surface.background Menus and pickers
border.variant, border Dividers; inputs and menu edges
text, text.muted, text.placeholder Text, secondary text, timestamps and hints
text.accent Accent: unread dots, primary buttons, links
ghost_element.hover, ghost_element.selected List hover and selection
element.background, element.hover, element.active Search field, buttons, pressed buttons
error, warning Errors, delete confirmations, plugin warnings

Messages' HTML and signature previews keep a white page, since that's how they'll look to the people who get them.

Your files

Everything you set up is plain text in ~/.config/wax/ (like Zed's ~/.config/zed), so it can be backed up, kept in git or edited by hand. Wax picks up a saved change within two seconds; Settings → General → Show folder opens it.

settings.toml                       font, list while writing, theme
themes/<name>.json                  Zed theme files (any number of themes each)
keymap.toml                         every shortcut; defaults listed, commented out
accounts/<email>/account.toml       sender name, sign-in, default signatures
accounts/<email>/rules.toml         that account's sender rules: "address" = "keep" or a label
signatures/<name>/signature.toml    fields, layout, font, links, its account (+ logo.png, logo2.png)
signatures/.deleted/                deleted signatures, kept just in case
identities/<email>.toml             extra From addresses (and the account they send through)
blocks/<name>.md                    blocks for the composer (see Blocks)
dictionary.txt                      words the spelling check accepts, one per line

~/Library/Application Support/gpui-mail/ keeps what isn't a setting: cache.sqlite (only what can be fetched from Gmail again, plus the unsent-message autosave), errors.log (Settings → Problems) and google-client.json, your Google OAuth client. That one is a secret, so it stays out of ~/.config. Settings from older versions move to ~/.config/wax on first start.

gpui-mail --import-signature <file.html> <name> brings in an HTML signature (e.g. from Thunderbird's sig_file), logos and links included.

Problems

Status messages fade from the bottom bar (errors after 15 s). Errors, failed new-mail checks and sync stoppages are kept in errors.log in the data folder and shown under Settings → Problems, newest first, filterable by account, with Copy, Show file and Clear. A red ⚠ n chip in the bottom bar counts the ones you haven't looked at; click it to open Problems. The app keeps at most 4 connections per account (Gmail allows about 15 per account across all your mail apps): normally 2 for the account on screen (3 while older mail is still syncing) and 1 for each other account, which its new-mail check shares. Settings → Accounts shows how many are open. If the app can't connect (for instance Gmail refusing logins while too many connections are open across your mail apps), it tries again after 15 s, 30 s, 1 min and then every 2 min.

Edit this page on GitHub