If feedback email is not specified then autodetect domain and use feedback@domain
Этот коммит содержится в:
@@ -58,7 +58,7 @@
|
|||||||
"SMTPPassword": "",
|
"SMTPPassword": "",
|
||||||
"SMTPServer": "localhost:25",
|
"SMTPServer": "localhost:25",
|
||||||
"UseTLS": false,
|
"UseTLS": false,
|
||||||
"FeedbackEmail": "feedback@xxxxxxmustbefilledin.com",
|
"FeedbackEmail": "",
|
||||||
"FeedbackName": "",
|
"FeedbackName": "",
|
||||||
"ApplePushServer": "",
|
"ApplePushServer": "",
|
||||||
"ApplePushCertPublic": "",
|
"ApplePushCertPublic": "",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package utils
|
|||||||
import (
|
import (
|
||||||
l4g "code.google.com/p/log4go"
|
l4g "code.google.com/p/log4go"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/mail"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
@@ -222,15 +223,20 @@ func LoadConfig(fileName string) {
|
|||||||
config.ServiceSettings.Domain = os.Getenv("MATTERMOST_DOMAIN")
|
config.ServiceSettings.Domain = os.Getenv("MATTERMOST_DOMAIN")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validates our mail settings
|
// Check for a valid email for feedback, if not then do feedback@domain
|
||||||
if err := CheckMailSettings(); err != nil {
|
if _, err := mail.ParseAddress(config.EmailSettings.FeedbackEmail); err != nil {
|
||||||
l4g.Error("Email settings are not valid err=%v", err)
|
config.EmailSettings.FeedbackEmail = "feedback@" + config.ServiceSettings.Domain
|
||||||
}
|
}
|
||||||
|
|
||||||
configureLog(config.LogSettings)
|
configureLog(config.LogSettings)
|
||||||
|
|
||||||
Cfg = &config
|
Cfg = &config
|
||||||
SanitizeOptions = getSanitizeOptions()
|
SanitizeOptions = getSanitizeOptions()
|
||||||
|
|
||||||
|
// Validates our mail settings
|
||||||
|
if err := CheckMailSettings(); err != nil {
|
||||||
|
l4g.Error("Email settings are not valid err=%v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getSanitizeOptions() map[string]bool {
|
func getSanitizeOptions() map[string]bool {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user