Administration for BTN mail server.
  • Rust 70.5%
  • HTML 27.4%
  • Dockerfile 1.4%
  • JavaScript 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Blake Rain 0e5854a0d8
All checks were successful
Check / check (push) Successful in 52s
Release / build (push) Successful in 1m37s
feat: add release workflow
2026-08-07 11:24:21 +01:00
.cargo chore: initial commit 2026-08-06 17:37:19 +01:00
.forgejo/workflows feat: add release workflow 2026-08-07 11:24:21 +01:00
src chore: initial commit 2026-08-06 17:37:19 +01:00
static chore: initial commit 2026-08-06 17:37:19 +01:00
templates chore: initial commit 2026-08-06 17:37:19 +01:00
.dockerignore chore: initial commit 2026-08-06 17:37:19 +01:00
.gitignore chore: initial commit 2026-08-06 17:37:19 +01:00
bacon.toml chore: initial commit 2026-08-06 17:37:19 +01:00
Cargo.toml chore: initial commit 2026-08-06 17:37:19 +01:00
Dockerfile chore: initial commit 2026-08-06 17:37:19 +01:00
README.md chore: initial commit 2026-08-06 17:37:19 +01:00

mailadmin

Web-based admin panel for the mail server from Black Tree Networks. Manages domains, mailboxes, and aliases stored in a PostgreSQL database, authenticating users via their existing mailbox credentials.

Build

This is built in Rust using the Poem web framework, sqlx for database access, and minijinja for templating. The front-end uses HTMX for partial page swaps and Pico.css for styling.

You can build the binary with:

cargo build --release

The included Dockerfile builds a static musl binary in an alpine:3.24 image.

docker build -t mailadmin .

Run

mailadmin \
  --database-url "postgres://mail@host:5432/mail" \
  --bind-addr "0.0.0.0:3000" \
  --cookie-secret "<base64>" \
  --template-dir "./templates"

All flags can be set via environment variables: DATABASE_URL, BIND_ADDR, COOKIE_SECRET, STATIC_DIR, TEMPLATE_DIR.

The cookie secret is a base64-encoded random key; generate one with:

openssl rand -base64 32