Skip to content

Configuration

Anton Popov edited this page Nov 10, 2026 · 1 revision

Configuration

Everything is configured in goodmail.conf (an INI-style file of key=value lines). The file is re-read automatically when it changes, so you do not have to restart goodmail after editing it.

Per-domain settings

Settings that end in a number belong to the domain with the same number.

domain1=example.com
imap1=mail.example.com            # host[:port], default 993 (TLS); 143 = STARTTLS
smtp1=mail.example.com:587        # default: imap host, 465 (TLS); 587 = STARTTLS

domain2=*                        # catch-all for any other domain
imap2=mail.example.net
ca2=/etc/goodmail/ca.pem         # optional extra CA bundle
ciphers2=HIGH:!DHE               # optional OpenSSL cipher list
login2=local                     # send "user" instead of "user@domain" as the IMAP/SMTP username
insecure2=true                   # accept self-signed certificates
title2=Example Mail              # app name these users see after signing in
title2.de=Beispiel-Mail          # the same name in German

signature2=Best regards\n{name}\nExample Ltd   # default signature (\n = new line; {name}, {email})
sieve2=mail.example.net          # ManageSieve host[:port] (default 4190) -> turns on "Mail rules"
passwordcmd2=ssh -i /etc/goodmail/pw-key pw@mail.example.net    # -> "Change password"
passwordmin2=12                  # shortest accepted new password (default 10)
admincmd2=ssh -i /etc/goodmail/admin-key adm@mail.example.net   # -> Administration
Key What it does
domainN the mail domain(s) this block is for; comma separated, or * for every other domain
imapN, smtpN the servers (host[:port])
caN, ciphersN, insecureN TLS tuning for servers with private CAs or old cipher lists
loginN=local log in with the part before the @
titleN, titleN.<lang> the app name shown after signing in, optionally per language
signatureN default signature for the domain; a user's own signature replaces it
sieveN ManageSieve server: turns on Mail Rules
passwordcmdN, passwordminN turns on password change, see Passwords
admincmdN turns on Administration

Global settings

resetfrom=goodmail@example.net   # "Forgot password": sender of the code mails ...
resetsmtp=mail.example.net:587   # ... and its SMTP server (resetuser= / resetpass= are its login)
smime=true                       # sign / encrypt / verify (needs openssl)
defaultdomain=example.com        # "bo" logs in as bo@example.com
autodiscover=false               # true: guess servers for unlisted domains (autoconfig / ISPDB / MX)
title=goodmail                   # sign-in page, and domains without their own titleN
title.da=Min mail                # per-language variants of the global title
spamthreshold=6                  # where the spam meter turns fully red (rspamd default 6)

S/MIME has more keys: smimeca=auto|off, smimecaname=, smimedays=, smimetrust=; see S-MIME.

Localised app name

title and titleN can be given per language with a .<code> suffix, using the codes of the language picker (da, de, en, es, fr, nb, sv). The sign-in page and the browser tab show the variant that matches the visitor's chosen (or browser) language and fall back to the plain title. A domain that has its own titleN uses only its own titleN.<code> lines; domains without one use the global title.<code> lines.

Environment variables

Variable Default
PORT / HOST 3000 / 0.0.0.0 listen address
GOODMAIL_CONFIG ./goodmail.conf config file
GOODMAIL_DATA ./data everything goodmail keeps, see Data and Backups
GOODMAIL_SECRET none use this instead of secret.key
GOODMAIL_SOURCE_URL this repository where the in-app "Source code" link points (AGPL §13: set it for modified versions)
GOODMAIL_CACHE_MB 150 memory for cached parsed messages
GOODMAIL_TRUST_PROXY false trust X-Forwarded-For (set it behind a proxy)
GOODMAIL_ORIGIN from the request pin the site's origin for passkeys (single host only)
GOODMAIL_OPENSSL openssl the openssl command used for S/MIME

Clone this wiki locally