Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
9aa4f5c4
Commit
9aa4f5c4
authored
Sep 24, 2017
by
Carl Bergquist
Committed by
GitHub
Sep 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9341 from thz/smtp_ehlo_identity
introduce smtp config option for EHLO identity
parents
3fac31e8
af79d046
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
10 deletions
+23
-10
conf/defaults.ini
+1
-0
conf/sample.ini
+2
-0
docs/sources/http_api/admin.md
+1
-0
docs/sources/installation/configuration.md
+3
-0
pkg/services/notifications/mailer.go
+5
-1
pkg/setting/setting_smtp.go
+11
-9
No files found.
conf/defaults.ini
View file @
9aa4f5c4
...
...
@@ -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
...
...
conf/sample.ini
View file @
9aa4f5c4
...
...
@@ -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
...
...
docs/sources/http_api/admin.md
View file @
9aa4f5c4
...
...
@@ -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":"************",
...
...
docs/sources/installation/configuration.md
View file @
9aa4f5c4
...
...
@@ -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
...
...
pkg/services/notifications/mailer.go
View file @
9aa4f5c4
...
...
@@ -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
}
...
...
pkg/setting/setting_smtp.go
View file @
9aa4f5c4
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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment