How to Connect ECE installation with local SMTP Server

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

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

[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

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

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....

1 Like

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.

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