|
|
@ -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")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|