A local-first email client written entirely in Rust.
- core — Gmail IMAP sync into a local Turso database, with full-text search (Turso's
ftsindex, built on Tantivy). - desktop — native GPU-rendered UI on iced. No web view.
- cli —
rustmailcommand for syncing and poking at the store.
The UI only ever reads from the local database, so browsing and search never wait on the network.
RustMail signs in with Google in your browser and keeps the refresh token in your OS keyring (gnome-keyring, KWallet or KeePassXC via Secret Service). It never sees your password.
Google requires every app to have its own OAuth client, so do this once:
-
Open https://console.cloud.google.com/, create a project (e.g. "RustMail").
-
APIs & Services → Library: enable the Gmail API.
-
Google Auth Platform:
- Branding: app name "RustMail", your email as support and developer contact.
- Audience: user type External, leave it in Testing, and add your Gmail address under Test users.
- Data access: add the scope
https://mail.google.com/. - Clients → Create client: type Desktop app. Copy the client ID and secret.
-
Put them in
~/.config/rustmail/config.toml:[google] client_id = "1234-abc.apps.googleusercontent.com" client_secret = "GOCSPX-..."
(or set
RUSTMAIL_GOOGLE_CLIENT_ID/RUSTMAIL_GOOGLE_CLIENT_SECRET).
Then run the app and click Sign in with Google:
cargo run --release -p rustmail-desktopGoogle will warn that the app is unverified; that's expected for your own Testing-mode client. Choose Continue.
Heads-up: while the client is in Testing, Google expires refresh tokens after 7 days.
RustMail then shows a Sign in with Google button; one click and you're back. Publishing
the app removes that limit, but mail.google.com is a restricted scope, so a public release
needs Google's verification and a security assessment.
cargo run -p rustmail-cli -- add you@gmail.com # opens the browser to sign in
cargo run -p rustmail-cli -- sync
cargo run -p rustmail-cli -- search invoice
cargo run -p rustmail-cli -- login # sign in again
cargo run -p rustmail-cli -- logout # remove the token from the keyringThe first sync pulls the 500 most recent messages from [Gmail]/All Mail.
If you'd rather skip Google Cloud: turn on 2-Step Verification, create an app password at
https://myaccount.google.com/apppasswords, and pick Use an app password instead in the
app (or rustmail add --app-password you@gmail.com with RUSTMAIL_PASSWORD set).
cargo test # offline tests
cargo test -p rustmail-core -- --include-ignored # also hits the OS keyring and Googlej/k or arrows: move · /: search · r: sync · Esc: clear search / close
Config ~/.config/rustmail/config.toml · mail ~/.local/share/rustmail/mail.db