Administration for BTN mail server.
- Rust 70.5%
- HTML 27.4%
- Dockerfile 1.4%
- JavaScript 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .cargo | ||
| .forgejo/workflows | ||
| src | ||
| static | ||
| templates | ||
| .dockerignore | ||
| .gitignore | ||
| bacon.toml | ||
| Cargo.toml | ||
| Dockerfile | ||
| README.md | ||
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