From 4ad491d446b1d7d05b39f9d7342845ac81951ecc Mon Sep 17 00:00:00 2001 From: Martin Balvers Date: Thu, 22 Feb 2024 14:52:05 +0100 Subject: [PATCH 1/3] fix: change default setting of SMTP_SSL Changed the defaukt of SMTP_SSL to not set. Now the ssl: setting in configuration.yml is only present if SMTP_SSL is explicitly set. --- README.md | 2 +- assets/runtime/env-defaults | 1 - assets/runtime/functions | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a4be894..0c68028b 100644 --- a/README.md +++ b/README.md @@ -659,7 +659,7 @@ Below is the complete list of parameters that can be set using environment varia - **SMTP_OPENSSL_VERIFY_MODE**: SMTP openssl verification mode. Accepted values are `none`, `peer`, `client_once` and `fail_if_no_peer_cert`. SSL certificate verification is performed by default. - **SMTP_STARTTLS**: Enable STARTTLS. Defaults to `true`. - **SMTP_TLS**: Enable SSL/TLS. Defaults to `false`. -- **SMTP_SSL**: Enable SSL. Defaults to `false`. +- **SMTP_SSL**: Enable SSL. Defaults to not set. https://www.redmine.org/projects/redmine/wiki/EmailConfiguration#Error-TimeoutError-due-to-SSL-SMTP-server-connection - **SMTP_AUTHENTICATION**: Specify the SMTP authentication method. Defaults to `:login` if `SMTP_USER` is set. - **SMTP_CA_ENABLED**: Enable custom CA certificates for SMTP email configuration. Defaults to `false`. diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 4519edfd..39fe88b2 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -96,7 +96,6 @@ SMTP_PASS=${SMTP_PASS:-} SMTP_OPENSSL_VERIFY_MODE=${SMTP_OPENSSL_VERIFY_MODE:-} SMTP_STARTTLS=${SMTP_STARTTLS:-true} SMTP_TLS=${SMTP_TLS:-false} -SMTP_SSL=${SMTP_SSL:-false} SMTP_CA_ENABLED=${SMTP_CA_ENABLED:-false} SMTP_CA_PATH=${SMTP_CA_PATH:-$REDMINE_DATA_DIR/certs} SMTP_CA_FILE=${SMTP_CA_FILE:-$REDMINE_DATA_DIR/certs/ca.crt} diff --git a/assets/runtime/functions b/assets/runtime/functions index fe7c2b16..8fe4bd2c 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -410,6 +410,10 @@ redmine_configure_email_delivery() { else echo "Configuring redmine::email_delivery..." + if [[ -z "${SMTP_SSL}" ]]; then + exec_as_redmine sed -i -e '/{{SMTP_SSL}}/d' ${REDMINE_CONFIG} + fi + if [[ -z "${SMTP_USER}" ]]; then exec_as_redmine sed -i \ -e '/{{SMTP_USER}}/d' \ From 8527a38829836c5007c05e6eb864b517cd2610f5 Mon Sep 17 00:00:00 2001 From: Martin Balvers Date: Thu, 22 Feb 2024 15:59:56 +0100 Subject: [PATCH 2/3] fix: only set ssl: option it SMTP_SSL=true --- assets/runtime/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/runtime/functions b/assets/runtime/functions index 8fe4bd2c..f7ffaab1 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -410,7 +410,7 @@ redmine_configure_email_delivery() { else echo "Configuring redmine::email_delivery..." - if [[ -z "${SMTP_SSL}" ]]; then + if [[ "${SMTP_SSL}" != "true" ]]; then exec_as_redmine sed -i -e '/{{SMTP_SSL}}/d' ${REDMINE_CONFIG} fi From f550222f7afd7b20efc7464d1a58150bd031cf87 Mon Sep 17 00:00:00 2001 From: Martin Balvers Date: Tue, 26 Mar 2024 11:28:23 +0100 Subject: [PATCH 3/3] fix: no deed to change README.md and env-defaults --- README.md | 2 +- assets/runtime/env-defaults | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1629ed84..7bba8d7f 100644 --- a/README.md +++ b/README.md @@ -660,7 +660,7 @@ Below is the complete list of parameters that can be set using environment varia - **SMTP_OPENSSL_VERIFY_MODE**: SMTP openssl verification mode. Accepted values are `none`, `peer`, `client_once` and `fail_if_no_peer_cert`. SSL certificate verification is performed by default. - **SMTP_STARTTLS**: Enable STARTTLS. Defaults to `true`. - **SMTP_TLS**: Enable SSL/TLS. Defaults to `false`. -- **SMTP_SSL**: Enable SSL. Defaults to not set. +- **SMTP_SSL**: Enable SSL. Defaults to `false`. https://www.redmine.org/projects/redmine/wiki/EmailConfiguration#Error-TimeoutError-due-to-SSL-SMTP-server-connection - **SMTP_AUTHENTICATION**: Specify the SMTP authentication method. Defaults to `:login` if `SMTP_USER` is set. - **SMTP_CA_ENABLED**: Enable custom CA certificates for SMTP email configuration. Defaults to `false`. diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 5f0551e4..10231476 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -96,6 +96,7 @@ SMTP_PASS=${SMTP_PASS:-} SMTP_OPENSSL_VERIFY_MODE=${SMTP_OPENSSL_VERIFY_MODE:-} SMTP_STARTTLS=${SMTP_STARTTLS:-true} SMTP_TLS=${SMTP_TLS:-false} +SMTP_SSL=${SMTP_SSL:-false} SMTP_CA_ENABLED=${SMTP_CA_ENABLED:-false} SMTP_CA_PATH=${SMTP_CA_PATH:-$REDMINE_DATA_DIR/certs} SMTP_CA_FILE=${SMTP_CA_FILE:-$REDMINE_DATA_DIR/certs/ca.crt}