Mail server does not work, Please Help me..!
Asked by Riri Rustandi:

Hi,

Mail server isn't working,

I have below settings

![Mail.png](/t5/image/serverpage/image-id/23205i6C2641A309B05970/image-size/large?v=v2&px=999 "Mail.png")

Then tried to test the email but got the error as in the logs below.

An error has occurred with sending the test email:  
com.atlassian.mail.MailException: javax.mail.MessagingException: Exception reading response;  
nested exception is:  
java.net.SocketTimeoutException: Read timed out  
at com.atlassian.confluence.jmx.JmxSMTPMailServer.doSendWithMessageIdSupport(JmxSMTPMailServer.java:120)  
at com.atlassian.confluence.jmx.JmxSMTPMailServer.send(JmxSMTPMailServer.java:79)  
at com.atlassian.confluence.admin.actions.mail.SendTestEmailAction.execute(SendTestEmailAction.java:57)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)  
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:33)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.xwork.interceptors.XsrfTokenInterceptor.intercept(XsrfTokenInterceptor.java:100)  
at com.atlassian.confluence.xwork.ConfluenceXsrfTokenInterceptor.intercept(ConfluenceXsrfTokenInterceptor.java:29)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.security.interceptors.CaptchaInterceptor.intercept(CaptchaInterceptor.java:42)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.core.ConfluenceLicenseInterceptor.intercept(ConfluenceLicenseInterceptor.java:66)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.validation.MessageHolderInterceptor.intercept(MessageHolderInterceptor.java:37)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.util.LoggingContextInterceptor.intercept(LoggingContextInterceptor.java:44)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.core.CancellingInterceptor.intercept(CancellingInterceptor.java:21)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.xwork.HttpMethodValidationInterceptor.intercept(HttpMethodValidationInterceptor.java:68)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.security.websudo.WebSudoInterceptor.intercept(WebSudoInterceptor.java:64)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.themes.ThemeContextInterceptor.intercept(ThemeContextInterceptor.java:42)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.security.actions.PermissionCheckInterceptor.intercept(PermissionCheckInterceptor.java:95)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.atlassian.confluence.setup.webwork.BootstrapAwareInterceptor.intercept(BootstrapAwareInterceptor.java:21)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)  
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)  
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)  
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)  
at java.lang.Thread.run(Thread.java:748)  
Caused by: javax.mail.MessagingException: Exception reading response;  
nested exception is:  
java.net.SocketTimeoutException: Read timed out  
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2210)  
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1950)  
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)  
at javax.mail.Service.connect(Service.java:317)  
at javax.mail.Service.connect(Service.java:176)  
at javax.mail.Service.connect(Service.java:125)  
at com.atlassian.confluence.jmx.JmxSMTPMailServer.doSendWithMessageIdSupport(JmxSMTPMailServer.java:102)  
... 371 more  
Caused by: java.net.SocketTimeoutException: Read timed out  
at java.net.SocketInputStream.socketRead0(Native Method)  
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)  
at java.net.SocketInputStream.read(SocketInputStream.java:171)  
at java.net.SocketInputStream.read(SocketInputStream.java:141)  
at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110)  
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)  
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)  
at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:89)  
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2188)  
... 377 more

Please help me


Answers:
author: Yogesh Mude
body: Hi [@Riri Rustandi](/t5/user/viewprofilepage/user-id/1232276)

Please have look at the below articles for more information

<https://confluence.atlassian.com/confkb/confluence-unable-to-send-email-through-gmail-server-due-to-read-timed-out-763003262.html>

<https://confluence.atlassian.com/jirakb/read-timed-out-error-when-sending-outbound-mail-from-jira-applications-240193685.html>

comments: author: Riri Rustandi
body: ++**solved**++

Thank you very much [@Yogesh Mude](/t5/user/viewprofilepage/user-id/1169678)

evidently, confluence can only use port 587


author: Yogesh Mude
body: HI [@Riri Rustandi](/t5/user/viewprofilepage/user-id/1232276)

Good to hear that the problem was resolved.

If you feel this posted answer was helped you to resolve this issue then please don't hesitate to accept the answer because this will helps to other peoples those will face the same issue in future.


author: Riri Rustandi
body: [@Yogesh Mude](/t5/user/viewprofilepage/user-id/1169678)yes of course, Thank you


author: Alexey Studitsky
body: So, to sum up, all you need is to change 465 to **587** port and mark **Use TLS** checkbox:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/214148i4E1A931224A48847/image-size/large?v=v2&px=999 "image.png")

comments: author: Mehran Moss
body: I am having the same issue with Confluence Server. Jira mails are going out fine with the same configuration as confluence. I have changed port to 587 and TLS ticked but receive the same error message. JIra timeout is set to 60000ms. Any ideas anyone?


author: Alexey Studitsky
body: What does telnet return from Confluence server to mail server through 465 port?