- Go 65.5%
- TypeScript 14.2%
- CSS 9.5%
- Go Template 9.5%
- HTML 1.3%
|
Some checks failed
ci / frontend-build (push) Failing after 37s
ci / backend-test (push) Successful in 1m4s
ci / build-1 (push) Failing after 1m5s
ci / frontend-docker (push) Failing after 0s
ci / build-2 (push) Successful in 2m38s
ci / spamassassin-docker (push) Successful in 0s
ci / build (push) Successful in 2m58s
ci / backend-docker (push) Successful in 0s
ci / build-3 (push) Has been skipped
ci / chart (push) Failing after 0s
|
||
|---|---|---|
| .forgejo/workflows | ||
| backend | ||
| container | ||
| docs | ||
| frontend | ||
| helm | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| compose.yaml | ||
| Dockerfile.backend | ||
| Dockerfile.frontend | ||
| Dockerfile.spamassassin | ||
| README.md | ||
| renovate.json | ||
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.