Skip to content

Commit

Permalink
Fix #9151 - smtp logger configuration sendTos should be an arra… (#9157)
Browse files Browse the repository at this point in the history
* Fix #9151 - sendTos should be an array

* trimspace from the addresses
  • Loading branch information
zeripath authored and sapk committed Nov 25, 2019
1 parent c01afd5 commit 2b257a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/setting/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit 2b257a9

Please sign in to comment.