Why archive your email outside the mailbox
A mail server is built to send and receive, not to keep. Shared hosting caps mailbox size, users delete to make room, and a closed account takes all its content with it. The day you need a quote accepted three years ago, or a supplier's reply in a dispute, the original mailbox is often gone.
Archiving means copying every message as it arrives to storage independent of the mailbox, then making it searchable. Bichon does exactly that: it reads your mailboxes over IMAP, keeps a copy of every message even when the original is deleted, and indexes senders, subjects, bodies and attachment names.
What Bichon brings
- Continuous IMAP archiving — multiple accounts, password or OAuth2 login (Gmail, Microsoft 365), incremental sync and per-account schedules.
- Full-text search — sender, recipients, subject, body and attachment names, with filters by account, folder and period.
- Import what you already have — EML files, MBOX (including the Gmail export), Thunderbird profiles and Outlook PST files.
- Export and restore — MBOX export, restoring messages to the original IMAP server.
- Users and roles — multiple users, roles per archived account, TOTP two-factor authentication and API tokens.
- Self-contained — one Rust binary with its built-in index: no database or Elasticsearch to install alongside.
Three ways to keep old email
Scroll the table
| Bichon | Leave it in the mailbox | PST or MBOX exports | |
|---|---|---|---|
| Survives mailbox deletion | Yes | No | Yes, up to the last export |
| Updates | Continuous, automatic | — | Manual, one-off |
| Search | Full text, across all mailboxes | Mailbox by mailbox | File by file, in a mail client |
| Provider quota | Freed | Reached sooner or later | Freed |
| Access for several people | Users and roles | Shared credentials | Copying files |
Prerequisites
An Ubuntu 24.04 VPS with 1 GB of RAM is enough to start; it is the disk you need to size: count the current size of the mailboxes to archive, plus the index and a year of growth. You need Docker with the Compose plugin, nginx with an HTTPS certificate, and a name — for example mail-archive.example.com — since the interface and administrator login will go over the Internet.
Install Bichon with Docker Compose
Prepare the directory and the encryption key
BICHON_ENCRYPT_PASSWORDencrypts the IMAP passwords and OAuth2 tokens Bichon stores. Generate it once and keep it: without it, accounts already configured can no longer reconnect.mkdir -p /opt/bichon && cd /opt/bichon echo "ENCRYPT_PASSWORD=$(openssl rand -hex 24)" > .env chmod 600 .envWrite the docker-compose.yml
The port is only published on the loopback interface: only nginx can reach it.
BICHON_TRUSTED_PROXIESaccepts theX-Forwarded-Forheader from the Docker network, so that logs and login rate limiting see the visitors' real address.services: bichon: image: rustmailer/bichon:2.4.6 restart: unless-stopped ports: - "127.0.0.1:15630:15630" environment: BICHON_ROOT_DIR: /data BICHON_ENCRYPT_PASSWORD: ${ENCRYPT_PASSWORD} BICHON_PUBLIC_URL: https://mail-archive.example.com BICHON_TRUSTED_PROXIES: 172.16.0.0/12 volumes: - bichon-data:/data volumes: bichon-data: {}Start and check
The image ships its own health check: wait for the
healthystate, then query the status route, which returns the version and uptime.docker compose up -d docker compose ps curl -s http://127.0.0.1:15630/api/status
Change the factory password before opening the address
On first start, Bichon creates the admin user with the password admin@bichon. That password opens no session: it forces you to choose a new one. But whoever uses it first chooses the administrator password — if the address is public before you have done it, someone else can do it for you. Log in and change it before publishing the vhost, for example through an SSH tunnel (ssh -L 15630:127.0.0.1:15630 root@your-vps), then enable two-factor authentication.
Publish Bichon over HTTPS behind nginx
Bichon does not handle TLS itself: nginx does and forwards requests to it. The maximum upload size is raised for PST or MBOX imports through the interface, and the read timeout extended for long operations.
server {
listen 443 ssl;
server_name mail-archive.example.com;
# ssl_certificate + ssl_certificate_key (Let's Encrypt)
client_max_body_size 2g;
location / {
proxy_pass http://127.0.0.1:15630;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600s;
}
}Reload nginx (nginx -t && systemctl reload nginx), then open https://mail-archive.example.com. BICHON_PUBLIC_URL must carry the same address: it is the one Bichon gives Google and Microsoft as the redirect address for OAuth2 sign-ins.
Archive a first IMAP mailbox
In Accounts, add a mailbox: IMAP server, port 993 with TLS, username and password. For an address hosted on cPanel, these are the full email address and its password, with the server mail.your-domain.com. Gmail and Microsoft 365 preferably connect through OAuth2, after registering the application with Google or Microsoft.
Then choose the folders to archive — at least the inbox and sent items — and the sync frequency. The first pass copies the whole history, which can take hours on a mailbox of several gigabytes; the next ones only fetch new messages. Search works as soon as the first messages have arrived.
Import your old PST, MBOX or EML exports
Mailboxes that no longer exist often left an export behind: an Outlook PST file, an MBOX from Google Takeout, a Thunderbird profile folder or EML files. Bichon imports them from the interface and stores them in the same archive as the synced mailboxes: a single search then covers old and new. For very large files, the bichon-cli command-line tool avoids going through the browser.
The other way round, Bichon exports to MBOX and can restore messages to the original IMAP server: useful after an accidental deletion, or to push history back into a new mailbox after a provider switch.
Backup and security
The whole archive lives in the /data volume: messages, search index and configuration. Back it up regularly, with the container stopped to get a consistent copy.
cd /opt/bichon
docker compose stop bichon
docker run --rm -v bichon_bichon-data:/data -v /root/backups:/backup ubuntu \
tar czf /backup/bichon-$(date +%F).tar.gz -C /data .
docker compose start bichonThe BICHON_ENCRYPT_PASSWORD key only protects stored credentials, not messages: the archive itself is not encrypted by Bichon. Its protection therefore relies on access to the VPS, two-factor authentication on the application's accounts and backups that are themselves encrypted. Give each employee their own account, with a role limited to the mailboxes that concern them.
Bichon in one click on ServOrbit
On a ServOrbit VPS, the Marketplace does all of the above for you: official container, port on the loopback interface, encryption key generated, factory password replaced at install time with a random password shown in your client area, nginx reverse proxy over HTTPS. You choose the address — a subdomain of one of your domains, or the VPS's free subdomain — and all that is left is adding your mailboxes. For scanned documents and attachments to file, pair it with Paperless-ngx.
servorbit.com/ma-en/blog/self-host-bichon-vps-email-archiving


