Email sending failed on my watcher alert


I have configured my watcher in my ELK stack 7.6.0 installed that in my Ubuntu 18.04 LTS.

my elasticsearch.yml config.

xpack.watcher.enabled: true
        profile: gmail
            auth: true
            starttls.enable: true
            port: 587
            user: m****

I have already had my gmail app password and inputted using this command:

/usr/share/elasticsearch/bin/elasticsearch-keystore add

When I tried to send test email I got this error Failed to send email to

and got this on elasticsearch logs:

Caused by: javax.mail.MessagingException: can't determine local email address

Anyone can help me please to fixed this issue. Thanks!

1 Like

@mark.quilates - This issue could be related to this Discuss topic. In a nutshell, you would need to set the from parameter in the email action in your watch implementation. You could also use the email_defaults parameter in the email account configuration in the elasticsearch.yml file.

I hope that helps.

Hi @ropc,

Thank you for your replied. But, I have already configured the "To" parameter in the Kibana GUI. Also used the gmail default setting. However still not works.

Please take a look on my screenshot. Still got, "Failed to send email to" Error.

@mark.quilates - When you click on the Send test email and observe the Failed to send email to... error message, can you check the Elasticsearch logs? There should be a corresponding error message related to this email action. Please provide the error message details observed in Elasticsearch logs.

Hi @ropc,

That one I got i my elasticsearch log.

Caused by: javax.mail.MessagingException: can't determine local email address

I don't know why its happening because I've already configured the default setting based on the documentation.

@mark.quilates - I would appreciate if you can send the entire stack trace message from the Elasticsearch logs. That might give us more information about the actual problem.


  • assuming that your Gmail account has a default from email address set-up, then it should work? Unless there is something unexpected happening there (entire logs would help...).
  • you could try to configure the email account with email_defaults and from parameters and see if the behavior is different.

Hi @ropc,

Its working now. Thank you very much for your help.

I just added the email_defaults and from on my elasticsearch email config. Thanks again!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.