SMTP not configured, check your grafana.ini config file's [smtp] section

Hi!

Grafana n00b!

I’ve configured the grafana.ini file with the below parameters under the “SMTP / Emailing” section of the file, yet still get the above error when I try to send a test email.

Can anyone point out where I’m going wrong!?

#################################### SMTP / Emailing ##########################
[smtp]
;enabled = true
;host = webmail.provider.com:465
;user = username
# If the password contains # or ; you have to wrap it with trippel quotes. Ex “”"#password;"""
;password = Password!
;cert_file =
;key_file =
;skip_verify = true
;from_address = grafana@domain.tld
;from_name = Grafana

[emails]
;welcome_email_on_sign_up = false

I’ve also copied the below from a tail of the grafana.log during service restart and test email.

t=2017-05-26T17:54:52+0100 lvl=info msg=“Shutdown started” logger=server code=0 reason="system signal: terminated"
t=2017-05-26T17:54:52+0100 lvl=info msg=“stopped http server” logger=http.server
t=2017-05-26T17:54:52+0100 lvl=info msg=“Starting Grafana” logger=main version=4.3.1 commit=befc15c compiled=2017-05-23T14:50:22+0100
t=2017-05-26T17:54:52+0100 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2017-05-26T17:54:52+0100 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2017-05-26T17:54:52+0100 lvl=info msg=“Config overriden from command line” logger=settings arg="default.paths.data=/var/lib/grafana"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Config overriden from command line” logger=settings arg="default.paths.logs=/var/log/grafana"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Config overriden from command line” logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana
t=2017-05-26T17:54:52+0100 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana
t=2017-05-26T17:54:52+0100 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana
t=2017-05-26T17:54:52+0100 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins
t=2017-05-26T17:54:52+0100 lvl=info msg=“Initializing DB” logger=sqlstore dbtype=sqlite3
t=2017-05-26T17:54:52+0100 lvl=info msg=“Starting DB migration” logger=migrator
t=2017-05-26T17:54:52+0100 lvl=info msg=“Executing migration” logger=migrator id="copy data account to org"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Skipping migration condition not fulfilled” logger=migrator id="copy data account to org"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Executing migration” logger=migrator id="copy data account_user to org_user"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Skipping migration condition not fulfilled” logger=migrator id="copy data account_user to org_user"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Starting plugin search” logger=plugins
t=2017-05-26T17:54:52+0100 lvl=info msg=“Registering plugin” logger=plugins name=Zabbix
t=2017-05-26T17:54:52+0100 lvl=info msg=“Registering plugin” logger=plugins name="Zabbix Triggers"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Registering plugin” logger=plugins name=Zabbix
t=2017-05-26T17:54:52+0100 lvl=info msg=“Registering plugin” logger=plugins name="Pie Chart"
t=2017-05-26T17:54:52+0100 lvl=info msg="Initializing Stream Manager"
t=2017-05-26T17:54:52+0100 lvl=info msg=“Initializing HTTP Server” logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=
t=2017-05-26T17:54:52+0100 lvl=info msg=“Initializing Alerting” logger=alerting.engine
t=2017-05-26T17:54:52+0100 lvl=info msg=“Initializing CleanUpService” logger=cleanup
t=2017-05-26T17:56:04+0100 lvl=info msg=“Sending notification” logger=alerting.notifier type=email id=0 isDefault=false
t=2017-05-26T17:56:04+0100 lvl=info msg=“Sending alert notification to” logger=alerting.notifier.email addresses=[me@domain.tld]
t=2017-05-26T17:56:04+0100 lvl=eror msg=“Failed to send alert notification email” logger=alerting.notifier.email error="SMTP not configured, check your grafana.ini config file’s [smtp] section."
t=2017-05-26T17:56:04+0100 lvl=eror msg=“SMTP not configured, check your grafana.ini config file’s [smtp] section.” logger=context userId=2 orgId=1 uname=user error=“SMTP not configured, check your grafana.ini config file’s [smtp] section.”

Thanks!
Liam.

Semicolon at the start of a line in the ini file means it is commented out. So remove the semicolons and it should work.

1 Like

Amazing!

Thanks.

Used to #'s as comments. Didn’t know ;'s were comments in ini’s!

Liam.

Both semicolon and # are used as comment symbol in INI files: https://en.wikipedia.org/wiki/INI_file#Comments and https://en.wikipedia.org/wiki/INI_file#Comments_2

Hi Danielle,

We are facing the same problem we are unable to configure SMTP in Grafana Recent version.
Please find the code below we have used for configuring.

[smtp]
enabled = true
host =hostname
user = "abc@mail.com"

If the password contains # or ; you have to wrap it with trippel quotes. Ex “”"#password;"""

password = “abcd”
;cert_file =
;key_file =
skip_verify = false
from_address = "abc@mail.com"
from_name = NoReply

EHLO identity in SMTP dialog (defaults to instance_name)

;ehlo_identity = dashboard.example.com

[emails]
welcome_email_on_sign_up = true

Thanks in advance

Regards,
Puneet Agarwal

Hello

I tried to configure the smtp in localhost, the mail goes well but the problem that I do not find in the mailbox recipient?

enabled = true
host = localhost:25

Regards