Skip to content

Commit

Permalink
Merge branch 'bjozet-email_client'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlen committed Jan 14, 2018
2 parents f541f21 + 8c7c5b3 commit 45bec05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Passbolt docker image provides several environment variables to configure differ
* 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_CLIENT: hostname to send as smtp helo ( defaults to null)
* EMAIL_TLS: set tls, boolean ( defaults to false)

## Advanced configuration
Expand Down
6 changes: 5 additions & 1 deletion bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ email_setup() {
# EMAIL_AUTH
# EMAIL_USERNAME
# EMAIL_PASSWORD
# EMAIL_CLIENT
# EMAIL_TLS

local default_transport='Smtp'
Expand All @@ -115,6 +116,7 @@ email_setup() {
local default_timeout='30'
local default_username="''"
local default_password="''"
local default_client=null

cp $email_config{.default,}
sed -i s:$default_transport:${EMAIL_TRANSPORT:-Smtp}:g $email_config
Expand All @@ -129,7 +131,9 @@ email_setup() {
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

if [ -n "$EMAIL_CLIENT" ] ; then
sed -i "0,/"$default_client"/s:"$default_client":'$EMAIL_CLIENT':" $email_config
fi
sed -i "0,/tls/s:false:${EMAIL_TLS:-false}:" $email_config

}
Expand Down

0 comments on commit 45bec05

Please sign in to comment.