Unable to set SMTP `to` via environment variable

Exactly like this github issue: https://github.com/influxdata/kapacitor/issues/1280

Using any of the following environment variables, I am unable to send SMTP alerts:

KAPACITOR_SMTP_TO_0=alerts@exmple.com
KAPACITOR_SMTP_TO=alerts@exmple.com
KAPACITOR_SMTP_TO=["alerts@exmple.com"]

The logs say not sending email, no recipients defined.

When I specify an address in the .email() in the script it works fine and I get the email. Kapacitor 1.2.1

Am I missing something?

workaround is simply defining placeholder values in configuration file

@sofuture When you have a solution for that would you mind posting it here? In the above issue it sounds like all you need to do is set [smtp] to = ["foo@bar.com"] then setting with ENV: KAPACITOR_SMTP_TO_0=bar@foo.com is that right?

Yes, exactly. The GH issue for actually fixing this is: https://github.com/influxdata/kapacitor/issues/1344

1 Like