Jira outgoing mail server configuration without username and password fails with error No supported authentication mechanisms were proposed by the server
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Summary
When attempting to configure an outgoing mail server in Jira without entering a username and password (leaving the fields blank), the following error is thrown:
Unfortunately no connection was possible. Review the errors below and rectify:
No supported authentication mechanisms were proposed by the server. Either the server requires TLS to offer authentication or no authentication is required and you should clear username and password or the server is misconfigured.
Environment
Any Jira version.
Diagnosis
Outgoing mail log indicates the following errors:
2024-04-15 14:35:53,174+0100 http-nio-8009-exec-12 ERROR dummy_user 875x2633x1 3760az x.x.x.x,127.0.0.1 /secure/admin/VerifySmtpServerConnection!add.jspa [c.a.j.p.mail.serververification.VerifySmtpServer] Unable to connect to the server at smtp.mail.com due to the following exception: javax.mail.AuthenticationFailedException: No authentication mechanisms supported by both server and client
2024-04-15 14:35:53,193+0100 http-nio-8009-exec-12 WARN dummy_user 875x2633x1 3760az x.x.x.x,127.0.0.1 /secure/admin/VerifySmtpServerConnection!add.jspa [w.view.taglib.IteratorTag] Value is null! Returning an empty set.
Cause
By default, when Jira connects to the SMTP server, it issues an EHLO command that prompts the server to indicate its capabilities, including AUTH support. Typically, an open relay server does not have AUTH or AUTH=LOGIN capabilities enabled. However, there may be instances where an open relay server has an atypical configuration with support for AUTH enabled. In such cases, this can initiate the authentication process even when it's not intended.
Solution
Add the following JVM parameters on Jira startup (detailed instructions can be found here) and then restart Jira:
-Dmail.smtp.ehlo=false -Dmail.smtp.auth=false
- mail.smtp.ehlo=false will prevent Java from issuing an EHLO command when connecting to the mail server.
- mail.smpt.auth=false will enforce no authentication is attempted when connecting to the mail server.