SMTP doesn't work

Hi, I’m deploying grafana using docker compose. Grafana settings are in /usr/share/grafana/conf/default.ini. In deafult.ini SMTP settings are updated and email provider is AWS but Grafana Dashboard says SMTP settings are not configured while they are.
Here is the SMTP block:

#################################### SMTP / Emailing ##########################
#[smtp]
enabled = true
host = xxxxxxxxaws.com:587
user = XXXXXX
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password = XXXXXXXX
;cert_file =
;key_file =
skip_verify = true 
from_address = grafana@hostedzone.com
from_name = Grafana
# EHLO identity in SMTP dialog (defaults to instance_name)
;ehlo_identity = dashboard.example.com
# SMTP startTLS policy (defaults to 'OpportunisticStartTLS')
;startTLS_policy = NoStartTLS

#[emails]
;welcome_email_on_sign_up = false
;templates_pattern = "emails/*.html", "emails/*.txt"
;content_types = text/html

Please comment what is wrong here and what needs to be done in order to start working as documentation says.

Any line in the grafana.ini file starting with a # or a ; is treated as a comment.

So change your:
#[smtp]
to
[smtp]

Beyond that I can’t help as I don’t do email alerting via Grafana, I use Prometheus directly for alerting.

1 Like

The correct name is defaults.ini not default.ini.

I accepted the above mentioned suggestion and changed skip_verify from true to false. Deployed and got it working. Below is the working SMTP block:

[smtp]
enabled = true
host = xxxxxxxxaws.com:587
user = XXXXXX
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password = XXXXXXXX
;cert_file =
;key_file =
skip_verify = false 
from_address = grafana@hostedzone.com
from_name = Grafana
# EHLO identity in SMTP dialog (defaults to instance_name)
ehlo_identity = dashboard.example.com
# SMTP startTLS policy (defaults to 'OpportunisticStartTLS')
;startTLS_policy = NoStartTLS

#[emails]
;welcome_email_on_sign_up = false
;templates_pattern = "emails/*.html", "emails/*.txt"
;content_types = text/html