Skip to content

Commit f5bd088

Browse files
authored
Fix #9151 - smtp logger configuration sendTos should be an array (#9154)
* Fix #9151 - sendTos should be an array * trimspace from the addresses
1 parent 802aa6d commit f5bd088

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/setting/log.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ func generateLogConfig(sec *ini.Section, name string, defaults defaultLogOptions
131131
logConfig["username"] = sec.Key("USER").MustString("example@example.com")
132132
logConfig["password"] = sec.Key("PASSWD").MustString("******")
133133
logConfig["host"] = sec.Key("HOST").MustString("127.0.0.1:25")
134-
logConfig["sendTos"] = sec.Key("RECEIVERS").MustString("[]")
134+
sendTos := strings.Split(sec.Key("RECEIVERS").MustString(""), ",")
135+
for i, address := range sendTos {
136+
sendTos[i] = strings.TrimSpace(address)
137+
}
138+
logConfig["sendTos"] = sendTos
135139
logConfig["subject"] = sec.Key("SUBJECT").MustString("Diagnostic message from Gitea")
136140
}
137141

0 commit comments

Comments
 (0)