From 5f83381cd85c0575cd239cded4dd4a86fcc4e348 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Zettergren?=
 <bjorn.zettergren@deltaprojects.com>
Date: Mon, 15 Jan 2018 15:52:14 +0100
Subject: [PATCH] Fix bug in how the email 'client' is edited.

We must match the entire row to make sure to search/replace the correct
place when other values collide with the specified default.

In this instance, if EMAIL_AUTH is false, both username and password
gets specified to 'null', which was previously included in seds range
for searching-and-replacing 'null' occurances to EMAIL_CLIENT.
---
 bin/docker-entrypoint.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/docker-entrypoint.sh b/bin/docker-entrypoint.sh
index b7a52b6..89ccd41 100755
--- a/bin/docker-entrypoint.sh
+++ b/bin/docker-entrypoint.sh
@@ -132,7 +132,7 @@ email_setup() {
 	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
+    sed -i "0,/'client'/s:'client' => $default_client:'client' => '$EMAIL_CLIENT':" $email_config
   fi
   sed -i "0,/tls/s:false:${EMAIL_TLS:-false}:" $email_config