Skip to content

Commit 2b257a9

Browse files
zeripathsapk
authored andcommitted
Fix #9151 - smtp logger configuration sendTos should be an arra… (#9157)
* Fix #9151 - sendTos should be an array * trimspace from the addresses
1 parent c01afd5 commit 2b257a9

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
@@ -128,7 +128,11 @@ func generateLogConfig(sec *ini.Section, name string, defaults defaultLogOptions
128128
logConfig["username"] = sec.Key("USER").MustString("[email protected]")
129129
logConfig["password"] = sec.Key("PASSWD").MustString("******")
130130
logConfig["host"] = sec.Key("HOST").MustString("127.0.0.1:25")
131-
logConfig["sendTos"] = sec.Key("RECEIVERS").MustString("[]")
131+
sendTos := strings.Split(sec.Key("RECEIVERS").MustString(""), ",")
132+
for i, address := range sendTos {
133+
sendTos[i] = strings.TrimSpace(address)
134+
}
135+
logConfig["sendTos"] = sendTos
132136
logConfig["subject"] = sec.Key("SUBJECT").MustString("Diagnostic message from Gitea")
133137
}
134138

0 commit comments

Comments
 (0)