2025-11-19 03:32:52 +08:00
<div align="center">
2025-11-19 03:54:25 +08:00
<h1 align="center">
<img width="200" height="175" alt="image" src="https://github.com/user-attachments/assets/06dc3b67-7d55-4a93-a3de-8b90951c575b" />
<br>
Bichon
<br>
</h1>
2025-11-19 03:32:52 +08:00
2025-11-19 03:54:25 +08:00
<h3 align="center">
A lightweight, high-performance Rust email archiver with WebUI
</h3>
2025-11-19 03:32:52 +08:00
<p style="display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;">
<a href="https://github.com/rustmailer/bichon/releases">
<img src="https://img.shields.io/github/v/release/rustmailer/bichon" alt="Release">
</a>
<a href="https://hub.docker.com/r/rustmailer/bichon">
<img src="https://img.shields.io/docker/v/rustmailer/bichon?label=docker" alt="Docker">
</a>
<a href="LICENSE">
<img src="https://img.shields.io/badge/license-AGPLv3-blue.svg" alt="License">
</a>
2025-11-19 03:57:00 +08:00
<a href="https://deepwiki.com/rustmailer/bichon"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
2025-11-19 09:26:35 +08:00
<a href="https://discord.gg/evFnSpdpaE">
2025-11-20 11:23:08 +08:00
<img src="https://img.shields.io/badge/Discord-Join%20Server-7289DA?logo=discord&logoColor=white" alt="Discord">
</a>
<a href="https://x.com/rustmailer">
<img src="https://img.shields.io/twitter/follow/rustmailer?style=social" alt="Follow on X">
2025-11-19 09:26:35 +08:00
</a>
2025-11-19 03:32:52 +08:00
</p>
</div>
2025-11-19 03:54:25 +08:00
Bichon is a minimal, high-performance, standalone Rust email archiver with a built-in WebUI.
Its name is inspired by the puppy my daughter adopted last month.
It runs as a single binary, requires no external dependencies, and provides fast, efficient email archiving, management, and search.
2025-11-19 03:32:52 +08:00
## 🚀 Features
### ⚡ Lightweight & Standalone
- Pure Rust, single-machine application.
- No external database required.
- Includes **WebUI** for intuitive management.
### 📬 Multi-Account Management
- Synchronize and download emails from multiple accounts.
- Flexible selection: by **date range** , **number of emails** , or **specific mailboxes** .
### 🔑 IMAP & OAuth2 Authentication
- 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.
### 🔍 Unified Multi-Account Search
- Powerful search across all accounts:
**account** , **mailbox** , **sender** , **attachment name** , **has attachments** , **size** , **date** , **subject** , **body** .
### 🏷️ Tags & Facets
- Organize archived emails using **tags** backed by Tantivy **facets** .
- Efficiently filter and locate emails based on these facet-based tags.
### 💾 Compressed & Deduplicated Storage
- Store emails efficiently with **transparent compression** and **deduplication** —emails can be read directly without any extra steps.
### 📂 Email Management & Viewing
- Bulk cleanup of local archives.
- Download emails as **EML** or **attachments separately** .
- View and browse emails directly.
2025-11-19 04:27:11 +08:00
- View the full **conversation thread** of any email.
2025-11-19 03:32:52 +08:00
### 📊 Dashboard & Analytics
- Visualize email statistics: **counts** , **time distribution** , **top senders** , **largest emails** , **account rankings** .
2025-11-25 00:08:50 +08:00
### 🌐 Internationalization (i18n)
2025-11-25 00:11:10 +08:00
* 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.
2025-11-25 00:08:50 +08:00
2025-11-19 03:32:52 +08:00
### 🛠️ OpenAPI Support
- Provides **OpenAPI documentation** .
- **Access token authentication** for programmatic access.
2025-11-19 03:54:25 +08:00
## 🐾 Why Create Bichon?
2025-11-19 03:32:52 +08:00
2025-11-19 03:54:25 +08:00
A few months ago, I released **rustmailer** , an email API middleware:
https://github.com/rustmailer/rustmailer
2025-11-19 03:32:52 +08:00
2025-11-19 03:54:25 +08:00
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.
2025-11-19 03:32:52 +08:00
2025-11-19 03:54:25 +08:00
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.
2025-11-19 04:27:11 +08:00
## 📸 Snapshot
<img width="1914" height="904" alt="image" src="https://github.com/user-attachments/assets/3a456999-e4eb-441e-9052-3a727dea66a0" />
<img width="1900" height="907" alt="image" src="https://github.com/user-attachments/assets/95db0a05-4b55-4e18-b418-9d40361d6fea" />
<img width="1912" height="904" alt="image" src="https://github.com/user-attachments/assets/96b0ebc2-4778-452b-891f-dc9acf8e381f" />
<img width="1909" height="904" alt="image" src="https://github.com/user-attachments/assets/ab4bf6ae-faa6-4b49-ae39-705eb9d4487f" />
<img width="1910" height="910" alt="image" src="https://github.com/user-attachments/assets/bcf9cca2-d690-4e7b-b2c9-c52a31c7b999" />
<img width="1915" height="903" alt="image" src="https://github.com/user-attachments/assets/242817d7-3e12-4cbb-afb0-c5ef7366178d" />
<img width="1920" height="910" alt="image" src="https://github.com/user-attachments/assets/14561b74-ed53-4017-9c5b-a64920ec3526" />
<img width="1913" height="909" alt="image" src="https://github.com/user-attachments/assets/6fd54cb0-c86f-4ceb-a955-c81107614fc4" />
2025-11-19 03:32:52 +08:00
## 🚀 Quick Start
### Docker Deployment (Recommended)
```bash
# 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 \
2025-11-19 14:13:37 +13:00
-e BICHON_LOG_LEVEL = info \
-e BICHON_ROOT_DIR = /data \
2025-11-19 03:32:52 +08:00
rustmailer/bichon:latest
```
2025-11-19 10:16:39 +08:00
2025-11-23 01:30:56 +08:00
* **Accessing Bichon from a browser:**
You need to add the exact address you use in your browser to `BICHON_CORS_ORIGINS` .
* If you access via **IP** , add `IP:port` , e.g.:
```
http://192.168.1.16:15630
` ``
* If you access via **hostname**, add ` hostname:port`, e.g.:
` ``
http://myserver.local:15630
` ``
* If you access via **domain name**, add the domain, e.g.:
` ``
http://mydomain.com
` ``
* **If Bichon is running on port 80**, you **do not need to include the port**.
* If you want to access Bichon in **multiple ways**, include all of them separated by commas.
Example Docker run:
2025-11-19 10:16:39 +08:00
` ``bash
docker run -d \
--name bichon \
-p 15630:15630 \
-v $(pwd)/bichon-data:/data \
-e BICHON_LOG_LEVEL=info \
-e BICHON_ROOT_DIR=/data \
2025-11-23 01:30:56 +08:00
-e BICHON_CORS_ORIGINS="http://192.168.1.16:15630,http://myserver.local:15630,http://mydomain.com" \
2025-11-19 10:16:39 +08:00
rustmailer/bichon:latest
` ``
2025-11-23 01:30:56 +08:00
> **Tip:** Do not add a trailing ` /`. Using ` *` allows all addresses, but is **not recommended** for security.
2025-11-19 03:32:52 +08:00
### Binary Deployment
Download the appropriate binary for your platform from the [Releases](https://github.com/rustmailer/bichon/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:
` ``bash
# Linux/macOS
./bichon --bichon-root-dir /tmp/bichon-data
# Windows
.\bichon.exe --bichon-root-dir e:\bichon-data
` ``
2025-11-22 09:49:44 +01:00
* --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.
2025-11-23 00:43:41 +08:00
## Setting the Bichon Encryption Password
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**.
### How to Set the Password
You can set the password **via command-line or environment variable**:
### Command-Line
` ``bash
bichon --bichon-encrypt-password "your-strong-password"
` ``
### Environment Variable
` ``bash
export BICHON_ENCRYPT_PASSWORD="your-strong-password"
bichon
` ``
**Tip:** Use a strong, secure password and keep it safe, as it cannot be changed later.
2025-11-22 09:49:44 +01:00
2025-11-21 11:03:01 +08:00
## 🔑 Root User Login Information
**Bichon currently supports a single Root user login for system access and management.**
### First Login and Enabling Access
To enable the login feature, you must specify a command-line argument or set an environment variable when starting Bichon.
#### 1\. Command-Line Argument
Add the ` --bichon-enable-access-token` flag to your startup command:
` ``bash
# Linux/macOS Binary Deployment Example
./bichon --bichon-root-dir /tmp/bichon-data --bichon-enable-access-token
` ``
#### 2\. Environment Variable (Recommended for Docker)
Set the environment variable ` BICHON_ENABLE_ACCESS_TOKEN` to ` true`:
` ``bash
# 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
` ``
### Default Credentials
* **Initial Login Account:** ` root`
* **Initial Password:** ` root`
### Changing the Password
**It is strongly recommended that you change the default password immediately after your first login.**
You can change the password via the WebUI:
1. Log in to the WebUI.
2. Navigate to the **Settings** page.
3. Use the **Reset Root Password** option to modify your password.
2025-11-19 03:32:52 +08:00
## 📖 Documentation
> Under construction. Documentation will be available soon.
2025-11-23 00:43:41 +08:00
[Bichon Wiki](https://github.com/rustmailer/bichon/wiki).
2025-11-19 03:32:52 +08:00
## 🛠️ Tech Stack
- **Backend**: Rust + Poem
2025-11-21 20:46:46 +08:00
- **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)
2025-11-19 03:32:52 +08:00
## 🤝 Contributing
Issues and Pull Requests are welcome!
2025-11-19 04:02:20 +08:00
## 🧑💻 Developer Guide
To build or contribute to Bichon, the following environment is recommended:
### Prerequisites
- **Rust**: Use the latest stable toolchain for best compatibility and performance.
- **Node.js**: Version **20+** is required.
- **pnpm**: Recommended package manager for the WebUI.
### Steps
#### 1. Clone the repository
` ``bash
git clone https://github.com/rustmailer/bichon.git
cd bichon
` ```
#### 2. Build the WebUI
` ``bash
cd web
pnpm install
pnpm run build
` ``
Run the WebUI in development mode if needed:
` ``bash
pnpm run dev
` ``
#### 3. Build or Run the Backend
After the WebUI is built, return to the project root:
` ``bash
cd ..
cargo build
` ``
Or run directly:
` ``bash
cargo run -- --bichon-root-dir e:\bichon-data
` ``
` --bichon-root-dir` specifies the directory where **all Bichon data** will be stored.
### WebUI Access
* The WebUI runs on ** [http://localhost:15630 ](http://localhost:15630 )** by default.
* **HTTPS is not enabled** in development or default builds.
2025-11-19 03:32:52 +08:00
<cite/>
## 📄 License
This project is licensed under [AGPLv3 ](LICENSE ).
## 🔗 Links
- [Docker Hub ](https://hub.docker.com/r/rustmailer/bichon )
- [Issue Tracker ](https://github.com/rustmailer/bichon/issues )
2025-11-19 09:26:35 +08:00
- [Discord ](https://discord.gg/evFnSpdpaE )
2025-11-19 03:32:52 +08:00