diff options
author | Thomas Boerger <thomas@webhippie.de> | 2016-11-03 09:09:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-03 09:09:00 +0100 |
commit | bc7e92a2b592ef277f388e60b42f916cf111270c (patch) | |
tree | df50b4e503282738310e1ab6fa880e2972c90f2e /modules/setting/setting.go | |
parent | f3321d920d5ade3ba734e506ce63a5f2a418fbf5 (diff) | |
parent | e4fe69365f24cc0644968a9664b0904d0195bee1 (diff) | |
download | gitea-bc7e92a2b592ef277f388e60b42f916cf111270c.tar.gz gitea-bc7e92a2b592ef277f388e60b42f916cf111270c.zip |
Merge branch 'develop' into title-ui-fix
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index cff3e7dbc2..7696c09127 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -6,6 +6,7 @@ package setting import ( "fmt" + "net/mail" "net/url" "os" "os/exec" @@ -21,7 +22,7 @@ import ( _ "github.com/go-macaron/cache/redis" "github.com/go-macaron/session" _ "github.com/go-macaron/session/redis" - "github.com/strk/go-libravatar" + "strk.kbt.io/projects/go/libravatar" "gopkg.in/ini.v1" "github.com/gogits/gogs/modules/bindata" @@ -714,6 +715,7 @@ type Mailer struct { Name string Host string From string + FromEmail string User, Passwd string DisableHelo bool HeloHostname string @@ -749,6 +751,13 @@ func newMailService() { EnableHTMLAlternative: sec.Key("ENABLE_HTML_ALTERNATIVE").MustBool(), } MailService.From = sec.Key("FROM").MustString(MailService.User) + + parsed, err := mail.ParseAddress(MailService.From) + if err != nil { + log.Fatal(4, "Invalid mailer.FROM (%s): %v", MailService.From, err) + } + MailService.FromEmail = parsed.Address + log.Info("Mail Service Enabled") } |