Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions docs/configuration/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ These are the core environment variables that need to be configured in your `.en
When you use the MySQL service provided by docker-mailserver compose, you don't need to configure this.
It is required to **always set** `MYSQL_PASSWORD`.

| Variable | Default | Description |
| ---------------- | ------------------------------------ | ----------------------- |
| `MYSQL_HOST` | `db` | MySQL database hostname |
| `MYSQL_PORT` | `3306` | MySQL database port |
| `MYSQL_DATABASE` | `mailserver` | MySQL database name |
| `MYSQL_USER` | `root` (MTA/MDA), `mailserver` (Web) | MySQL database username |
| `MYSQL_PASSWORD` | _(empty)_ | MySQL database password |
| Variable | Default | Description |
| ----------------------- | ------------------------------------ | ---------------------------------- |
| `MYSQL_HOST` | `db` | MySQL database hostname |
| `MYSQL_PORT` | `3306` | MySQL database port |
| `MYSQL_DATABASE` | `mailserver` | MySQL database name |
| `MYSQL_USER` | `root` (MTA/MDA), `mailserver` (Web) | MySQL database username |
| `MYSQL_PASSWORD` | _(empty)_ | MySQL database password |
| `MYSQL_TLS_VERIFY_CERT` | `no` | MySQL TLS certificate verification |

### Mail Server Identity

Expand Down
3 changes: 2 additions & 1 deletion target/mta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ghcr.io/jeboehm/dockerize:0.9.3@sha256:d4e824aa120670658d7012421d2fdf1b2437be34a6acbb7a4ad92ed52edec8eb AS dockerize
FROM alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412
FROM alpine:3.23@sha256:865b95f46d98cf867a156fe4a135ad3fe50d2056aa3f25ed31662dff6da4eb62

LABEL maintainer="https://github.com/jeboehm/docker-mailserver"
LABEL vendor="https://github.com/jeboehm/docker-mailserver"
Expand All @@ -11,6 +11,7 @@ ENV MAILNAME=mail.example.com \
MYSQL_PORT=3306 \
MYSQL_USER=root \
MYSQL_DATABASE=mailserver \
MYSQL_TLS_VERIFY_CERT=no \
MDA_LMTP_ADDRESS=mda:2003 \
MDA_AUTH_ADDRESS=mda:2004 \
FILTER_MILTER_ADDRESS=filter:11332 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ user = {{ .Env.MYSQL_USER }}
password = {{ .Env.MYSQL_PASSWORD }}
hosts = {{ .Env.MYSQL_HOST }}:{{ .Env.MYSQL_PORT }}
dbname = {{ .Env.MYSQL_DATABASE }}
tls_verify_cert = {{ .Env.MYSQL_TLS_VERIFY_CERT }}
query = SELECT CONCAT(mail_users.name, '@', d1.name) AS email FROM mail_users JOIN mail_domains d1 ON mail_users.domain_id = d1.id HAVING email='%s' UNION SELECT destination AS email FROM mail_aliases JOIN mail_domains d2 ON mail_aliases.domain_id = d2.id WHERE CONCAT(mail_aliases.name, '@', d2.name)='%s'
1 change: 1 addition & 0 deletions target/mta/rootfs/etc/postfix/mysql-email2email.cf.templ
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ user = {{ .Env.MYSQL_USER }}
password = {{ .Env.MYSQL_PASSWORD }}
hosts = {{ .Env.MYSQL_HOST }}:{{ .Env.MYSQL_PORT }}
dbname = {{ .Env.MYSQL_DATABASE }}
tls_verify_cert = {{ .Env.MYSQL_TLS_VERIFY_CERT }}
query = SELECT CONCAT(mail_users.name, '@', mail_domains.name) AS email FROM mail_users JOIN mail_domains ON mail_users.domain_id = mail_domains.id HAVING email='%s'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ user = {{ .Env.MYSQL_USER }}
password = {{ .Env.MYSQL_PASSWORD }}
hosts = {{ .Env.MYSQL_HOST }}:{{ .Env.MYSQL_PORT }}
dbname = {{ .Env.MYSQL_DATABASE }}
tls_verify_cert = {{ .Env.MYSQL_TLS_VERIFY_CERT }}
query = SELECT IF(send_only = true, 'REJECT', 'OK') AS access FROM mail_users JOIN mail_domains ON mail_users.domain_id = mail_domains.id WHERE mail_users.name = '%u' AND mail_domains.name = '%d'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ user = {{ .Env.MYSQL_USER }}
password = {{ .Env.MYSQL_PASSWORD }}
hosts = {{ .Env.MYSQL_HOST }}:{{ .Env.MYSQL_PORT }}
dbname = {{ .Env.MYSQL_DATABASE }}
tls_verify_cert = {{ .Env.MYSQL_TLS_VERIFY_CERT }}
query = SELECT destination FROM mail_aliases JOIN mail_domains ON mail_aliases.domain_id = mail_domains.id WHERE CONCAT(mail_aliases.name, '@', mail_domains.name) = '%s'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ user = {{ .Env.MYSQL_USER }}
password = {{ .Env.MYSQL_PASSWORD }}
hosts = {{ .Env.MYSQL_HOST }}:{{ .Env.MYSQL_PORT }}
dbname = {{ .Env.MYSQL_DATABASE }}
tls_verify_cert = {{ .Env.MYSQL_TLS_VERIFY_CERT }}
query = SELECT 1 FROM mail_domains WHERE name='%s'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ user = {{ .Env.MYSQL_USER }}
password = {{ .Env.MYSQL_PASSWORD }}
hosts = {{ .Env.MYSQL_HOST }}:{{ .Env.MYSQL_PORT }}
dbname = {{ .Env.MYSQL_DATABASE }}
tls_verify_cert = {{ .Env.MYSQL_TLS_VERIFY_CERT }}
query = SELECT 1 FROM mail_users JOIN mail_domains ON mail_users.domain_id = mail_domains.id WHERE mail_users.name = '%u' AND mail_domains.name = '%d' AND enabled = 1
2 changes: 1 addition & 1 deletion target/ssl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412
FROM alpine:3.23@sha256:865b95f46d98cf867a156fe4a135ad3fe50d2056aa3f25ed31662dff6da4eb62

LABEL maintainer="https://github.com/jeboehm/docker-mailserver"
LABEL vendor="https://github.com/jeboehm/docker-mailserver"
Expand Down
2 changes: 1 addition & 1 deletion target/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 AS base
FROM alpine:3.23@sha256:865b95f46d98cf867a156fe4a135ad3fe50d2056aa3f25ed31662dff6da4eb62 AS base

LABEL maintainer="https://github.com/jeboehm/docker-mailserver"
LABEL vendor="https://github.com/jeboehm/docker-mailserver"
Expand Down