BICHON
A self-hosted email archiving server built in Rust. Download emails from IMAP accounts, builds a full-text search index, and serves a REST API with an embedded WebUI. Purpose-built for long-term preservation, unified cross-account search, and programmatic access to archived email.
[!NOTE] Bichon is an archiver, not an email client. It does not send, compose, forward, or reply to emails. Its optional SMTP server is for receiving emails only.
Contents
- Features
- Quick Start
- Configuration Reference
- Authentication & RBAC
- CLI Tools
- API Reference
- Import & Export
- Architecture
- Storage & Backup
- Internationalization
- Data Migration (v0.x → v1.0)
- FAQ
- Roadmap
- Contributing
- Tech Stack
- License
Features
- Multi-Account IMAP Download: Download multi-account concurrently. Supports password (PLAIN/LOGIN) and OAuth 2.0 (SASL XOAUTH2) with automatic token refresh and PKCE. SSL/TLS, STARTTLS, or plain connections with optional self-signed certificate acceptance.
- Incremental Download: UID-based delta fetching downloads only new messages after the initial download. UIDVALIDITY changes are detected and trigger automatic cache rebuilds.
- Fetch Scoping: Filter download by date range, mailbox folder limit, or specific folder names. Configurable per-account SOCKS5 proxy routing.
- Auto-Configuration: Discover IMAP server settings automatically from an email domain.
- Full-Text Search: Search across subject, body, sender, recipients, attachment properties, and more. Optimized for European languages.
- Advanced Filters: Date range, size range, attachment presence, file type, content category, and facet-based tag combinations.
- Thread Grouping: Reconstruct and view complete conversation threads across folders.
- Attachment Search: Browse and filter attachments by sender, file type, size, and other attachment properties.
- Faceted Tags: Add, remove, or overwrite tags on messages and attachments. Filter by tag combinations with real-time count updates.
- Contacts View: Extracted and deduplicated sender/recipient address book across all authorized accounts.
- Three-Layer Storage: Tantivy for full-text indexing (Zstd compression), bichon-blob with Zstd for compressed blob storage, and memdb for relational metadata. All embedded — zero external dependencies.
- Content Deduplication: Identical email bodies and attachments stored once via BLAKE3 content hashing. Folder moves update metadata only.
- Dashboard Analytics: Email volume trends, top senders, storage usage breakdown, attachment statistics, and per-account activity. Scoped by user permissions.
- OpenAPI 3.0: Interactive API documentation at
/api-docs(Swagger UI, ReDoc, Scalar). All endpoints documented with request/response schemas. - Multi-User RBAC: 5 built-in roles (Admin, Manager, Member, AccountManager, AccountViewer) plus custom roles with 22 granular permissions.
- Account-Level Isolation: Grant users access to specific accounts with scoped roles. Permissions enforced at the API layer.
- CLI & WebUI Import Tools: Import from EML directories, MBOX files (including Gmail variants), Thunderbird profiles, and Outlook PST files via CLI. Import EML files directly from the WebUI.
- CLI Export: Download account data as MBOX via
bichon-cli. - Bulk Restore: Restore emails in bulk back to their original IMAP accounts.
- Embedded SMTP Server: Receive emails directly at the gateway level. STARTTLS or TLS encryption. AUTH PLAIN/LOGIN with API token authentication.
- Admin Tooling: Password reset for locked-out admins. Non-destructive migration from v0.3.7 and v1.x to v2.x.
- API Token Management: Create, list, and revoke long-lived API tokens for programmatic access.
- SOCKS5 Proxy Management: Configure and manage proxy profiles for routing IMAP traffic per account.
- Scheduled Download: Configure per-account download schedules using cron expressions. Run syncs at specific times or intervals — for example, nightly-only or business-hours-only archiving.
- Remote Content Blocking: External images and tracking pixels embedded in emails are blocked by default. Users can selectively allow remote content to load on a per-message basis from the WebUI.
- Async Index Deduplication: Duplicate detection in the search index is performed asynchronously, reducing write latency during high-throughput ingestion.
Quick Start
Docker (Recommended)
# Pull the image
docker pull rustmailer/bichon:latest
# Create data directory
mkdir -p ./bichon-data
# Run container
docker run -d \
--name bichon \
-p 15630:15630 \
-v $(pwd)/bichon-data:/data \
--user 1000:1000 \
-e BICHON_ROOT_DIR=/data \
-e BICHON_ENCRYPT_PASSWORD=your-secure-password-here \
rustmailer/bichon:latest
Open http://localhost:15630 in your browser.
[!IMPORTANT] Default login: username
admin, passwordadmin@bichon. Change this immediately via Settings → Profile.
Docker Compose
services:
bichon:
image: rustmailer/bichon:latest
container_name: bichon
ports:
- "15630:15630"
volumes:
- ./bichon-data:/data
user: "1000:1000"
environment:
BICHON_ROOT_DIR: /data
BICHON_ENCRYPT_PASSWORD: your-secure-password-here
BICHON_LOG_LEVEL: info
Binary Installation
Download from the Releases page:
| Platform | Archive |
|---|---|
| Linux (GNU) | bichon-x.x.x-x86_64-unknown-linux-gnu.tar.gz |
| Linux (MUSL) | bichon-x.x.x-x86_64-unknown-linux-musl.tar.gz |
| macOS | bichon-x.x.x-x86_64-apple-darwin.tar.gz |
| Windows | bichon-x.x.x-x86_64-pc-windows-msvc.zip |
# Linux / macOS
./bichon --bichon-root-dir /path/to/data --bichon-encrypt-password your-password
# Windows
.\bichon.exe --bichon-root-dir E:\bichon-data --bichon-encrypt-password your-password
--bichon-root-dir must be an absolute path. All Bichon data lives under this directory.
Build from Source
Prerequisites: Rust (latest stable), Node.js 20+, pnpm
git clone https://github.com/rustmailer/bichon.git
cd bichon
## Bu