Watcher EmailAction using Outlook account throws SMTPAddressFailedException

Hello Team ,

I am getting the following exception while configuring a watcher using outlook account. I am using 7.4 version for all components like filebeat, logstash , kibana and elastic and all these components are running as docker-compose services. Please find the exception occurred while trying to send testmail from kibana

{"type": "deprecation", "timestamp": "2020-04-06T05:49:38,149Z", "level": "WARN", "component": "o.e.d.s.a.b.h.DateHistogramAggregationBuilder", "cluster.name": "elasticsearch-cluster", "node.name": "7ccb62607604", "message": "[interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.", "cluster.uuid": "-R2t1aWKR260F35zpjWkYA", "node.id": "vqTGwlbASkuS8H-xWpJ3Iw"  }
{"type": "server", "timestamp": "2020-04-06T05:50:00,310Z", "level": "ERROR", "component": "o.e.x.w.a.e.ExecutableEmailAction", "cluster.name": "elasticsearch-cluster", "node.name": "7ccb62607604", "message": "failed to execute action [_inlined_/email_1]", "cluster.uuid": "-R2t1aWKR260F35zpjWkYA", "node.id": "vqTGwlbASkuS8H-xWpJ3Iw" ,
"stacktrace": ["javax.mail.MessagingException: failed to send email with subject [Watch [Test] has exceeded the threshold] via account [outlook_account]",
"at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:171) ~[?:?]",
"at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:163) ~[?:?]",
"at org.elasticsearch.xpack.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:72) ~[?:?]",
"at org.elasticsearch.xpack.core.watcher.actions.ActionWrapper.execute(ActionWrapper.java:164) [x-pack-core-7.4.0.jar:7.4.0]",
"at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:527) [x-pack-watcher-7.4.0.jar:7.4.0]",
"at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:320) [x-pack-watcher-7.4.0.jar:7.4.0]",
"at org.elasticsearch.xpack.watcher.transport.actions.execute.TransportExecuteWatchAction$1.doRun(TransportExecuteWatchAction.java:159) [x-pack-watcher-7.4.0.jar:7.4.0]",
"at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.4.0.jar:7.4.0]",
"at org.elasticsearch.xpack.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:620) [x-pack-watcher-7.4.0.jar:7.4.0]",
"at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:703) [elasticsearch-7.4.0.jar:7.4.0]",
"at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]",
"at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]",
"at java.lang.Thread.run(Thread.java:830) [?:?]",
"Caused by: javax.mail.SendFailedException: Invalid Addresses",
"at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:2055) ~[?:?]",
"at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1277) ~[?:?]",
"at org.elasticsearch.xpack.watcher.notification.email.Account.send(Account.java:143) ~[?:?]",
"at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:169) ~[?:?]",
"... 12 more",
"Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.8 <elasticsearch@7ccb62607604>: Sender address rejected: Domain not found",
"",
"at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1908) ~[?:?]",
"at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1277) ~[?:?]",
"at org.elasticsearch.xpack.watcher.notification.email.Account.send(Account.java:143) ~[?:?]",
"at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:169) ~[?:?]",
"... 12 more"] }

When I tried to send email through telnet using same combination of accounts , its worked for me.
I have used below configuration for elasticsearch.yml

cluster.name: elasticsearch-cluster
network.host: 0.0.0.0
http.host: 0.0.0.0
xpack.notification.email.account:
outlook_account:
profile: outlook
smtp:
auth: false
starttls.enable: false
host: hostname
port: 25
user: email-id

Kindly provide suggestion on this to solve this. Please let me know if i need to provide more info on this to troublrshoot this.

Thanks
Prathibha

The exception states that the mail server complains about an invalid sender address. Can you set a proper from address in the watch or in the smtp account setup?

Thanks for checking this. I have provided proper sender and receiver address over here while configuring . I tried to send email using telnet with the same set of accounts which worked for me.

maybe the output from the Execute Watch API or from the watch history can help to debug this further, as this output contains some more detailed information.

Thanks!

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