Bichon is an open-source email archiving system that synchronizes emails from IMAP servers, indexes them for full-text search, and provides a REST API for programmatic access. Unlike email clients, Bichon is designed for archiving and searching rather than sending/receiving emails. It runs as a standalone server application that continuously synchronizes configured email accounts and maintains a searchable local archive. Built in Rust, it requires no external dependencies and provides fast, efficient email archiving, management, and search through a built-in WebUI. Its name is inspired by the puppy my daughter adopted last month.
| Feature | Email Clients | Bichon |
|---|---|---|
| Primary Purpose | Send/receive emails, real-time communication | Archive, search, manage historical emails |
| Sending Capability | ✅ Supports sending emails | ❌ No email sending support |
| Runtime Mode | Desktop/mobile applications | Server-side application |
| Data Storage | Local cache + server | Local archive store |
| Search Capability | Basic search | Full-text indexing, advanced search |
| API Interface | Typically not provided | Complete REST API |
| Multi-account Management | Limited | Supports unified search across accounts |
- Pure Rust, single-machine application.
- No external database required.
- Includes WebUI for intuitive management.
- Synchronize and download emails from multiple accounts.
- Flexible selection: by date range, number of emails, or specific mailboxes.
- Supports IMAP password or OAuth2 login.
- Built-in WebUI for OAuth2 authorization, including automatic token refresh (e.g., Gmail, Outlook).
- Supports network proxy for IMAP and OAuth2.
- Automatic IMAP server discovery and configuration.
- Powerful search across all accounts:
account, mailbox, sender, attachment name, has attachments, size, date, subject, body.
- Organize archived emails using tags backed by Tantivy facets.
- Efficiently filter and locate emails based on these facet-based tags.
- Store emails efficiently with transparent compression and deduplication—emails can be read directly without any extra steps.
- Bulk cleanup of local archives.
- Download emails as EML or attachments separately.
- View and browse emails directly.
- View the full conversation thread of any email.
- Visualize email statistics: counts, time distribution, top senders, largest emails, account rankings.
- WebUI fully supports 17 languages for all interface elements.
- Backend responses (e.g., system messages, API data) are not yet internationalized.
- Frontend is ready to support more languages in the future with minimal effort.
- Provides OpenAPI documentation.
- Access token authentication for programmatic access.
A few months ago, I released rustmailer, an email API middleware:
https://github.com/rustmailer/rustmailer
Since then, I’ve received many emails asking whether it could also archive emails, perform unified search, and support full-text indexing—not just querying recipients.
But rustmailer was designed as a middleware focused on providing API services.
Adding archiving and full-text search would complicate its core purpose and go far beyond its original scope.
Meanwhile, I realized that email archiving itself only requires a small portion of rustmailer’s functionality, plus a search engine.
With that combination, building a dedicated, efficient archiver becomes much simpler.
Using the experience gained from rustmailer, I designed and built Bichon in less than two weeks, followed by another two weeks of testing and optimization.
It has now reached a stable, usable state—and I decided to release it publicly.
Bichon is completely free.
You can download and use it however you like.
It’s not perfect, but I hope it brings you value.
# 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 \
-e BICHON_LOG_LEVEL=info \
-e BICHON_ROOT_DIR=/data \
rustmailer/bichon:latestStarting from v0.1.4, Bichon changes how BICHON_CORS_ORIGINS works:
- If
BICHON_CORS_ORIGINSis not set, Bichon now allows all origins. This makes local testing and simple deployments much easier. - If you do set
BICHON_CORS_ORIGINS, then you must explicitly list each allowed origin. *is not supported and will not work — you must provide exact URLs.
When a browser accesses Bichon, it will send an Origin header.
- Incoming Origin = the exact address the browser is using
- Configured origins = the list you passed to
BICHON_CORS_ORIGINS
If Configured origins does not contain the Incoming Origin exactly as a full string match, the browser request will be rejected.
Example debug log:
2025-12-06T23:56:30.422+08:00 DEBUG bichon::modules::rest: CORS: Incoming Origin = "http://localhost:15630"
2025-12-06T23:56:30.422+08:00 DEBUG bichon::modules::rest: CORS: Configured origins = ["http://192.168.3.2:15630"]
In this example:
- Browser is using
http://localhost:15630 - But the configured origin is
http://192.168.3.2:15630
→ CORS will fail, and you can immediately see why.
It is strongly recommended to configure CORS in production environments to ensure that only trusted browser origins can access Bichon. If you want to access Bichon from a browser:
- Add the exact IP with port
- Or the exact hostname with port
- Or the domain (port optional if it's 80)
Examples:
http://192.168.1.16:15630
http://myserver.local:15630
http://mydomain.com
If you access Bichon in multiple different ways, list all of them:
-e BICHON_CORS_ORIGINS="http://192.168.1.16:15630,http://myserver.local:15630,http://mydomain.com"
Do not add a trailing slash (
http://192.168.1.16:15630/will not match)Do not use
*, it is not supported.
Set environment variable:
BICHON_LOG_LEVEL=debug
Or via command-line:
--bichon-log-level debug
Default is info, so CORS logs will not appear unless debug logging is enabled.
⚠️ Note: If you are running Bichon in a container (via Docker Compose or docker run), be careful with quotes in environment variable values.
For example, do not write:
-e BICHON_CORS_ORIGINS="http://localhost:15630,http://myserver.local:15630"- The outer quotes (
") will be passed literally into the container and may cause CORS misconfiguration.
Correct way:
-e BICHON_CORS_ORIGINS=http://localhost:15630,http://myserver.local:15630Or using YAML literal style for Docker Compose:
environment:
BICHON_CORS_ORIGINS: |
http://localhost:15630,http://myserver.local:15630This ensures that the configured origins are interpreted correctly inside the container.
⚠️ Note: This fucking problem I actually didn’t know about myself; thanks to gall-1 for pointing it out.
Download the appropriate binary for your platform from the Releases page:
- 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
Extract and run:
# Linux/macOS
./bichon --bichon-root-dir /tmp/bichon-data
# Windows
.\bichon.exe --bichon-root-dir e:\bichon-data-
--bichon-root-dir argument is required and must be an absolute path.
-
If you are accessing Bichon from a proxy domain mydomain argument --bichon-cors-origins="https://mydomain" is required.
Bichon uses an encryption password to secure sensitive data. You must set it before first use, when no data exists.
Once set, it cannot be changed. Changing it later will make all encrypted data unreadable. To start over, you would need to reinitialize Bichon and clear all emails and metadata.
You can set the password via command-line or environment variable:
bichon --bichon-encrypt-password "your-strong-password"export BICHON_ENCRYPT_PASSWORD="your-strong-password"
bichonTip: Use a strong, secure password and keep it safe, as it cannot be changed later.
Bichon currently supports a single Root user login for system access and management.
To enable the login feature, you must specify a command-line argument or set an environment variable when starting Bichon.
Add the --bichon-enable-access-token flag to your startup command:
# Linux/macOS Binary Deployment Example
./bichon --bichon-root-dir /tmp/bichon-data --bichon-enable-access-tokenSet the environment variable BICHON_ENABLE_ACCESS_TOKEN to true:
# Docker Deployment Example
docker run -d \
--name bichon \
-p 15630:15630 \
-v $(pwd)/bichon-data:/data \
-e BICHON_LOG_LEVEL=info \
-e BICHON_ROOT_DIR=/data \
-e BICHON_ENABLE_ACCESS_TOKEN=true \
rustmailer/bichon:latest- Initial Login Account:
root - Initial Password:
root
It is strongly recommended that you change the default password immediately after your first login.
You can change the password via the WebUI:
- Log in to the WebUI.
- Navigate to the Settings page.
- Use the Reset Root Password option to modify your password.
Under construction. Documentation will be available soon. Bichon Wiki.
please see the FAQ in the project Wiki:
👉 https://github.com/rustmailer/bichon/wiki/FAQ
We have collected a real-world case study from a user processing email data, which demonstrates Bichon's performance and storage efficiency in a live environment. This case involves ingesting and indexing data from 126 email accounts. The total original data volume was 229 GB, comprising 460,000 emails.
A special thank you to @rallisf1 for sharing this usage scenario and the detailed data.
This data is provided solely as a reference for real-world usage. We encourage more users to share their Bichon usage screenshots and metrics (e.g., ingestion volume, compression ratio, search speed, etc.) to help the community conduct a more comprehensive assessment of Bichon's suitability and performance.
- Backend: Rust + Poem
- Frontend: React + TypeScript + Vite + ShadCN UI
- Core Engine (Storage & Search): Tantivy
- Acts as both the primary storage for email content and the full-text search index. This unified approach ensures high performance and eliminates data redundancy.
- Metadata Storage: Native_DB
- Used exclusively for lightweight configuration and account metadata.
- Email Protocols: IMAP (Supports standard Password & OAuth2)
Contributions of all kinds are welcome!
Whether you’d like to submit code, report a bug, or share practical suggestions that can help improve the project, your input is highly appreciated.
Feel free to open an Issue or a Pull Request anytime. You can also reach out on Discord if you’d like to discuss ideas or improvements.
To build or contribute to Bichon, the following environment is recommended:
- Rust: Use the latest stable toolchain for best compatibility and performance.
- Node.js: Version 20+ is required.
- pnpm: Recommended package manager for the WebUI.
git clone https://github.com/rustmailer/bichon.git
cd bichoncd web
pnpm install
pnpm run buildRun the WebUI in development mode if needed:
pnpm run devAfter the WebUI is built, return to the project root:
cd ..
cargo buildOr run directly:
cargo run -- --bichon-root-dir e:\bichon-data--bichon-root-dir specifies the directory where all Bichon data will be stored.
- The WebUI runs on http://localhost:15630 by default.
- HTTPS is not enabled in development or default builds.
This project is licensed under AGPLv3.
If this project has been helpful to you and you’d like to support its development, you can consider making a small donation or helping spread the word. Financial support is optional but deeply appreciated — it helps me dedicate more time and resources to building new features and improving the overall experience.
You can also support the project by sharing it with others, writing about your experience, or recommending it within relevant communities. Every bit of visibility helps more people benefit from the tool!