# Watcher EmailAction using Outlook account throws SMTPAddressFailedException

**URL:** <https://discuss.elastic.co/t/watcher-emailaction-using-outlook-account-throws-smtpaddressfailedexception/226624>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting, docker\
**Created:** [April 6, 2020, 6:09am UTC](https://discuss.elastic.co/t/watcher-emailaction-using-outlook-account-throws-smtpaddressfailedexception/226624 "2020-04-06T06:09:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prathibha](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@prathibha](https://discuss.elastic.co/u/prathibha)\
**Post date:** [April 6, 2020, 6:09am UTC](https://discuss.elastic.co/t/watcher-emailaction-using-outlook-account-throws-smtpaddressfailedexception/226624/1 "2020-04-06T06:09:47Z")

</div>

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

```auto
{"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

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 6, 2020, 2:07pm UTC](https://discuss.elastic.co/t/watcher-emailaction-using-outlook-account-throws-smtpaddressfailedexception/226624/2 "2020-04-06T14:07:23Z")

</div>

> [@prathibha](#):
>
> "Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.8 [elasticsearch@7ccb62607604](mailto:elasticsearch@7ccb62607604): Sender address rejected: Domain not found",

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?

---

<div class="post-metadata">

**Author:** ![prathibha](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@prathibha](https://discuss.elastic.co/u/prathibha)\
**Post date:** [April 6, 2020, 2:55pm UTC](https://discuss.elastic.co/t/watcher-emailaction-using-outlook-account-throws-smtpaddressfailedexception/226624/3 "2020-04-06T14:55:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 7, 2020, 1:43pm UTC](https://discuss.elastic.co/t/watcher-emailaction-using-outlook-account-throws-smtpaddressfailedexception/226624/4 "2020-04-07T13:43:54Z")

</div>

maybe the output from the [Execute Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/watcher-api-execute-watch.html) or from the watch history can help to debug this further, as this output contains some more detailed information.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 5, 2020, 1:44pm UTC](https://discuss.elastic.co/t/watcher-emailaction-using-outlook-account-throws-smtpaddressfailedexception/226624/5 "2020-05-05T13:44:12Z")

</div>

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