diff --git a/2023.12/apache/setup_msmtp.sh b/2023.12/apache/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2023.12/apache/setup_msmtp.sh +++ b/2023.12/apache/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/2023.12/fpm-alpine/setup_msmtp.sh b/2023.12/fpm-alpine/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2023.12/fpm-alpine/setup_msmtp.sh +++ b/2023.12/fpm-alpine/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/2023.12/fpm/setup_msmtp.sh b/2023.12/fpm/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2023.12/fpm/setup_msmtp.sh +++ b/2023.12/fpm/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/2024.03-dev/apache/setup_msmtp.sh b/2024.03-dev/apache/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2024.03-dev/apache/setup_msmtp.sh +++ b/2024.03-dev/apache/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/2024.03-dev/fpm-alpine/setup_msmtp.sh b/2024.03-dev/fpm-alpine/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2024.03-dev/fpm-alpine/setup_msmtp.sh +++ b/2024.03-dev/fpm-alpine/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/2024.03-dev/fpm/setup_msmtp.sh b/2024.03-dev/fpm/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2024.03-dev/fpm/setup_msmtp.sh +++ b/2024.03-dev/fpm/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/2024.03-rc/apache/setup_msmtp.sh b/2024.03-rc/apache/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2024.03-rc/apache/setup_msmtp.sh +++ b/2024.03-rc/apache/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/2024.03-rc/fpm-alpine/setup_msmtp.sh b/2024.03-rc/fpm-alpine/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2024.03-rc/fpm-alpine/setup_msmtp.sh +++ b/2024.03-rc/fpm-alpine/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/2024.03-rc/fpm/setup_msmtp.sh b/2024.03-rc/fpm/setup_msmtp.sh index 654883c..c902b6d 100644 --- a/2024.03-rc/fpm/setup_msmtp.sh +++ b/2024.03-rc/fpm/setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi diff --git a/README.md b/README.md index 5c5a439..b492f41 100644 --- a/README.md +++ b/README.md @@ -123,11 +123,16 @@ The following environment variables are possible for the SMTP examples. - `SMTP_DOMAIN` The sender domain. (**required** - e.g. `friendica.local`) - `SMTP_FROM` Sender user-part of the address. (Default: `no-reply` - e.g. no-reply@friendica.local) - `SMTP_TLS` Use TLS for connecting the SMTP Mail-Gateway. (Default: empty) -- `SMTP_STARTTLS` Use STARTTLS for connecting the SMTP Mail-Gateway. (Default: empty) +- `SMTP_STARTTLS` Use STARTTLS for connecting the SMTP Mail-Gateway. (Default: `On`) - `SMTP_AUTH` Auth mode for the SMTP Mail-Gateway. (Default: `On`) - `SMTP_AUTH_USER` Username for the SMTP Mail-Gateway. (Default: empty) - `SMTP_AUTH_PASS` Password for the SMTP Mail-Gateway. (Default: empty) +**Addition to STARTTLS** + +the `tls_starttls` setting is either `On` or `Off`, but never unset. +That's because in case it's unset, `starttls` would be activated by default (which would need additional configuration like a separate port). + ## Database settings You have to add the Friendica container to the same network as the running database container, e. g. `--network some-network`, and then use `mysql` as the database host on setup. diff --git a/docker-setup_msmtp.sh b/docker-setup_msmtp.sh index 654883c..c902b6d 100644 --- a/docker-setup_msmtp.sh +++ b/docker-setup_msmtp.sh @@ -7,6 +7,8 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" smtp_from="${SMTP_FROM:=no-reply}" smtp_auth="${SMTP_AUTH:=on}" + # https://github.com/friendica/docker/issues/233 + smtp_starttls="${SMTP_STARTTLS:=on}" # Setup MSMTP usermod --comment "$(echo "$SITENAME" | tr -dc '[:print:]')" root @@ -26,7 +28,7 @@ if [ -n "${SMTP_DOMAIN+x}" ] && [ -n "${SMTP+x}" ] && [ "${SMTP}" != "localhost" echo "from \"$smtp_from@$SMTP_DOMAIN\"" echo "tls_certcheck off" # No certcheck because of internal docker mail-hostnames if [ -n "${SMTP_TLS+x}" ]; then echo "tls on"; fi - if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi + echo "tls_starttls $smtp_starttls"; if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "auth $smtp_auth"; fi if [ -n "${SMTP_AUTH_USER+x}" ]; then echo "user \"$SMTP_AUTH_USER\""; fi if [ -n "${SMTP_AUTH_PASS+x}" ]; then echo "password \"$SMTP_AUTH_PASS\""; fi