mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	* Fix #9151 - sendTos should be an array * trimspace from the addresses
This commit is contained in:
		@@ -128,7 +128,11 @@ func generateLogConfig(sec *ini.Section, name string, defaults defaultLogOptions
 | 
				
			|||||||
		logConfig["username"] = sec.Key("USER").MustString("example@example.com")
 | 
							logConfig["username"] = sec.Key("USER").MustString("example@example.com")
 | 
				
			||||||
		logConfig["password"] = sec.Key("PASSWD").MustString("******")
 | 
							logConfig["password"] = sec.Key("PASSWD").MustString("******")
 | 
				
			||||||
		logConfig["host"] = sec.Key("HOST").MustString("127.0.0.1:25")
 | 
							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")
 | 
							logConfig["subject"] = sec.Key("SUBJECT").MustString("Diagnostic message from Gitea")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user