Unable to set SMTP `to` via environment variable

Exactly like this github issue: Docker ENV config for SMTP TO value · Issue #1280 · influxdata/kapacitor · GitHub

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: Cant extend array or object configuration via environment variables · Issue #1344 · influxdata/kapacitor · GitHub

1 Like