ValenceMail

A secure, local-first terminal (TUI) email client in Rust featuring an interactive three-column layout, encrypted credential vault, and DNS auto-discovery.

Email Client GPL-3.0 License Rust / Ratatui Active Status

Overview

ValenceMail is a high-performance, keyboard-driven terminal user interface (TUI) email client built in Rust. Built with absolute privacy and local security in mind, it provides a fast, zero-dependency mail workflow directly in your terminal emulator.

Rejecting insecure plain-text configuration files and memory-expose risks, ValenceMail features a robust local-first credential vault encrypted with state-of-the-art cryptography alongside zero-on-drop memory zeroization buffers for maximum credential safety.

Core Capabilities

Interactive Three-Column Layout

  • Efficient Pane Workflow: Uses a structured Ratatui layout split into a folders pane, a message list pane, and a message reading / composing pane.
  • Smooth Navigation: Browse folders, scroll lists, view MIME email details, and compose replies instantly with simple, intuitive keyboard shortcuts.

Secure Credential Vault

  • Robust Encryption: Credentials and mail server configurations are stored locally in an encrypted vault (~/.config/valencemail/vault.enc) using Argon2id key derivation and AES-256-GCM encryption.
  • Memory Hygiene: Employs zero-on-drop SecretString wrappers to ensure sensitive passwords and derived cryptographic keys are wiped from RAM when they go out of scope.
  • Command-Line Setup: A friendly wizard guides you through master passphrase initialization and bootstraps your email credentials safely upon startup.

Multi-Account Management

  • Account Switching: Easily toggle between configured accounts directly in the TUI (accessible via the a key) or select them via a startup CLI menu.
  • Interactive Registration: Add new accounts on the fly with a secure in-TUI configuration form.

DNS MX Auto-Discovery

  • Hassle-Free Configuration: Auto-detects IMAP and SMTP configurations in the background using a robust DNS MX resolution fallback chain (Hardcoded outliers → SRV records → Domain guessing → Fallback MX).
  • Race Protection: Resolves DNS asynchronously in the background using is_dns_resolving guard flags to prevent overlapping manual configuration edits.

Advanced Compose & Signature Editor

  • TUI Signature Modal: Launch a dedicated overlay modal to design a multi-line email signature, supporting save (Ctrl+S) and cancel (Esc) hotkeys.
  • Automatic Signatures: Automatically appends configured signatures to composed drafts formatted with the standard -- \n delimiter.
  • Actions & Parsing: Delete (d) and Reply (r) to messages instantly. Employs the mailparse library to handle complex nested MIME structures, Base64/Quoted-Printable transfer encoding, and HTML-to-text cleanup.

Operations & CLI

ValenceMail includes CLI controls to facilitate administration and quick setup resets:

Startup Setup Wizard

Simply start ValenceMail to run the configuration wizard. If no vault exists, you will be prompted to set up your master passphrase and add your first account details.

Configuration Reset

bash - CLI Commands
# Completely purge and reset the credential vault valence-mail --reset

Compilation & Build

ValenceMail is written in Rust and can be easily built using Cargo or distributed as a Debian package (.deb) via GitLab CI/CD.

Build from Source

bash - Rust Compilation
# Clone and build the package git clone https://gitlab.com/quantum-hue/valencemail.git cd valencemail cargo build --release # Run the compiled binary ./target/release/valence-mail