Skip to content
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

sendmail not working #1471

Open
estezz opened this issue Jul 7, 2017 · 6 comments
Open

sendmail not working #1471

estezz opened this issue Jul 7, 2017 · 6 comments

Comments

@estezz
Copy link

estezz commented Jul 7, 2017

I have configured kapacitor SMTP but not getting any emails. my kapacitor.conf is attached. I am using kapacitor 1.3.1 also tried 1.2 sendmail works from the command line, and I wrote a java app to test sendmail and that works fine. I will attach the java code as example.
TestSmtp.txt

kapacitor.log
[smtp] 2017/07/07 21:54:17 E! error connecting to SMTP server 535 5.7.0 authentication failed

mail.log
Jul 7 21:54:17 ip-10-201-108-164 sm-mta[20842]: v67LsHjX020842: localhost [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA-v4
kapacitor.txt

@adityacs
Copy link
Contributor

@estezz Is kapacitor installed on the same host where your mail server is installed? Is it TLS enabled?
could you please try with no-verify=true?

@estezz
Copy link
Author

estezz commented Aug 29, 2017

OK so to take the local system out of the equation I am now using AWS SES. and see in the kapacitor.log
[smtp] 2017/08/29 19:07:47 E! error connecting to SMTP server gomail: unencrypted connection

not sure how to fix this. I am actively using the SES email in a Java application. I have tried all the ports available in the SES configuration. Here is what the AWS documentation says

Server Name: email-smtp.us-east-1.amazonaws.com
Port: 25, 465 or 587
Use Transport Layer Security (TLS): Yes
Authentication: Your SMTP credentials - see below.

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp.html

--[smtp]
/# Configure an SMTP email server
/# Will use TLS and authentication if possible
/# Only necessary for sending emails from alerts.
enabled = true
host = "email-smtp.us-east-1.amazonaws.com"
port = 465
username = "asdf"
password = "sdfsdfg"
/# From address for outgoing mail
from = "somethadsf@pearson.com"
/# List of default To addresses.
/# to = ["oncall@example.com"]

/ # Skip TLS certificate verify when connecting to SMTP server
no-verify = false
/# Close idle connections after timeout
idle-timeout = "30s"

/ # If true the all alerts will be sent via Email
/# without explicitly marking them in the TICKscript.
global = false
/ # Only applies if global is true.
/# Sets all alerts in state-changes-only mode,
/ # meaning alerts will only be sent if the alert state changes.
state-changes-only = false

slashes just added to overcome markdown

@avimar
Copy link

avimar commented Oct 19, 2017

I'm now trying amazon SES and getting the same error.

I can't use the configuration file it seems because I set the settings in the chronograf dashboard. Any way to clear that?

Any way to simply use the local sendmail, which I've had experience configuring before? or just using it and hoping it works?

I'm struggling to get alerts outward from kapacitor!

@mcfedr
Copy link

mcfedr commented Apr 19, 2018

I've been trying to get SMTP via SES working, also with no luck... wondering if its a TLS issue

@RobHoman
Copy link

(N.B. I got to the bottom of it all, so I just scrapped my prior comments in order to rewrite my findings clearly.)

Perhaps I'm late to the party, but I struggled with Amazon SES for a while before finally nailing down the source of my particular issue: the "from" address also needs to be a "verified" email address in Amazon SES.

I was able to do this troubleshooting by POSTing to Kapacitor's /kapacitor/v1/service-tests/smtp resource. Example:

curl -X POST "localhost:9092/kapacitor/v1/service-tests/smtp" -d '{"body": "hi", "subject": "hi", "to": ["person@example.com"]}'
{"success":true,"message":""}

In Kapacitor logs, I found this line:

ts=2018-08-22T19:14:12.613Z lvl=error msg="error sending" service=smtp err="gomail: could not send email 1: 554 Message rejected: Email address is not verified. The following identities failed the check in region US-WEST-2: MY-UNVERIFIED-FROM-ADDRESS@example.com"

Hope that helps!

@xkfen
Copy link

xkfen commented Sep 3, 2019

port: 25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants