SMTP presets
z4j sends email for invitations and password reset. Configure via env vars.
Shared env vars
Section titled “Shared env vars”| Var | Meaning |
|---|---|
Z4J_SMTP_HOST | hostname |
Z4J_SMTP_PORT | usually 587 (STARTTLS) or 465 (SMTPS) |
Z4J_SMTP_USER | username |
Z4J_SMTP_PASSWORD | password |
Z4J_SMTP_FROM | From: header (e.g., z4j <noreply@yourdomain>) |
Z4J_SMTP_TLS | starttls (default) / ssl / none |
Z4J_SMTP_TIMEOUT | seconds (default 10) |
Gmail requires an app password (not your account password). Enable 2FA, create an app password, and:
Z4J_SMTP_HOST=smtp.gmail.comZ4J_SMTP_PORT=587Z4J_SMTP_USER=you@gmail.comZ4J_SMTP_PASSWORD=xxxx-xxxx-xxxx-xxxxZ4J_SMTP_FROM=z4j <you@gmail.com>Gmail OAuth2 integration is on the v1.1 roadmap (SMTP app-password only in v1.0).
Mailgun
Section titled “Mailgun”Z4J_SMTP_HOST=smtp.mailgun.orgZ4J_SMTP_PORT=587Z4J_SMTP_USER=postmaster@mg.yourdomainZ4J_SMTP_PASSWORD=<mailgun smtp password>Z4J_SMTP_FROM=z4j <noreply@yourdomain>Brevo (formerly Sendinblue)
Section titled “Brevo (formerly Sendinblue)”Z4J_SMTP_HOST=smtp-relay.brevo.comZ4J_SMTP_PORT=587Z4J_SMTP_USER=<your brevo smtp login>Z4J_SMTP_PASSWORD=<your smtp key>Z4J_SMTP_FROM=z4j <noreply@yourdomain>AWS SES
Section titled “AWS SES”Z4J_SMTP_HOST=email-smtp.us-east-1.amazonaws.comZ4J_SMTP_PORT=587Z4J_SMTP_USER=<SES SMTP username>Z4J_SMTP_PASSWORD=<SES SMTP password>Z4J_SMTP_FROM=z4j <noreply@verified-domain>SES requires a verified sender domain.
Sending a test email
Section titled “Sending a test email”z4j-brain smtp-test --to you@example.comIf the test fails, check brain logs for the SMTP error.
No-SMTP fallback
Section titled “No-SMTP fallback”Without SMTP, invite and reset features show the URL in the UI / CLI instead of sending email. Everything still works; just less automated.