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)
| Variable | Default | What it does |
|---|---|---|
MAIL_DOMAIN | example.com | Your 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_RECORD | mail | Hostname 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
| Port | Service | Exposed to | Notes |
|---|---|---|---|
25 | mta (Postfix) | Internet | Inbound mail. Must be reachable for receiving. |
587 | mta (Postfix) | Compose network only | Deliberately not published — plMail submits here internally. |
143 | mailstore (Dovecot) | Compose network only | plMail reads mail here, like any IMAP account. |
993 | mailstore (Dovecot) | Internet (TLS) | Direct IMAP for Thunderbird/phone apps. Self-signed cert unless MAIL_CERTS_PATH is set. |
Volumes & files
| Volume / path | What lives there |
|---|---|
mail_data | Maildir mailboxes. Back this up. |
mail_dkim | DKIM private key. Back this up — losing it means rotating DNS. |
/app/var/uploads/drive | Drive 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.