Configuration
Synth Mail is configured with environment variables, in .env next to docker-compose.yml or in the compose file.
Secrets can also be files: put them into MAILSERVER_SECRETS_DIR, the file name is the variable name (the install
compose file does this — DB_PASSWORD and JWT_SECRET are generated on the first start).
Basics
| Variable | What | Default |
|---|---|---|
MAIL_DOMAINS | your mail domains, comma-separated; the first one is the main one | localhost |
MAIL_HOSTNAME | the server name in SMTP and the HTTPS certificate | localhost |
DB_PASSWORD | PostgreSQL password | required |
JWT_SECRET | key of login sessions, at least 32 bytes | required |
DB_HOST, DB_PORT, DB_NAME, DB_USER | database | localhost, 5432, mailserver, mail |
MAIL_ADMIN_LOGIN, MAIL_ADMIN_EMAIL, MAIL_ADMIN_PASSWORD | the first user on an empty database; no password — a random one (in the log and MAIL_PASSWORDS_FILE) | admin, admin@<first domain> |
MAIL_ADMINS | built-in administrators (logins), comma-separated | the first user |
MAIL_PASSWORDS_FILE | file (mode 600) where random passwords of created mailboxes are written | /app/data/initial-passwords.txt |
MAIL_DEFAULT_LANGUAGE | interface language until a person picks one, e.g. en; empty — the browser's | — |
MAIL_I18N_DIR | extra interface languages, <code>.json (Operations) | /app/data/i18n |
Users and registration
| Variable | What | Default |
|---|---|---|
MAIL_REGISTRATION | anyone may sign up | false |
MAIL_REGISTRATION_MAX_PER_IP | sign-ups from one IP address per window, 0 — no limit | 5 |
MAIL_REGISTRATION_WINDOW | that window | 24h |
MAIL_PERSONAL_LIMIT | personal mailboxes a user may create, until set in Admin panel → LIMITS | 5 |
MAIL_CATCH_ALL | a mail trap: mail to addresses without a mailbox (and to other domains) goes here, nothing leaves — for test servers | — |
TLS
| Variable | What | Default |
|---|---|---|
MAIL_TLS | TLS for SMTP: STARTTLS and SMTPS_PORT | true |
MAIL_TLS_CERT, MAIL_TLS_KEY | your certificate: PEM chain and key; re-read when the files change; without them — self-signed | — |
MAIL_TLS_DIR | where the self-signed certificate lives | /app/data/tls |
HTTPS_PORT | web client and API over HTTPS with the same certificate; 0 — plain HTTP only | 0 |
SMTP and IMAP
| Variable | What | Default |
|---|---|---|
SMTP_PORT | SMTP port inside the container | 3025 |
SMTPS_PORT | implicit TLS port (465 outside); 0 — off | 0 |
IMAP_ENABLED, IMAP_PORT, IMAPS_PORT | IMAP on; STARTTLS port; implicit TLS port (0 — off) | true, 3143, 0 |
SMTP_AUTH_WITHOUT_TLS, IMAP_AUTH_WITHOUT_TLS | allow passwords without encryption — only in a closed network | false |
Outgoing mail
| Variable | What | Default |
|---|---|---|
OUTBOUND_MODE | off — nothing leaves; mx — straight to recipients' servers (port 25); smarthost — through another server | off |
OUTBOUND_HOST, OUTBOUND_PORT, OUTBOUND_USERNAME, OUTBOUND_PASSWORD, OUTBOUND_TLS | the smarthost; TLS starttls, ssl or none | —, 587, —, —, starttls |
OUTBOUND_MAX_PER_HOUR, OUTBOUND_MAX_PER_HOUR_SYSTEM | mail out per mailbox per hour: normal and system mailboxes | 200, 2000 |
DKIM_DOMAIN, DKIM_SELECTOR, DKIM_KEYS_DIR | DKIM: domain or comma-separated list (the compose files set it to MAIL_DOMAINS), selector, key folder | localhost, mail, ./dkim-keys |
Incoming checks
| Variable | What | Default |
|---|---|---|
SPF_ENABLED, DMARC_ENABLED | check SPF and DMARC of incoming mail | true |
SPAM_DNSBL | spam block lists, comma-separated; a listed sender goes to Spam | bl.spamcop.net,psbl.surriel.com |
MAIL_MTA_STS_MODE, MAIL_MTA_STS_MX, MAIL_MTA_STS_MAX_AGE | MTA-STS policy: testing / enforce / none / off; MX names (empty — MAIL_HOSTNAME); max_age seconds | testing, —, 86400 |
Protection and metrics
| Variable | What | Default |
|---|---|---|
LOGIN_GUARD | password guessing protection (Security) | true |
LOGIN_GUARD_MAX_PER_IP, LOGIN_GUARD_MAX_PER_ACCOUNT | wrong passwords per window before a block: from one IP; for one mailbox from any IP | 10, 20 |
LOGIN_GUARD_WINDOW, LOGIN_GUARD_BLOCK, LOGIN_GUARD_MAX_BLOCK | counting window; first block; longest block (each next block of the same IP is twice as long) | 15m, 15m, 24h |
LOGIN_GUARD_TRUSTED_IPS | IP addresses never blocked by IP, comma-separated | — |
METRICS_TOKEN | token for /actuator/prometheus and /actuator/metrics; empty — metrics closed | — |