1
0
Fork 0
forked from forgejo/forgejo

Merge pull request #943 from diseaz/mailer-client-cert

Use client certificate for SMTP over TLS
This commit is contained in:
无闻 2015-02-28 22:25:48 -05:00
commit 3db80f2c55
3 changed files with 27 additions and 10 deletions

View file

@ -451,11 +451,13 @@ func newSessionService() {
// Mailer represents mail service.
type Mailer struct {
Name string
Host string
From string
User, Passwd string
SkipVerify bool
Name string
Host string
From string
User, Passwd string
SkipVerify bool
UseCertificate bool
CertFile, KeyFile string
}
type OauthInfo struct {
@ -483,11 +485,14 @@ func newMailService() {
}
MailService = &Mailer{
Name: sec.Key("NAME").MustString(AppName),
Host: sec.Key("HOST").String(),
User: sec.Key("USER").String(),
Passwd: sec.Key("PASSWD").String(),
SkipVerify: sec.Key("SKIP_VERIFY").MustBool(),
Name: sec.Key("NAME").MustString(AppName),
Host: sec.Key("HOST").String(),
User: sec.Key("USER").String(),
Passwd: sec.Key("PASSWD").String(),
SkipVerify: sec.Key("SKIP_VERIFY").MustBool(),
UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(),
CertFile: sec.Key("CERT_FILE").String(),
KeyFile: sec.Key("KEY_FILE").String(),
}
MailService.From = sec.Key("FROM").MustString(MailService.User)
log.Info("Mail Service Enabled")