This line looks suspicious for me: <div><br></div><div>Exception reading response;<br> nested exception is:<br>java.net.SocketTimeoutException: Read timed out</div><div><br></div><div>It looks like a connectivity issue with your SMTP server.</div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 24, 2016, 4:26 PM LEONARDO NUNES <<a href="mailto:leo.nunes@gjccorp.com.br">leo.nunes@gjccorp.com.br</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:16px;font-family:Calibri,sans-serif">
<div>
<div>
<div>Hi, i'm getting the error below when sending the verification email. An error page is shown, but I always receive the email.</div>
<div>Most of the times it works fine, but sometimes it returns the error.</div>
<div>Around 7 out of 10 times it works.</div>
<div>I use the same SMTP host for other applications and I don't have this problem.</div>
<div><br>
</div>
<div>For the Email configuration I only have Host and From configured.</div>
<div><br>
</div>
<div>Is there a way to configure the timeout?</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>15:51:47,736 ERROR [org.keycloak.forms.login.freemarker.FreeMarkerLoginFormsProvider] (default task-4) Failed to send verification email: org.keycloak.email.EmailException: Failed to template email</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:179)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:150)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.sendVerifyEmail(FreeMarkerEmailTemplateProvider.java:146)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.forms.login.freemarker.FreeMarkerLoginFormsProvider.createResponse(FreeMarkerLoginFormsProvider.java:156)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.authentication.requiredactions.VerifyEmail.requiredActionChallenge(VerifyEmail.java:73)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.services.managers.AuthenticationManager.executionActions(AuthenticationManager.java:573)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.services.managers.AuthenticationManager.actionRequired(AuthenticationManager.java:504)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.services.managers.AuthenticationManager.nextActionAfterAuthentication(AuthenticationManager.java:426)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.services.resources.LoginActionsService$Checks.verifyRequiredAction(LoginActionsService.java:302)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.services.resources.LoginActionsService.processRequireAction(LoginActionsService.java:856)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.services.resources.LoginActionsService.requiredActionGET(LoginActionsService.java:849)</div>
<div><span style="white-space:pre-wrap"></span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div>
<div><span style="white-space:pre-wrap"></span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div>
<div><span style="white-space:pre-wrap"></span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div>
<div><span style="white-space:pre-wrap"></span>at java.lang.reflect.Method.invoke(Method.java:497)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:138)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:101)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)</div>
<div><span style="white-space:pre-wrap"></span>at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)</div>
<div><span style="white-space:pre-wrap"></span>at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:88)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)</div>
<div><span style="white-space:pre-wrap"></span>at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div>
<div><span style="white-space:pre-wrap"></span>at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)</div>
<div><span style="white-space:pre-wrap"></span>at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)</div>
<div><span style="white-space:pre-wrap"></span>at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)</div>
<div><span style="white-space:pre-wrap"></span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)</div>
<div><span style="white-space:pre-wrap"></span>at java.lang.Thread.run(Thread.java:745)</div>
<div>Caused by: org.keycloak.email.EmailException: javax.mail.MessagingException: Exception reading response;</div>
<div> nested exception is:</div>
<div><span style="white-space:pre-wrap"></span>java.net.SocketTimeoutException: Read timed out</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.email.DefaultEmailSenderProvider.send(DefaultEmailSenderProvider.java:128)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:185)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:177)</div>
<div><span style="white-space:pre-wrap"></span>... 57 more</div>
<div>Caused by: javax.mail.MessagingException: Exception reading response;</div>
<div> nested exception is:</div>
<div><span style="white-space:pre-wrap"></span>java.net.SocketTimeoutException: Read timed out</div>
<div><span style="white-space:pre-wrap"></span>at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2351)</div>
<div><span style="white-space:pre-wrap"></span>at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2228)</div>
<div><span style="white-space:pre-wrap"></span>at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:2027)</div>
<div><span style="white-space:pre-wrap"></span>at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1242)</div>
<div><span style="white-space:pre-wrap"></span>at org.keycloak.email.DefaultEmailSenderProvider.send(DefaultEmailSenderProvider.java:125)</div>
<div><span style="white-space:pre-wrap"></span>... 59 more</div>
<div>Caused by: java.net.SocketTimeoutException: Read timed out</div>
<div><span style="white-space:pre-wrap"></span>at java.net.SocketInputStream.socketRead0(Native Method)</div>
<div><span style="white-space:pre-wrap"></span>at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)</div>
<div><span style="white-space:pre-wrap"></span>at java.net.SocketInputStream.read(SocketInputStream.java:170)</div>
<div><span style="white-space:pre-wrap"></span>at java.net.SocketInputStream.read(SocketInputStream.java:141)</div>
<div><span style="white-space:pre-wrap"></span>at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:124)</div>
<div><span style="white-space:pre-wrap"></span>at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)</div>
<div><span style="white-space:pre-wrap"></span>at java.io.BufferedInputStream.read(BufferedInputStream.java:265)</div>
<div><span style="white-space:pre-wrap"></span>at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:92)</div>
<div><span style="white-space:pre-wrap"></span>at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2331)</div>
<div><span style="white-space:pre-wrap"></span>... 63 more</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div>-- </div>
<div><br>
</div>
</div>
<div>
<div>Att,</div>
<div><b>Leonardo Nunes</b></div>
<div>Analista de Sistemas</div>
<div><a href="mailto:leo.nunes@gjccorp.com.br" target="_blank">leo.nunes@gjccorp.com.br</a></div>
<div>Skype: leonardo.puc</div>
<div>+55 (62) 3250-1462</div>
<div><br>
</div>
<div><b>Grupo Jaime Câmara</b></div>
<div><a>www.gjccorp.com.br</a></div>
</div>
</div>
</div>
</div>
<hr style="min-height:1px;color:#c4c4c4">
<div style="font-family:Arial;color:#848484;font-size:11px"><i>Esta mensagem pode conter informação confidencial e/ou privilegiada. Se você não for o destinatário ou a pessoa autorizada a receber esta mensagem, não poderá usar, copiar ou divulgar as informações
nela contidas ou tomar qualquer ação baseada nessas informações. Se você recebeu esta mensagem por engano, por favor avise imediatamente o remetente, respondendo o e-mail e em seguida apague-o. Agradecemos sua cooperação.
<br>
<br>
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have
received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation<i></i></i></div>
</div>
_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></blockquote></div></div>