configure SMTP

And additional to this, how to configure SMTP options to set mail notification alerts. I am using followed options and unable to get notifications. Please let me know where I need to modify below SMTP configuration.

#################################### SMTP / Emailing ##########################
[smtp]
;enabled = true
;host = localhost:25
;user = ivishnu7@gmail.com
;password =
;cert_file =
;key_file =
;skip_verify = false
;from_address = admin@grafana.localhost

Barrett prepared good article about alerting configuration:

[url]https://www.percona.com/blog/2017/01/23/mysql-and-mongodb-alerting-with-pmm-and-grafana/[/url]

I followed the same document and getting connection refused errors. Is it related to network/firewall issue or something else?

I am using default SMTP configuration.

[smtp]
enabled = true
host = localhost:25
user =
password =

Error message from /var/log/grafana.log.

t=2017-03-31T19:18:30+0000 lvl=info msg=“Sending alert notification to” logger=alerting.notifier.email addresses=[ivishnu7@gmail.com]
t=2017-03-31T19:18:30+0000 lvl=eror msg=“Failed to send alert notification email” logger=alerting.notifier.email error=“dial tcp [::1]:25: getsockopt: connection refused”
t=2017-03-31T19:18:30+0000 lvl=eror msg=“Failed to send alert notifications” logger=context userId=1 orgId=1 uname=pmm-admin error=“dial tcp [::1]:25: getsockopt: connection refused”
t=2017-03-31T19:18:30+0000 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=pmm-admin method=POST path=/api/alert-notifications/test status=500 remote_addr=127.0.0.1 time_ms=3ns size=48

Later I have modified SMTP settings, then I am getting handshake errors. Do I need to install any additional tools in docker?

t=2017-04-01T00:55:16+0000 lvl=info msg=“Sending alert notification to” logger=alerting.notifier.email addresses=[ivishnu7@gmail.com]
t=2017-04-01T00:55:16+0000 lvl=eror msg=“Failed to send alert notification email” logger=alerting.notifier.email error=“remote error: tls: handshake failure”
t=2017-04-01T00:55:16+0000 lvl=eror msg=“Failed to send alert notifications” logger=context userId=1 orgId=1 uname=pmm-admin error=“remote error: tls: handshake failure”
t=2017-04-01T00:55:16+0000 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=pmm-admin method=POST path=/api/alert-notifications/test status=500 remote_addr=127.0.0.1 time_ms=107ns size=48

It is needed to configure external SMTP server,
docker container doesn’t have configured mail server inside

The pmm-server already configured with external smtp server. I am able to send mails from pmm-server with this command(echo “testing”| mail -s “test” ivishnu7@gmail.com) and I am able to do telnet to smtp server also. I am not sure why handshake failure errors getting. Share documents any related to this error.

t=2017-04-01T20:52:55+0000 lvl=info msg=“Sending alert notification to” logger=alerting.notifier.email addresses=[ivishnu7@gmail.com]
t=2017-04-01T20:52:55+0000 lvl=eror msg=“Failed to send alert notification email” logger=alerting.notifier.email error=“remote error: tls: handshake failure”
t=2017-04-01T20:52:55+0000 lvl=eror msg=“Failed to send alert notifications” logger=context userId=1 orgId=1 uname=pmm-admin error=“remote error: tls: handshake failure”
t=2017-04-01T20:52:55+0000 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=pmm-admin method=POST path=/api/alert-notifications/test status=500 remote_addr=127.0.0.1 time_ms=57ns size=48

when you try to connect 127.0.0.1 from docker container it is actually tries to connect to something inside docker container, not to docker host system.

SMTP server is not configured inside docker container, so grafana cannot send anything because it cannot connect to SMTP sever inside container.
you need to configure external SMTP for grafana.