-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMTP email out does not work #128
Comments
Are there any errors in the logs? Can you share your TICKscript that can reproduce the behavior? I can verify it works for simple cases on my machine but you are not the first to report issues with SMTP alerts. Any details you can give will be very beneficial. |
Mine is a very simple case as well. I define it as: kapacitor define -name press_alert -type stream -tick press_alert.tick -dbrp metrics.default And my alert log snippet shows: It doesn't seem to log any errors at debug or at info level. If I were to disable the SMTP at the kapacitor settings, it would log an error saying I need to enable it. Once I enable, it acts like everything is working good. Please let me know what other information I can provide, Thanks! |
I tested this with gomail as stand alone and it works. I am also seeing alerts being generated at alerts.log, so I am pressed to believe that this is a bug. I am testing it with the fake SMTP server listening on port 2225.
the go code that works:
m := gomail.NewMessage()
m.SetHeader("From", "a@example.com")
m.SetHeader("To", "b@example.com")
m.SetHeader("Subject", "Hello!")
m.SetBody("text/html", "Hello!")
d := gomail.NewPlainDialer("localhost", 2225, "", "")
// Send the email to Bob, Cora and Dan.
if err := d.DialAndSend(m); err != nil {
panic(err)
}
And here is my SMTP setting in kapacitor:
[smtp]
enabled = true
host = "localhost"
port = 2225
username = ""
password = ""
no-verify = true
global = false
from = "test@test.com"
to = ["alert@alert.com"]
idle-timeout = "300s"
The text was updated successfully, but these errors were encountered: