Skip to content

Commit e0ecd9f

Browse files
lunnytboerger
authored andcommitted
fix bug #1122 log.smtp receiver configure error (#3602) (#451)
1 parent 65b1875 commit e0ecd9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: conf/app.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ HOST =
338338
; Mailer user name and password
339339
USER =
340340
PASSWD =
341-
; Receivers, can be one or more, e.g. ["1@example.com","2@example.com"]
341+
; Receivers, can be one or more, e.g. 1@example.com,2@example.com
342342
RECEIVERS =
343343

344344
; For "database" mode only

Diff for: modules/setting/setting.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,11 @@ func newLogService() {
686686
sec.Key("PROTOCOL").In("tcp", []string{"tcp", "unix", "udp"}),
687687
sec.Key("ADDR").MustString(":7020"))
688688
case "smtp":
689-
LogConfigs[i] = fmt.Sprintf(`{"level":%s,"username":"%s","password":"%s","host":"%s","sendTos":"%s","subject":"%s"}`, level,
689+
LogConfigs[i] = fmt.Sprintf(`{"level":%s,"username":"%s","password":"%s","host":"%s","sendTos":["%s"],"subject":"%s"}`, level,
690690
sec.Key("USER").MustString("example@example.com"),
691691
sec.Key("PASSWD").MustString("******"),
692692
sec.Key("HOST").MustString("127.0.0.1:25"),
693-
sec.Key("RECEIVERS").MustString("[]"),
693+
strings.Replace(sec.Key("RECEIVERS").MustString("example@example.com"), ",", "\",\"", -1),
694694
sec.Key("SUBJECT").MustString("Diagnostic message from serve"))
695695
case "database":
696696
LogConfigs[i] = fmt.Sprintf(`{"level":%s,"driver":"%s","conn":"%s"}`, level,

0 commit comments

Comments
 (0)