I'm trying to setup Grafana alerting. In testing out email functionality, email sending is failing due to this error:
Failed to send test alert.: failed to send notification to email addresses: mike@example.com: gomail: could not send email 1: 553 5.7.1 admin@grafana.localhost: Sender address rejected: not owned by user grafana@example.com
I have these config values in the Env Var section:
My understanding is that setting GF_FROM_ADDRESS should override the sending email. But that does not seem to be the case. This is further verified going into the logs:
[22:00:54] INFO: Setting GF_SMTP_ENABLED to true
[22:00:54] INFO: Setting GF_SMTP_HOST to mail.example.com:587
[22:00:54] INFO: Setting GF_SMTP_USER to grafana@example.com
[22:00:54] INFO: Setting GF_SMTP_PASSWORD to password
[22:00:54] INFO: Setting GF_FROM_ADDRESS to grafana@example.com
[22:00:54] INFO: Setting GF_SMTP_SKIP_VERIFY to true
Grafana server is running with elevated privileges. This is not recommended
logger=settings t=2023-07-17T22:00:54.870877028-07:00 level=info msg="Starting Grafana" version=10.0.2 commit=b2bbe10fbc branch=HEAD compiled=2023-06-30T01:34:22-07:00
logger=settings t=2023-07-17T22:00:54.871282792-07:00 level=warn msg="\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead."
logger=settings t=2023-07-17T22:00:54.871382749-07:00 level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
logger=settings t=2023-07-17T22:00:54.871422349-07:00 level=info msg="Config loaded from" file=/etc/grafana/grafana.ini
logger=settings t=2023-07-17T22:00:54.871465774-07:00 level=info msg="Config overridden from Environment variable" var="GF_SMTP_ENABLED=true"
logger=settings t=2023-07-17T22:00:54.871502243-07:00 level=info msg="Config overridden from Environment variable" var="GF_SMTP_HOST=mail.example.com:587"
logger=settings t=2023-07-17T22:00:54.87153857-07:00 level=info msg="Config overridden from Environment variable" var="GF_SMTP_USER=grafana@example.com"
logger=settings t=2023-07-17T22:00:54.871601803-07:00 level=info msg="Config overridden from Environment variable" var="GF_SMTP_PASSWORD=*********"
logger=settings t=2023-07-17T22:00:54.871642775-07:00 level=info msg="Config overridden from Environment variable" var="GF_SMTP_SKIP_VERIFY=true"
There is no "Config overridden from Environment variable" line for GF_FROM_ADDRESS
Expected behavior
I'd like the from email address to be overridden by env vrs.
Actual behavior
The email address still uses the default address.
Steps to reproduce
Configure an email address with authentication without an alias and try sending a test email.
Proposed changes
If someone specifies an GF_FROM_ADDRESS env var, that should override the default config value.
Problem/Motivation
I'm trying to setup Grafana alerting. In testing out email functionality, email sending is failing due to this error:
I have these config values in the Env Var section:
My understanding is that setting
GF_FROM_ADDRESS
should override the sending email. But that does not seem to be the case. This is further verified going into the logs:There is no
"Config overridden from Environment variable"
line forGF_FROM_ADDRESS
Expected behavior
I'd like the from email address to be overridden by env vrs.
Actual behavior
The email address still uses the default address.
Steps to reproduce
Configure an email address with authentication without an alias and try sending a test email.
Proposed changes
If someone specifies an
GF_FROM_ADDRESS
env var, that should override the default config value.