aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-11-25 13:38:57 +0000
committerGitHub <noreply@github.com>2019-11-25 13:38:57 +0000
commitf5bd0884d2adea8ef7ba1bbd9dacb240d7c6b0f7 (patch)
tree2a545ab4db4ee721286243dbceed9f206cf8e8b8
parent802aa6d5f306ade08438dc07d93913daecb1d3ab (diff)
downloadgitea-f5bd0884d2adea8ef7ba1bbd9dacb240d7c6b0f7.tar.gz
gitea-f5bd0884d2adea8ef7ba1bbd9dacb240d7c6b0f7.zip
Fix #9151 - smtp logger configuration sendTos should be an array (#9154)
* 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 cb8f142084..5a54a8688e 100644
--- a/modules/setting/log.go
+++ b/modules/setting/log.go
@@ -131,7 +131,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")
}