aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-11-25 15:18:16 +0000
committerAntoine GIRARD <sapk@users.noreply.github.com>2019-11-25 16:18:16 +0100
commit2b257a91def6eb3bd5a5f06263e7c13cd193b8c8 (patch)
tree7fb5ff3f8d0b06299f16c30c17e6e05046227218
parentc01afd584d42ef43ce783fd463b43987d0e99d1e (diff)
downloadgitea-2b257a91def6eb3bd5a5f06263e7c13cd193b8c8.tar.gz
gitea-2b257a91def6eb3bd5a5f06263e7c13cd193b8c8.zip
Fix #9151 - smtp logger configuration sendTos should be an arra… (#9157)
* Fix #9151 - sendTos should be an array * trimspace from the addresses
-rw-r--r--modules/setting/log.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/setting/log.go b/modules/setting/log.go
index 5e2d2d769d..2cc95f11b2 100644
--- a/modules/setting/log.go
+++ b/modules/setting/log.go
@@ -128,7 +128,11 @@ func generateLogConfig(sec *ini.Section, name string, defaults defaultLogOptions
logConfig["username"] = sec.Key("USER").MustString("example@example.com")
logConfig["password"] = sec.Key("PASSWD").MustString("******")
logConfig["host"] = sec.Key("HOST").MustString("127.0.0.1:25")
- logConfig["sendTos"] = sec.Key("RECEIVERS").MustString("[]")
+ sendTos := strings.Split(sec.Key("RECEIVERS").MustString(""), ",")
+ for i, address := range sendTos {
+ sendTos[i] = strings.TrimSpace(address)
+ }
+ logConfig["sendTos"] = sendTos
logConfig["subject"] = sec.Key("SUBJECT").MustString("Diagnostic message from Gitea")
}