Ignore unconfirmed accounts when sending mails in elastic watchers


(dina) #1

I am using elastic search watcher, and send notifications via email.
I have requested whitelisting for all workers in my company.
I confirmed my own email (can't confirm for other people.

here is my action:

  "actions" : {
    "email_administrator" : {
      "email" : {
        "to" : ["bob@gmail.com", "jim@gmail.com", "jay@gmail.com"],
        "subject" : "errors and warnings in last 24 hours",
        "body" : "hi",
        "priority" : "high"
      }
    }
  }

but i do not receive any email
when i get the watcher status
curl -XPOST 'https://myelatic.us-east-1.aws.found.io:9243/.watches/_search?pretty' -H 'Content-Type: application/json' -d'{"size" : 100}'

I get:

 "last_execution" : {
         "reason" : "MessagingException[failed to send email with subject [errors and warnings in last 24 hours] via account [work]]; nested: SendFailedException[Invalid Addresses]; nested: SMTPAddressFailedException[554 5.7.1 <bob@gmail.com>: Recipient address rejected: Access denied\n]; ",
         "timestamp" : "2017-08-21T12:10:17.869Z",
          "successful" : false
 }

since bob hasn't confirmed his email,
so when I remove bob from the list, it works well and I receive an email,

my question is: how can I make it send emails to all accounts which are confirmed, and ignore unconfirmed accounts, since I cannot force confirmations of accounts


(Thiago Souza) #2

This is not possible. Elasticsearch can not know if an e-mail account is confirmed or not because it sends e-mail messages using standard SMTP protocol, which does not exposes such information.


(dina) #3

Elasticsearch can not know if an e-mail account is confirmed or not

ok,

but my point is that if one email is not confirmed - elastic watcher will fail sending to all recipients , also confirmed emails,
why?


(Thiago Souza) #4

This is not watcher's fault and it depends on the SMTP server itself. Watcher will send a single e-mail with all recipients separated by ; to the SMTP server. How the SMTP server will handle a failing e-mail address, is up to it.

One workaround is using more than one e-mail action. One per e-mail address.


(system) #5

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