No description
  • Go 99.3%
  • HTML 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Runar Ingebrigtsen bc87ba93a6
All checks were successful
ci / test (push) Successful in 39s
release / build (push) Successful in 40s
accept dovecot scheme-prefixed password hashes
2026-10-08 02:08:24 +02:00
.forgejo/workflows milter on loopback tcp, dkim keys readable by opendkim 2026-10-07 23:50:25 +02:00
cmd/smtp-relay-managerd milter on loopback tcp, dkim keys readable by opendkim 2026-10-07 23:50:25 +02:00
configs accept dovecot scheme-prefixed password hashes 2026-10-08 02:08:24 +02:00
internal accept dovecot scheme-prefixed password hashes 2026-10-08 02:08:24 +02:00
web initial REST-based smtp relay manager 2026-09-14 09:44:53 +02:00
go.mod add copy_to, reply_to milter and hash import 2026-10-07 15:54:28 +02:00
go.sum add copy_to, reply_to milter and hash import 2026-10-07 15:54:28 +02:00
README.md initial REST-based smtp relay manager 2026-09-14 09:44:53 +02:00
SPEC.md accept dovecot scheme-prefixed password hashes 2026-10-08 02:08:24 +02:00

smtp-relay-manager

A Postfix/Dovecot-backed SMTP submission relay whose accounts, domains, and TLS policy are managed through a small REST API instead of hand-edited config files. See SPEC.md for the full design.

Layout

  • cmd/smtp-relay-managerd — the daemon (REST API only; Postfix/Dovecot/OpenDKIM run alongside it as separate system services).
  • internal/store — SQLite-backed accounts/domains/config.
  • internal/api — the bearer-key REST API (SPEC.md §3).
  • internal/dkim — per-domain RSA key pairs and OpenDKIM KeyTable/SigningTable.
  • internal/tlspolicy — allow-list validation for PUT /config/tls.
  • internal/tlsapply — runs the postconf/systemctl commands that apply it live.
  • web/index.html — the static informational front page (SPEC.md §5).
  • configs/ — Postfix/Dovecot/OpenDKIM/sudoers config fragments, documentation for deployers (SPEC.md §8), not applied automatically.

Build

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./cmd/smtp-relay-managerd

Test

CGO_ENABLED=0 go test ./...

Run

SMTP_RELAY_BEARER_KEY=... ./smtp-relay-managerd \
  -listen 127.0.0.1:8080 \
  -db /var/lib/smtp-relay-manager/relay.db \
  -dkim-key-dir /var/lib/smtp-relay-manager/dkim \
  -dkim-key-table /etc/opendkim/KeyTable \
  -dkim-signing-table /etc/opendkim/SigningTable