# How to Connect ECE installation with local SMTP Server

**URL:** <https://discuss.elastic.co/t/how-to-connect-ece-installation-with-local-smtp-server/170970>\
**Category:** Elastic Cloud Enterprise (ECE)\
**Created:** [March 5, 2019, 6:23pm UTC](https://discuss.elastic.co/t/how-to-connect-ece-installation-with-local-smtp-server/170970 "2019-03-05T18:23:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmazza](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@gmazza](https://discuss.elastic.co/u/gmazza)\
**Post date:** [March 5, 2019, 6:23pm UTC](https://discuss.elastic.co/t/how-to-connect-ece-installation-with-local-smtp-server/170970/1 "2019-03-05T18:23:01Z")

</div>

I am trying to connect ECE to our local SMTP server so Elastic can send emails

I added the following configuration to the elastic deployment

```auto
xpack.notification.email.account:
    exchange_account:
        profile: outlook
        email_defaults:
            from: ece-tst@noreply.org
        smtp:
            auth: false
            starttls.enable: false
            host: smtpserver.chsys.org
            port: 25
            user: ece-tst@noreply.org

```

Well It does not send emails i get these errors on the logs

```auto
[2019-03-05T14:27:09,454][ERROR][org.elasticsearch.xpack.watcher.actions.email.ExecutableEmailAction] [instance-0000000024] failed to execute action [_inlined_/email_1]
javax.mail.MessagingException: failed to send email with subject [Watch [HL7-Suspended] has exceeded the threshold] via account [work]
	at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:154) ~[?:?]
	at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:146) ~[?:?]
	at org.elasticsearch.xpack.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:72) ~[?:?]
	at org.elasticsearch.xpack.core.watcher.actions.ActionWrapper.execute(ActionWrapper.java:144) [x-pack-core-6.6.1.jar:6.6.1]
	at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:454) [x-pack-watcher-6.6.1.jar:6.6.1]
	at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:294) [x-pack-watcher-6.6.1.jar:6.6.1]
	at org.elasticsearch.xpack.watcher.transport.actions.execute.TransportExecuteWatchAction$1.doRun(TransportExecuteWatchAction.java:154) [x-pack-watcher-6.6.1.jar:6.6.1]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.6.1.jar:6.6.1]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_144]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_144]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:660) [elasticsearch-6.6.1.jar:6.6.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: dockerhost, 10025; timeout 120000
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2209) ~[?:?]
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:740) ~[?:?]
	at javax.mail.Service.connect(Service.java:366) ~[?:?]
	at org.elasticsearch.xpack.watcher.notification.email.Account.lambda$executeConnect$2(Account.java:159) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_144]
	at org.elasticsearch.xpack.watcher.notification.email.Account.executeConnect(Account.java:158) ~[?:?]
	at org.elasticsearch.xpack.watcher.notification.email.Account.send(Account.java:117) ~[?:?]
	at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:152) ~[?:?]
	... 13 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_144]
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_144]
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_144]
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_144]
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_144]
	at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_144]
	at com.sun.mail.util.WriteTimeoutSocket.connect(WriteTimeoutSocket.java:115) ~[?:?]
	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:357) ~[?:?]
	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238) ~[?:?]
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2175) ~[?:?]
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:740) ~[?:?]
	at javax.mail.Service.connect(Service.java:366) ~[?:?]
	at org.elasticsearch.xpack.watcher.notification.email.Account.lambda$executeConnect$2(Account.java:159) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_144]
	at org.elasticsearch.xpack.watcher.notification.email.Account.executeConnect(Account.java:158) ~[?:?]
	at org.elasticsearch.xpack.watcher.notification.email.Account.send(Account.java:117) ~[?:?]
	at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:152) ~[?:?]
	... 13 more

```

---

<div class="post-metadata">

**Author:** ![Alex\_Piggott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_piggott/32/11053_2.png) [@Alex\_Piggott](https://discuss.elastic.co/u/Alex_Piggott)\
**Post date:** [March 5, 2019, 6:58pm UTC](https://discuss.elastic.co/t/how-to-connect-ece-installation-with-local-smtp-server/170970/2 "2019-03-05T18:58:47Z")

</div>

> [@gmazza](#):
>
> `Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: dockerhost, 10025; timeout 120000`

This is a legacy default value hardwired in the YAML template as:

```auto
xpack.notification.email.account:
    work:
        email_defaults:
            from: 'Watcher Alert <noreply@watcheralert.found.io>'
        smtp:
            host: dockerhost
            port: 10025

```

So ... try changing `exchange_account` to `work` in the plan and see if that fixes it. We may need to fix our docs if that's the problem....

---

<div class="post-metadata">

**Author:** ![gmazza](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@gmazza](https://discuss.elastic.co/u/gmazza)\
**Post date:** [March 5, 2019, 8:04pm UTC](https://discuss.elastic.co/t/how-to-connect-ece-installation-with-local-smtp-server/170970/3 "2019-03-05T20:04:11Z")

</div>

This fixed the problem.  
You need to specify in documentation to use the work account on the yam configuration for email.

Now I got another issue with the APM servers when I applied the rolling configuration change but I will open another topic for that.

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:** [March 19, 2019, 8:04pm UTC](https://discuss.elastic.co/t/how-to-connect-ece-installation-with-local-smtp-server/170970/4 "2019-03-19T20:04:11Z")

</div>

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