introduce smtp config option for EHLO identity
This commit is contained in:
@@ -101,7 +101,11 @@ func createDialer() (*gomail.Dialer, error) {
|
||||
|
||||
d := gomail.NewDialer(host, iPort, setting.Smtp.User, setting.Smtp.Password)
|
||||
d.TLSConfig = tlsconfig
|
||||
d.LocalName = setting.InstanceName
|
||||
if setting.Smtp.EhloIdentity != "" {
|
||||
d.LocalName = setting.Smtp.EhloIdentity
|
||||
} else {
|
||||
d.LocalName = setting.InstanceName
|
||||
}
|
||||
return d, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
package setting
|
||||
|
||||
type SmtpSettings struct {
|
||||
Enabled bool
|
||||
Host string
|
||||
User string
|
||||
Password string
|
||||
CertFile string
|
||||
KeyFile string
|
||||
FromAddress string
|
||||
FromName string
|
||||
SkipVerify bool
|
||||
Enabled bool
|
||||
Host string
|
||||
User string
|
||||
Password string
|
||||
CertFile string
|
||||
KeyFile string
|
||||
FromAddress string
|
||||
FromName string
|
||||
EhloIdentity string
|
||||
SkipVerify bool
|
||||
|
||||
SendWelcomeEmailOnSignUp bool
|
||||
TemplatesPattern string
|
||||
@@ -25,6 +26,7 @@ func readSmtpSettings() {
|
||||
Smtp.KeyFile = sec.Key("key_file").String()
|
||||
Smtp.FromAddress = sec.Key("from_address").String()
|
||||
Smtp.FromName = sec.Key("from_name").String()
|
||||
Smtp.EhloIdentity = sec.Key("ehlo_identity").String()
|
||||
Smtp.SkipVerify = sec.Key("skip_verify").MustBool(false)
|
||||
|
||||
emails := Cfg.Section("emails")
|
||||
|
||||
Reference in New Issue
Block a user