Skip to content
nihilist-narwhalPublic

About

A local-first Gmail client in pure Rust: Turso store with full-text search, native iced UI, Google OAuth

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RustMail

A local-first email client written entirely in Rust.

  • core — Gmail IMAP sync into a local Turso database, with full-text search (Turso's fts index, built on Tantivy).
  • desktop — native GPU-rendered UI on iced. No web view.
  • cli — rustmail command 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.

Sign in with Google (OAuth)

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:

  1. Open https://console.cloud.google.com/, create a project (e.g. "RustMail").

  2. APIs & Services → Library: enable the Gmail API.

  3. 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.
  4. 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-desktop

Google 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.

CLI

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 keyring

The first sync pulls the 500 most recent messages from [Gmail]/All Mail.

App passwords instead

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).

Tests

cargo test                                       # offline tests
cargo test -p rustmail-core -- --include-ignored # also hits the OS keyring and Google

Keys

j/k or arrows: move · /: search · r: sync · Esc: clear search / close

Files

Config ~/.config/rustmail/config.toml · mail ~/.local/share/rustmail/mail.db

About

A local-first Gmail client in pure Rust: Turso store with full-text search, native iced UI, Google OAuth

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages