mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #9341 from thz/smtp_ehlo_identity
introduce smtp config option for EHLO identity
This commit is contained in:
commit
9aa4f5c42a
@ -318,6 +318,7 @@ key_file =
|
||||
skip_verify = false
|
||||
from_address = admin@grafana.localhost
|
||||
from_name = Grafana
|
||||
ehlo_identity =
|
||||
|
||||
[emails]
|
||||
welcome_email_on_sign_up = false
|
||||
|
@ -295,6 +295,8 @@
|
||||
;skip_verify = false
|
||||
;from_address = admin@grafana.localhost
|
||||
;from_name = Grafana
|
||||
# EHLO identity in SMTP dialog (defaults to instance_name)
|
||||
;ehlo_identity = dashboard.example.com
|
||||
|
||||
[emails]
|
||||
;welcome_email_on_sign_up = false
|
||||
|
@ -161,6 +161,7 @@ Only works with Basic Authentication (username and password). See [introduction]
|
||||
"enabled":"false",
|
||||
"from_address":"admin@grafana.localhost",
|
||||
"from_name":"Grafana",
|
||||
"ehlo_identity":"dashboard.example.com",
|
||||
"host":"localhost:25",
|
||||
"key_file":"",
|
||||
"password":"************",
|
||||
|
@ -593,6 +593,9 @@ Address used when sending out emails, defaults to `admin@grafana.localhost`
|
||||
### from_name
|
||||
Name to be used when sending out emails, defaults to `Grafana`
|
||||
|
||||
### ehlo_identity
|
||||
Name to be used as client identity for EHLO in SMTP dialog, defaults to instance_name.
|
||||
|
||||
## [log]
|
||||
|
||||
### mode
|
||||
|
@ -101,7 +101,11 @@ func createDialer() (*gomail.Dialer, error) {
|
||||
|
||||
d := gomail.NewDialer(host, iPort, setting.Smtp.User, setting.Smtp.Password)
|
||||
d.TLSConfig = tlsconfig
|
||||
if setting.Smtp.EhloIdentity != "" {
|
||||
d.LocalName = setting.Smtp.EhloIdentity
|
||||
} else {
|
||||
d.LocalName = setting.InstanceName
|
||||
}
|
||||
return d, nil
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ type SmtpSettings struct {
|
||||
KeyFile string
|
||||
FromAddress string
|
||||
FromName string
|
||||
EhloIdentity string
|
||||
SkipVerify bool
|
||||
|
||||
SendWelcomeEmailOnSignUp bool
|
||||
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user