6.6 KiB
RustBox 0.0.2
RustBox is a webmail derived from c0h1b4/oxi. The consumed Oxi revision is recorded in UPSTREAM_BASE.
The repository is one Cargo application. The RustBox browser interface lives under src/web/, uses HTML/CSS/vanilla JavaScript, and is embedded into the Rust executable at build time. There is no TypeScript, React, Next.js, Node.js or Bun build step.
Layout
rustbox/
├── Cargo.toml
├── Cargo.lock
├── build.rs
├── src/
│ ├── main.rs
│ ├── ui.rs
│ └── web/
│ ├── index.html
│ ├── js/
│ │ ├── manifest.txt
│ │ └── *.js
│ ├── icons.svg
│ └── css/
├── migrations/
├── tests/
├── examples/
├── docs/
├── packaging/
├── scripts/
├── config.dev.toml
├── config.example.toml
├── UPSTREAM_BASE
└── dev.sh
build.rs combines the CSS modules from src/web/css/manifest.txt and JavaScript modules from src/web/js/manifest.txt. Cargo embeds the generated CSS/JS bundles, HTML and SVG sprite in the RustBox executable. There is no standalone source src/web/app.js; src/web/ is the single source of truth and Cargo generates the embedded bundles in OUT_DIR.
Configure mail servers
Mail endpoints are configured by the administrator, not on the login screen. Users enter only email and password.
Edit config.dev.toml before the first run:
imap_host = "mail.example.com"
imap_port = 993
smtp_host = "mail.example.com"
smtp_port = 587
tls_enabled = true
# Optional; defaults to imap_host.
# sieve_host = "mail.example.com"
sieve_port = 4190
sieve_tls_mode = "starttls"
sieve_allow_insecure_auth = false
# Optional administrator-owned headers added to every outgoing message.
# Structural/MIME headers such as From, To, Subject and Content-Type are rejected.
outgoing_headers = [
"X-Company-Mailer: RustBox",
]
If imap_host is missing or blank, RustBox fails configuration validation at startup instead of letting login succeed into a broken Inbox state.
Current 0.0.2 UI snapshot
The internal baseline includes persistent appearance/layout preferences, draggable mail-pane splitters, action toasts, recipient autocomplete, attachment preview/context actions and client-side ZIP download in addition to the existing IMAP/Sieve/mail workflow. The authoritative completion scope remains docs/RUSTBOX_PLAN.md; incomplete items are tracked in docs/IMPLEMENTATION_STATUS.md.
Development
Requirements: Rust toolchain with Cargo. OpenPGP key generation/sign/encrypt/decrypt is implemented with rPGP. Changing the passphrase of an existing private key additionally requires GnuPG (gpg) on the server; override the executable with RUSTBOX_PGP_GPG_BINARY if needed.
./dev.sh
Then open:
http://127.0.0.1:3001
To use another configuration:
RUSTBOX_CONFIG=/path/to/rustbox.toml ./dev.sh
Normal Cargo commands work from the repository root:
cargo run
cargo test
cargo build --release
UI
RustBox uses a compact three-pane mail layout: folders, message list and reader. The current internal baseline includes configurable special IMAP folders, collapsible folder hierarchy, folder CRUD/subscriptions, move/copy/bulk actions, drag-and-drop message moves, collapsible threads, raw headers/source download, labels, advanced/saved search, quota warnings, contacts/groups/vCard, calendar/ICS import, identities/signatures with automatic reply identity selection, HTML/plain/Markdown compose modes, CID inline images, and ManageSieve raw + visual rule editing with negation, dynamically addable conditions/actions and nested AND/OR chaining. OpenPGP includes per-user key management, identity binding, PGP/MIME + inline sign/encrypt/decrypt/verify, WKD/HKP discovery and private-key passphrase management.
IMAP IDLE events are delivered to the browser over the embedded WebSocket endpoint for realtime refresh and optional desktop notifications. Notification preferences include sound, folder selection and Do Not Disturb hours.
Appearance preferences are persisted per account and include light/dark/system theme, density, preview position, UI scale, multiple color presets, custom accent/background/panel/text colors, font, row height, pane widths, radius, contrast and visibility toggles. The mailbox toolbar also exposes persisted date/sender/subject/size sorting, and remote images can be restricted to saved contacts.
The native RustBox interface intentionally uses flat surfaces, small radii and one SVG icon set. Compatibility skins may reproduce upstream visual treatments such as gradients, while toolbar icons remain SVG rather than Unicode glyphs.
ManageSieve
Supported modes:
starttls— recommended;implicit— TLS immediately after connect;none— plaintext transport; reusable credential authentication remains blocked unlesssieve_allow_insecure_auth = trueis explicitly enabled.
When sieve_host is not configured, RustBox uses the authenticated session's IMAP host. Sieve uses the same session credentials; passwords are not exposed to the browser after login.
Native installation
./scripts/build-release.sh
sudo ./scripts/install-systemd.sh
sudo systemctl enable --now rustbox
sudo journalctl -u rustbox -f
For public access put an HTTPS reverse proxy in front of RustBox. The production example binds to 127.0.0.1:3001.
Following Oxi
Initialize Git after extracting the release archive:
git init
git add .
git commit -m "RustBox 0.0.2 release"
./scripts/setup-upstream.sh
Inspect newer Oxi changes:
./scripts/oxi-status.sh
Import the mapped Oxi backend delta:
./scripts/sync-upstream.sh
Oxi backend/... paths are mapped into RustBox's flat Cargo tree. Oxi frontend sources are never copied. Relevant upstream frontend behavior is reviewed and reimplemented in src/web/. UPSTREAM_BASE advances only after ./scripts/finish-upstream.sh completes review and the build gate.
To port one backend commit without advancing the baseline:
./scripts/oxi-port-commit.sh <oxi-commit>
See docs/UPSTREAM.md for details.
Attribution
See NOTICE.md. The supplied Oxi snapshot did not contain an authoritative LICENSE file; verify the exact upstream licensing terms before public redistribution.
Internal roadmap scope
The authoritative internal feature plan is docs/RUSTBOX_PLAN.md. Current implementation status is tracked in docs/IMPLEMENTATION_STATUS.md. The historical baseline plan remains in docs/RUSTBOX_PLAN.md; current release deltas are documented in CHANGELOG.md and docs/releases/.