No description
  • Go 65.5%
  • TypeScript 14.2%
  • CSS 9.5%
  • Go Template 9.5%
  • HTML 1.3%
Find a file
Jonas Leder 02884ed30d Run migrations in Helm post-install/upgrade hook Job (mysql/postgres)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 11:46:58 +01:00
backend Run migrations in Helm post-install/upgrade hook Job (mysql/postgres) 2026-11-16 11:46:58 +01:00
container Split frontend/backend images (scratch backend), Helm chart, multi-DB config, spamd sidecar 2026-11-16 11:31:37 +01:00
docs Split frontend/backend images (scratch backend), Helm chart, multi-DB config, spamd sidecar 2026-11-16 11:31:37 +01:00
frontend Add favicon, page title and dynamic title with score 2026-11-16 11:35:58 +01:00
helm Run migrations in Helm post-install/upgrade hook Job (mysql/postgres) 2026-11-16 11:46:58 +01:00
.dockerignore Split frontend/backend images (scratch backend), Helm chart, multi-DB config, spamd sidecar 2026-11-16 11:31:37 +01:00
.env.example Split frontend/backend images (scratch backend), Helm chart, multi-DB config, spamd sidecar 2026-11-16 11:31:37 +01:00
.gitignore Add Go backend: JMAP poller, mail checks, scoring API, swagger docs 2026-11-16 11:18:49 +01:00
.gitlab-ci.yml Add GitLab CI pipeline: tests, image builds, Helm OCI push 2026-11-16 11:33:21 +01:00
compose.yaml Split frontend/backend images (scratch backend), Helm chart, multi-DB config, spamd sidecar 2026-11-16 11:31:37 +01:00
Dockerfile.backend Split frontend/backend images (scratch backend), Helm chart, multi-DB config, spamd sidecar 2026-11-16 11:31:37 +01:00
Dockerfile.frontend Split frontend/backend images (scratch backend), Helm chart, multi-DB config, spamd sidecar 2026-11-16 11:31:37 +01:00
Dockerfile.spamassassin Split frontend/backend images (scratch backend), Helm chart, multi-DB config, spamd sidecar 2026-11-16 11:31:37 +01:00
README.md Run migrations in Helm post-install/upgrade hook Job (mysql/postgres) 2026-11-16 11:46:58 +01:00
renovate.json Add GitLab CI pipeline: tests, image builds, Helm OCI push 2026-11-16 11:33:21 +01:00

Mail Tester

Open source alternative to mail-tester.com. Open the page, get a random address xxxxxxxxxx@your-domain, send a mail to it, get a score out of 10.

Checks: SpamAssassin, SPF, DKIM, DMARC, reverse DNS (FCrDNS), MX record, A/AAAA of MX hosts, 7 DNS blacklists, TLS in transit, message format (Message-ID, Date, MIME, text alternative). Weights live in backend/checks.go; skipped checks (e.g. no spamd) don't count.

SpamAssassin runs as a sidecar container next to the backend (the backend image is scratch).

Stack: Go (Gin, Gorm + gormigrate, swaggo, godotenv), React + Vite, Stalwart via JMAP.

Run

# edit the environment block in compose.yaml, then:
docker compose up --build   # frontend :8080, backend, spamassassin

Kubernetes: helm install mail-tester ./helm -f my-values.yaml (frontend and backend are separate deployments, SpamAssassin is a sidecar of the backend; backend scales with replicaCountBackend on mysql/postgres; sqlite is limited to 1).

Migrations run at backend startup; EXECUTE_MIGRATIONS=false disables that and mailtester migrate applies them once and exits (the Helm chart does this in a post-install/post-upgrade hook Job for mysql/postgres).

Database: DB_DRIVER=sqlite|mysql|postgres with DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME (DB_SSLMODE for postgres; for sqlite DB_NAME is the file path). See .env.example.

Then set up Stalwart: docs/stalwart.md.

Dev: cd backend && go run . (reads .env) and cd frontend && npm i && npm run dev (proxies /api to :8080).

API

curl -X POST https://host/api/v1/tests          # -> {"id","address",...}
curl https://host/api/v1/tests/<id>             # status waiting|done|expired, score, checks[]

OpenAPI / Swagger UI at /api/docs/index.html. Regenerate with cd backend && swag init -g main.go -o docs.

Security

Strict CSP, HSTS, COOP/COEP/CORP, X-Frame-Options, Permissions-Policy etc. on every response (Swagger UI path gets a relaxed script/style CSP). Create endpoint is rate limited per IP; set TRUSTED_PROXIES behind a reverse proxy.