Cannot send Test Mail due to Authentication Error
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
When attempting to send a test mail through a JIRA application, it fails with a "530 5.7.1 Client was not authenticated" error.
The following appears in the atlassian-jira.log
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2012-09-05 16:32:43,193 http-8280-5 ERROR u18547 992x517290x1 gqc9dj 10.7.105.153 /secure/admin/SendBulkMail.jspa [action.admin.mail.SendBulkMail] Error sending e-mail.
com.atlassian.mail.MailException: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:183)
at com.atlassian.jira.web.action.admin.mail.SendBulkMail.doExecute(SendBulkMail.java:252)
at webwork.action.ActionSupport.execute(ActionSupport.java:165)
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:76)
at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39)
at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31)
at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16)
at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35)
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:205)
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:143)
at com.atlassian.jira.web.dispatcher.JiraWebworkActionDispatcher.service(JiraWebworkActionDispatcher.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1580)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1097)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:156)
...
OR
1
2
3
4
5
6
7
8
com.atlassian.mail.MailException: com.sun.mail.smtp.SMTPSendFailedException: 530 Authentication required
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:193)
at com.atlassian.jira.plugins.mail.webwork.SendTestMail.doExecute(SendTestMail.java:107)
at webwork.action.ActionSupport.execute(ActionSupport.java:165)
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:82)
at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39)
at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31)
at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16)
Cause
This error is generated by the SMTP server when it requires authentication, and credentials have not been entered into the configuration of the JIRA application.
Firewall blocked the authentication, or there is a third-party application monitoring SMTP traffic.
Firewall may filter out/ replace the SMTP traffic or the SMTP commands.
Results of Telnet:
1 2 3 4 5 6 7 8 9 10 11
[root@km ~]# telnet <hostname> 25 Trying <ip address>.... Connected to <hostname>. Escape character is '^]'. 220 ***************************************************************************************************************** EHLO <hostname> 500 Syntax error, command "XXXX <hostname>" unrecognized HELO <hostname> 250 <hostname> Hello <hostname> ([IP ADDRESS]), pleased to meet you AUTH LOGIN ERTYUiopolJHGFDGhjkLOIUYTFDvbnASDasdsaM== fASIafqYU 500 Syntax error, command "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" unrecognized
Firewall or a third-party application replaced the character to string "XXXXXXXXX"
This results to Javamail thinking that the server does not support the extended set of command, and does not issue the AUTH LOGIN command to authenticate.
the failing of the EHLO command causes the Javamail to not get this information:
1 2 3 4
250-HELP 250-AUTH LOGIN 250-SIZE 250 PIPELINING
Resolution
Set up the SMTP server as in Configuring JIRA's SMTP mail server to send notifications, ensuring that the correct Username and Password parameters have been entered.
You can telnet manually to check on the authentication of Username and Password.
1 2 3 4 5 6 7 8 9 10 11
telnet <hostname> 25 220 forchheim160a.linux.rz.db.de ESMTP Service (Lotus Domino Release 8.5.2FP3) ready at Mon, 3 Dec 2012 09:30:45 +0100 EHLO <hostname> Hello <hostname> ([ip address]), pleased to meet you 250-HELP 250-AUTH LOGIN 250-SIZE 250 PIPELINING HELO <hostname> 250 <hostname> Hello <hostname> ([IP ADDRESS]), pleased to meet you AUTH LOGIN ERTYUiopolJHGFDGhjkLOIUYTFDvbnM== fASIafqYU <cut>=235 Authentication successful
Make sure the Firewall is turned off (or reconfigured to receive command from JIRA server) and there is no third-party application monitoring the SMTP traffic.
Telnet from JIRA server to SMTP server
Make sure the SMTP server reacts the command sent like EHLO.
Was this helpful?