feat(mail-admin): read-only account view for mail.produktor.io (#74)

- admin/: Go stdlib-only HTTP viewer, lists accounts from
  config/postfix-accounts.cf with per-mailbox message counts (INBOX and
  total, same numbers doveadm reports) and storage; quota from
  dovecot-quotas.cf; Basic Auth from .env; offline tests vs fixtures
  (go test -race ./...)
- compose: mail-admin service, build admin/Dockerfile, publishes
  127.0.0.1:19945 / 172.17.0.1:19945; config and mail-data mounted :ro,
  no docker socket
- NPM proxy host 66: location /admin/ -> 172.17.0.1:19945
- README: account admin section
This commit is contained in:
2026-09-01 15:07:55 +01:00
parent e00c6950ed
commit 5a46ba4b33
22 changed files with 790 additions and 0 deletions
+29
View File
@@ -59,3 +59,32 @@ services:
- ROUNDCUBEMAIL_USERNAME_DOMAIN=produktor.io
- ROUNDCUBEMAIL_SKIN=elastic
- ROUNDCUBEMAIL_DES_KEY=${ROUNDCUBEMAIL_DES_KEY:?set ROUNDCUBEMAIL_DES_KEY in .env}
# Account admin (read-only view) — https://mail.produktor.io/admin/ (NPM proxy
# host 66, location /admin/ -> 172.17.0.1:19945).
# Lists the accounts from config/postfix-accounts.cf with per-mailbox message
# counts (INBOX / total) and storage, computed the same way doveadm reports
# them: every file in a mailbox's cur/ or new/ directory is one message.
# Read-only: config and mail data are mounted with :ro, no docker socket.
mail-admin:
build:
context: ./admin
image: mail-admin:local
container_name: mail-admin
restart: unless-stopped
depends_on:
- mailserver
ports:
- "127.0.0.1:19945:8080"
- "172.17.0.1:19945:8080"
volumes:
- ./config/:/config/:ro
- ./data/mail-data/:/var/mail/:ro
environment:
- MAIL_ADMIN_LISTEN=:8080
- MAIL_ADMIN_BASE_PATH=/admin
- MAIL_ADMIN_ACCOUNTS=/config/postfix-accounts.cf
- MAIL_ADMIN_QUOTAS=/config/dovecot-quotas.cf
- MAIL_ADMIN_MAILDIR=/var/mail
- MAIL_ADMIN_USER=${MAIL_ADMIN_USER:?set MAIL_ADMIN_USER in .env}
- MAIL_ADMIN_PASSWORD=${MAIL_ADMIN_PASSWORD:?set MAIL_ADMIN_PASSWORD in .env}