From 4128b60169ebd4565d9d7b09f89457a54dd36ae8 Mon Sep 17 00:00:00 2001 From: Bastian Rang Date: Tue, 19 Sep 2017 11:59:53 +0200 Subject: [PATCH 1/3] introduce EMAIL_AUTH=false Environment - fixes #70 - allows for setting EMAIL_AUTH=false as environment variable to deactivate SMTP-Auth entirely. This is necessary for internal mailservers / mailtraps / smarthosts, that just expose anonymous port 25. --- bin/docker-entrypoint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/docker-entrypoint.sh b/bin/docker-entrypoint.sh index 201a0d5..43855e0 100755 --- a/bin/docker-entrypoint.sh +++ b/bin/docker-entrypoint.sh @@ -124,8 +124,14 @@ email_setup() { sed -i s:$default_host:${EMAIL_HOST:-localhost}:g $email_config sed -i s:$default_port:${EMAIL_PORT:-587}:g $email_config sed -i s:$default_timeout:${EMAIL_TIMEOUT:-30}:g $email_config - sed -i "0,/"$default_username"/s:"$default_username":'${EMAIL_USERNAME:-email_user}':" $email_config - sed -i "0,/"$default_password"/s:"$default_password":'${EMAIL_PASSWORD:-email_password}':" $email_config + if [ "$EMAIL_AUTH" = "false" ] ; then + sed -i "0,/"$default_username"/s:"$default_username":null:" $email_config + sed -i "0,/"$default_password"/s:"$default_password":null:" $email_config + else + sed -i "0,/"$default_username"/s:"$default_username":'${EMAIL_USERNAME:-email_user}':" $email_config + sed -i "0,/"$default_password"/s:"$default_password":'${EMAIL_PASSWORD:-email_password}':" $email_config + fi + sed -i "0,/tls/s:false:${EMAIL_TLS:-false}:" $email_config } From 75b3e41ee8745fa20f4af37306c7d6e21c67255c Mon Sep 17 00:00:00 2001 From: Bastian Rang Date: Tue, 19 Sep 2017 12:06:45 +0200 Subject: [PATCH 2/3] list EMAIL_AUTH in env vars --- bin/docker-entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/docker-entrypoint.sh b/bin/docker-entrypoint.sh index 43855e0..7a468bc 100755 --- a/bin/docker-entrypoint.sh +++ b/bin/docker-entrypoint.sh @@ -106,6 +106,7 @@ email_setup() { # EMAIL_HOST # EMAIL_PORT # EMAIL_TIMEOUT + # EMAIL_AUTH # EMAIL_USERNAME # EMAIL_PASSWORD # EMAIL_TLS From f13f37499caf41eabd2551deb3596fb54ed50ad0 Mon Sep 17 00:00:00 2001 From: Bastian Rang Date: Tue, 19 Sep 2017 12:09:09 +0200 Subject: [PATCH 3/3] update readme for EMAIL_AUTH --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2c35703..4a3eb8b 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ Passbolt docker image provides several environment variables to configure differ * EMAIL_HOST: server hostname ( defaults to localhost) * EMAIL_PORT: server port ( defaults to 587) * EMAIL_TIMEOUT: timeout ( defaults to 30s) +* EMAIL_AUTH: disable smtp auth ( defaults to true) * EMAIL_USERNAME: username for email server auth ( defaults to email_user) * EMAIL_PASSWORD: password for email server auth ( defaults to email_password) * EMAIL_TLS: set tls, boolean ( defaults to false)