forked from gitea/gitea
1
0
Fork 0

Merge branch 'develop' into title-ui-fix

This commit is contained in:
Thomas Boerger 2016-11-03 09:09:00 +01:00 committed by GitHub
commit bc7e92a2b5
6 changed files with 15 additions and 5 deletions

View File

@ -35,7 +35,7 @@ github.com/nfnt/resize = commit:891127d
github.com/russross/blackfriday = commit:93622da github.com/russross/blackfriday = commit:93622da
github.com/satori/go.uuid = commit:0aa62d5 github.com/satori/go.uuid = commit:0aa62d5
github.com/sergi/go-diff = commit:ec7fdbb github.com/sergi/go-diff = commit:ec7fdbb
github.com/strk/go-libravatar = commit:5eed7bf strk.kbt.io/projects/go/libravatar = commit:5eed7bf
github.com/shurcooL/sanitized_anchor_name = commit:10ef21a github.com/shurcooL/sanitized_anchor_name = commit:10ef21a
github.com/Unknwon/cae = commit:7f5e046 github.com/Unknwon/cae = commit:7f5e046
github.com/Unknwon/com = commit:28b053d github.com/Unknwon/com = commit:28b053d

1
.lgtm Normal file
View File

@ -0,0 +1 @@
self_approval_off = false

2
glide.lock generated
View File

@ -81,7 +81,7 @@ imports:
version: ec7fdbb58eb3e300c8595ad5ac74a5aa50019cc7 version: ec7fdbb58eb3e300c8595ad5ac74a5aa50019cc7
subpackages: subpackages:
- diffmatchpatch - diffmatchpatch
- name: github.com/strk/go-libravatar - name: strk.kbt.io/projects/go/libravatar
version: 5eed7bff870ae19ef51c5773dbc8f3e9fcbd0982 version: 5eed7bff870ae19ef51c5773dbc8f3e9fcbd0982
- name: github.com/shurcooL/sanitized_anchor_name - name: github.com/shurcooL/sanitized_anchor_name
version: 10ef21a441db47d8b13ebcc5fd2310f636973c77 version: 10ef21a441db47d8b13ebcc5fd2310f636973c77

View File

@ -40,7 +40,7 @@ import:
- package: github.com/sergi/go-diff - package: github.com/sergi/go-diff
subpackages: subpackages:
- diffmatchpatch - diffmatchpatch
- package: github.com/strk/go-libravatar - package: strk.kbt.io/projects/go/libravatar
- package: golang.org/x/crypto - package: golang.org/x/crypto
subpackages: subpackages:
- ssh - ssh

View File

@ -160,7 +160,7 @@ func composeIssueMessage(issue *Issue, doer *User, tplName base.TplName, tos []s
if err != nil { if err != nil {
log.Error(3, "HTMLString (%s): %v", tplName, err) log.Error(3, "HTMLString (%s): %v", tplName, err)
} }
msg := mailer.NewMessageFrom(tos, fmt.Sprintf(`"%s" <%s>`, doer.DisplayName(), setting.MailService.User), subject, content) msg := mailer.NewMessageFrom(tos, fmt.Sprintf(`"%s" <%s>`, doer.DisplayName(), setting.MailService.FromEmail), subject, content)
msg.Info = fmt.Sprintf("Subject: %s, %s", subject, info) msg.Info = fmt.Sprintf("Subject: %s, %s", subject, info)
return msg return msg
} }

View File

@ -6,6 +6,7 @@ package setting
import ( import (
"fmt" "fmt"
"net/mail"
"net/url" "net/url"
"os" "os"
"os/exec" "os/exec"
@ -21,7 +22,7 @@ import (
_ "github.com/go-macaron/cache/redis" _ "github.com/go-macaron/cache/redis"
"github.com/go-macaron/session" "github.com/go-macaron/session"
_ "github.com/go-macaron/session/redis" _ "github.com/go-macaron/session/redis"
"github.com/strk/go-libravatar" "strk.kbt.io/projects/go/libravatar"
"gopkg.in/ini.v1" "gopkg.in/ini.v1"
"github.com/gogits/gogs/modules/bindata" "github.com/gogits/gogs/modules/bindata"
@ -714,6 +715,7 @@ type Mailer struct {
Name string Name string
Host string Host string
From string From string
FromEmail string
User, Passwd string User, Passwd string
DisableHelo bool DisableHelo bool
HeloHostname string HeloHostname string
@ -749,6 +751,13 @@ func newMailService() {
EnableHTMLAlternative: sec.Key("ENABLE_HTML_ALTERNATIVE").MustBool(), EnableHTMLAlternative: sec.Key("ENABLE_HTML_ALTERNATIVE").MustBool(),
} }
MailService.From = sec.Key("FROM").MustString(MailService.User) 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") log.Info("Mail Service Enabled")
} }