-
Bug
-
Resolution: Tracked Elsewhere
-
Highest
-
9.2.0, 9.3.0, 9.4.0, 9.5.0, 9.4.1, 9.4.2, 9.4.3, 9.4.6, 9.12.6, 9.12.7, 9.12.8, 9.17.1
-
9.02
-
43
-
Severity 2 - Major
-
118
-
-
Issue Summary
The connection test of the outgoing mail server configuration fails with an authentication error when using an SMTP mail server that does not require a username/password.
Steps to replicate
- Install Jira Server on any version from 9.2.0
- Log into Jira as a Jira System Admin user
- Go to ⚙ > System > Outgoing Mail
- Configure a the SMTP Mail Server without specifying the combo username/password
- Click on the button Test Connection
Actual behavior
The connection test fails with an authentication error, even though the SMTP mail server does not need a username/password to be accessed, and no username/password was specified in the outgoing mail form.
Depending on the type of SMTP mail server in use, a different error might be thrown:
- Example of error 1
AuthenticationFailedException: 334 VXNlcm5hbWU6
- Example of error 2
AuthenticationFailedException: 535 5.7.0 authentication failed
If we enable DEBUG for Outgoing Mail and check the Jira Outgoing Mail Logs, we can see that the connection test incorrectly sets useAuth to true, and also it seems to be passing a non null password while no password and no username had been filled in the form:
2023-02-14 15:39:06,130+0000 DEBUG [Test] http-nio-8080-exec-1 admin 939x204x1 10hxxdl 172.29.212.154,172.50.0.2 /secure/admin/VerifySmtpServerConnection!update.jspa [c.atlassian.mail.outgoing] DEBUG SMTP: useEhlo true, useAuth true ... 2023-02-14 15:39:06,132+0000 DEBUG [Test] http-nio-8080-exec-1 admin 939x204x1 10hxxdl 172.29.212.154,172.50.0.2 /secure/admin/VerifySmtpServerConnection!update.jspa [c.atlassian.mail.outgoing] DEBUG SMTP: protocolConnect login, host=smtp, user=, password=<non-null>
Expected behavior
The connection test should be successful.
If we enable DEBUG for Outgoing Mail and check the Jira Outgoing Mail Logs, we can see that the connection test correctly sets useAuth to false, and also no username and no password are being passed:
2023-02-20 15:40:29,776+0000 DEBUG [Test] http-nio-8080-exec-16 admin 940x844x1 hotrqz 172.29.210.143,172.50.0.2 /secure/admin/VerifySmtpServerConnection!update.jspa [c.atlassian.mail.outgoing] DEBUG SMTP: useEhlo true, useAuth false
Workaround
- From the Outgoing Mail Server form, right click on the username field and select Inspect. The browser dev tools should be opened and should show the element corresponding to this field
- Right click on the element in the browser tool, and select Delete Node (or Delete Element, depending on which browser you are using)
- You should see that the box next to the username field is gone. Click on Test Connection.
- Verify that the connection test is successful
Note about this workaround. Normally, it should be enough to delete the Username element from the page. If this workaround does not work for you, please try to also delete the Password element.
Alternative Workaround
Add the following JVM parameters to your setenv.sh file and then proceed with a restart of Jira (you can find detailed instructions here):
-Dmail.smtp.ehlo=false -Dmail.smtp.auth=false
mail.smtp.ehlo=false will prevent java from trying to connect and issue a EHLO command to connect to the mail system
mail.smpt.auth=false will reinforce no authentication to your smtp system.
- followed by
-
JRASERVER-78051 "Connection test" fails with authentication error when Outgoing Mail Server setup is performed with no credentials
- Gathering Impact
- is related to
-
JRASERVER-74326 The username field is treated as a mandatory field in the outgoing mail server configuration when using Oauth 2.0
- Closed
-
JRASERVER-74818 The "Connection Test" fails on the Outgoing Mail server when the option "Change password" is not ticked
- Closed
-
ACE-5667 Loading...
- relates to
-
JRASERVER-77676 Unable to change unauthenticated outgoing mail (smtp) configuration
- Gathering Impact
-
JSEV-3214 Loading...