BearerMail docs

Config reference

Every BearerMail-specific environment variable, port, and volume. For upstream plMail's own variables, see the upstream configuration reference.

Environment variables (mail server)

VariableDefaultWhat it does
MAIL_DOMAINexample.comYour mail domain. Used for the Postfix hostname, DKIM selector domain, and default aliases.
MAIL_HELO(empty → mail.$MAIL_DOMAIN)Hostname Postfix announces. Override if your PTR record uses a different name.
MAIL_ACCOUNTS(empty)localpart:password pairs, comma-separated. The mailbox list — this is user management.
MAIL_RELAYHOST(empty = direct)Outbound relay, e.g. [in-v3.mailjet.com]:587. Settable from Admin → Mail server instead.
MAIL_RELAY_USER(empty)Relay login (e.g. Mailjet API key).
MAIL_RELAY_PASS(empty)Relay secret (e.g. Mailjet secret key). Never paste into chat or tickets.
MAIL_CERTS_PATH(empty = self-signed)Host path containing fullchain.pem + privkey.pem for Dovecot's port 993.
CF_API_TOKEN(empty = DDNS off)Cloudflare API token (DNS:Edit) for the dynamic-DNS updater.
CF_ZONE(empty)DNS zone for the updater, e.g. yourdomain.com.
CF_RECORDmailHostname the updater keeps pointed at your IP.

Admin → Mail server relay settings override the MAIL_RELAY* env vars when both are set — actually it's the reverse: env vars win when both are set. To manage the relay purely from the UI, leave the env vars empty.

Ports

PortServiceExposed toNotes
25mta (Postfix)InternetInbound mail. Must be reachable for receiving.
587mta (Postfix)Compose network onlyDeliberately not published — plMail submits here internally.
143mailstore (Dovecot)Compose network onlyplMail reads mail here, like any IMAP account.
993mailstore (Dovecot)Internet (TLS)Direct IMAP for Thunderbird/phone apps. Self-signed cert unless MAIL_CERTS_PATH is set.

Volumes & files

Volume / pathWhat lives there
mail_dataMaildir mailboxes. Back this up.
mail_dkimDKIM private key. Back this up — losing it means rotating DNS.
/app/var/uploads/driveDrive files (inside the php container).

Applying changes

# After editing MAIL_ACCOUNTS or relay env vars:
docker compose --profile mail up -d --force-recreate mta mailstore

# After editing anything else:
docker compose --profile mail up -d --build

Migrations run automatically on container boot — you don't run them by hand. If a container is restart-looping on a migration error, check docker compose logs <service> before anything else.