mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Merge pull request #31 from mattermost/feedback-email-auto
HELIUM If feedback email is not specified then autodetect domain and use feedback@domain
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
"SMTPPassword": "",
|
||||
"SMTPServer": "localhost:25",
|
||||
"UseTLS": false,
|
||||
"FeedbackEmail": "feedback@xxxxxxmustbefilledin.com",
|
||||
"FeedbackEmail": "",
|
||||
"FeedbackName": "",
|
||||
"ApplePushServer": "",
|
||||
"ApplePushCertPublic": "",
|
||||
|
||||
@@ -6,6 +6,7 @@ package utils
|
||||
import (
|
||||
l4g "code.google.com/p/log4go"
|
||||
"encoding/json"
|
||||
"net/mail"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
@@ -222,15 +223,20 @@ func LoadConfig(fileName string) {
|
||||
config.ServiceSettings.Domain = os.Getenv("MATTERMOST_DOMAIN")
|
||||
}
|
||||
|
||||
// Validates our mail settings
|
||||
if err := CheckMailSettings(); err != nil {
|
||||
l4g.Error("Email settings are not valid err=%v", err)
|
||||
// Check for a valid email for feedback, if not then do feedback@domain
|
||||
if _, err := mail.ParseAddress(config.EmailSettings.FeedbackEmail); err != nil {
|
||||
config.EmailSettings.FeedbackEmail = "feedback@" + config.ServiceSettings.Domain
|
||||
}
|
||||
|
||||
configureLog(config.LogSettings)
|
||||
|
||||
Cfg = &config
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user