MailboxBoy with Jev

September 20, 2026 ยท View on GitHub

Personal Gmail assistant written in Go. It classifies mixed Chinese/English mail with TypeSafe Jev (jev-1.13.0) and writes Gmail labels. Safety (spam/fraud) is a Go gate in front of life categories such as finance, campus, and verification codes.

This is a local-first personal tool, not a multi-tenant product. Mail text is sent to TypeSafe to classify. Gmail OAuth tokens and API keys never belong in git.

Features

  • User-defined taxonomy (YAML): label name + description โ†’ Jev Noul/Score questions
  • One Jev request per message (speculative fan-out); Go applies thresholds and Gmail names
  • Spam/fraud switches; known senders and campus domains can veto auto-spam
  • Incremental Gmail History sync and a long-running serve daemon
  • Docker Compose for a always-on box (poll every 5s; optional Gmail Pub/Sub push)
  • Frozen JSON Schema for the Jev request/response and MailboxBoy state

Docs

DocumentContents
docs/design.mdArchitecture, policy, schemas, sync model
docs/usage.mdOAuth, CLI, taxonomy, review
docs/deploy.mdDocker Compose, server layout, operations

Quick start

cp .env.example .env          # set TYPESAFE_API_KEY
go test ./...
go run ./cmd/mailboxboy labels init
# Place a Gmail Desktop OAuth client JSON at ~/.config/mailboxboy/credentials.json
go run ./cmd/mailboxboy auth
go run ./cmd/mailboxboy labels ensure
go run ./cmd/mailboxboy sync --max 20          # dry-run
go run ./cmd/mailboxboy sync --max 20 --apply  # write labels
go run ./cmd/mailboxboy serve                  # daemon: poll + /healthz

Always-on with Compose: see docs/deploy.md.

Layout

cmd/mailboxboy/     CLI and serve daemon
internal/           classify, policy, gmail, store, typesafe client
configs/            default taxonomy (embedded)
schemas/            frozen JSON Schema for Jev I/O
testdata/           .eml fixtures and golden.jsonl
config/ data/       Docker bind-mount placeholders (secrets stay on the host)

License

Private personal project. See the GitHub repository for access.