diff --git a/config/config.go b/config/config.go index c284627..afd0c89 100644 --- a/config/config.go +++ b/config/config.go @@ -46,6 +46,7 @@ type Config struct { SmtpUseAuth bool // Set whether to use authentication on the smarthosthost SmtpIdentity string // Smarthost username SmtpPassword string // Smarthost password + SupportMail string // separate mail address for support contact } SQL struct { Type string // Can be "SQLite" or "Mysql" @@ -143,6 +144,15 @@ func validateConfig(conf *Config) error { err = fmt.Errorf("Validating config: Mail FromName could not be parsed (%w)", mailFromNameErr) log.Println(err) } + supportMail, mailSupportMailErr := mail.ParseAddress(string(conf.Mailer.SupportMail)) + if !(mailSupportMailErr == nil) { + err = fmt.Errorf("Validating config: SupportMail could not be parsed (%w)", mailSupportMailErr) + log.Println(err) + } + if !(supportMail.Name == "") { + err = fmt.Errorf("Validating config: SupportMail must not contain a name") + log.Println(err) + } if !(conf.SQL.Type == "SQLite" || conf.SQL.Type == "Mysql") { err = fmt.Errorf("Validating config: SQL type must be 'SQLite' or 'Mysql', but is '%s'.", conf.SQL.Type) log.Println(err.Error()) diff --git a/config/config.json b/config/config.json index 2e78982..78ff627 100644 --- a/config/config.json +++ b/config/config.json @@ -28,7 +28,8 @@ "smtpPort": 25, "smtpUseAuth": false, "smtpIdentity": "", - "smtpPassword": "" + "smtpPassword": "", + "supportMail": "officeHoursSupport@localhost" }, "SQL": { "type": "SQLite", diff --git a/templating/templates/addFailure.html b/templating/templates/addFailure.html index 8ca8fd9..07b10c1 100644 --- a/templating/templates/addFailure.html +++ b/templating/templates/addFailure.html @@ -2,7 +2,7 @@ {{define "content"}}