SYNTH MAIL

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

VariableWhatDefault
MAIL_DOMAINSyour mail domains, comma-separated; the first one is the main onelocalhost
MAIL_HOSTNAMEthe server name in SMTP and the HTTPS certificatelocalhost
DB_PASSWORDPostgreSQL passwordrequired
JWT_SECRETkey of login sessions, at least 32 bytesrequired
DB_HOST, DB_PORT, DB_NAME, DB_USERdatabaselocalhost, 5432, mailserver, mail
MAIL_ADMIN_LOGIN, MAIL_ADMIN_EMAIL, MAIL_ADMIN_PASSWORDthe first user on an empty database; no password — a random one (in the log and MAIL_PASSWORDS_FILE)admin, admin@<first domain>
MAIL_ADMINSbuilt-in administrators (logins), comma-separatedthe first user
MAIL_PASSWORDS_FILEfile (mode 600) where random passwords of created mailboxes are written/app/data/initial-passwords.txt
MAIL_DEFAULT_LANGUAGEinterface language until a person picks one, e.g. en; empty — the browser's—
MAIL_I18N_DIRextra interface languages, <code>.json (Operations)/app/data/i18n

Users and registration

VariableWhatDefault
MAIL_REGISTRATIONanyone may sign upfalse
MAIL_REGISTRATION_MAX_PER_IPsign-ups from one IP address per window, 0 — no limit5
MAIL_REGISTRATION_WINDOWthat window24h
MAIL_PERSONAL_LIMITpersonal mailboxes a user may create, until set in Admin panel → LIMITS5
MAIL_CATCH_ALLa mail trap: mail to addresses without a mailbox (and to other domains) goes here, nothing leaves — for test servers—

TLS

VariableWhatDefault
MAIL_TLSTLS for SMTP: STARTTLS and SMTPS_PORTtrue
MAIL_TLS_CERT, MAIL_TLS_KEYyour certificate: PEM chain and key; re-read when the files change; without them — self-signed—
MAIL_TLS_DIRwhere the self-signed certificate lives/app/data/tls
HTTPS_PORTweb client and API over HTTPS with the same certificate; 0 — plain HTTP only0

SMTP and IMAP

VariableWhatDefault
SMTP_PORTSMTP port inside the container3025
SMTPS_PORTimplicit TLS port (465 outside); 0 — off0
IMAP_ENABLED, IMAP_PORT, IMAPS_PORTIMAP on; STARTTLS port; implicit TLS port (0 — off)true, 3143, 0
SMTP_AUTH_WITHOUT_TLS, IMAP_AUTH_WITHOUT_TLSallow passwords without encryption — only in a closed networkfalse

Outgoing mail

VariableWhatDefault
OUTBOUND_MODEoff — nothing leaves; mx — straight to recipients' servers (port 25); smarthost — through another serveroff
OUTBOUND_HOST, OUTBOUND_PORT, OUTBOUND_USERNAME, OUTBOUND_PASSWORD, OUTBOUND_TLSthe smarthost; TLS starttls, ssl or none—, 587, —, —, starttls
OUTBOUND_MAX_PER_HOUR, OUTBOUND_MAX_PER_HOUR_SYSTEMmail out per mailbox per hour: normal and system mailboxes200, 2000
DKIM_DOMAIN, DKIM_SELECTOR, DKIM_KEYS_DIRDKIM: domain or comma-separated list (the compose files set it to MAIL_DOMAINS), selector, key folderlocalhost, mail, ./dkim-keys

Incoming checks

VariableWhatDefault
SPF_ENABLED, DMARC_ENABLEDcheck SPF and DMARC of incoming mailtrue
SPAM_DNSBLspam block lists, comma-separated; a listed sender goes to Spambl.spamcop.net,psbl.surriel.com
MAIL_MTA_STS_MODE, MAIL_MTA_STS_MX, MAIL_MTA_STS_MAX_AGEMTA-STS policy: testing / enforce / none / off; MX names (empty — MAIL_HOSTNAME); max_age secondstesting, —, 86400

Protection and metrics

VariableWhatDefault
LOGIN_GUARDpassword guessing protection (Security)true
LOGIN_GUARD_MAX_PER_IP, LOGIN_GUARD_MAX_PER_ACCOUNTwrong passwords per window before a block: from one IP; for one mailbox from any IP10, 20
LOGIN_GUARD_WINDOW, LOGIN_GUARD_BLOCK, LOGIN_GUARD_MAX_BLOCKcounting window; first block; longest block (each next block of the same IP is twice as long)15m, 15m, 24h
LOGIN_GUARD_TRUSTED_IPSIP addresses never blocked by IP, comma-separated—
METRICS_TOKENtoken for /actuator/prometheus and /actuator/metrics; empty — metrics closed—