Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-74878

The "Connection Test" on the Outgoing Mail Server page fails with an authentication error code when no username or password is specified

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • High
    • 9.11.0, 9.10.1
    • 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
    • Mail Server
    • 9.02
    • 35
    • Severity 2 - Major
    • 159
    • Hide
      Atlassian Update – 03 July 2023

      Thank you for reporting this issue. In the last weeks we have been working hard on fixing it.

      Summary of the problem:
      "Test connection" would fail with authentication error for SMTP servers with no username/password requirement.

      New behaviour after the change:
      "Test connection" will no longer fail for such SMTP servers as long as username/password combo is not specified.

      Status of the fix and Fix Version:

      The fix is ready, and we’re moving the status of this ticket to Waiting for release with Fix Version 9.10.1 and 9.11.

      Best regards,

      Artur Falborski
      Jira DC Software Engineer

      Show
      Atlassian Update – 03 July 2023 Thank you for reporting this issue. In the last weeks we have been working hard on fixing it. Summary of the problem: "Test connection" would fail with authentication error for SMTP servers with no username/password requirement. New behaviour after the change: "Test connection" will no longer fail for such SMTP servers as long as username/password combo is not specified. Status of the fix and Fix Version: The fix is ready, and we’re moving the status of this ticket to Waiting for release with Fix Version 9.10.1 and 9.11 . Best regards, Artur Falborski Jira DC Software Engineer

    Description

      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

      1. Install Jira Server on any version from 9.2.0
      2. Log into Jira as a Jira System Admin user
      3. Go to ⚙ > System > Outgoing Mail
      4. Configure a the SMTP Mail Server without specifying the combo username/password
      5. 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

      1. 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
      2. Right click on the element in the browser tool, and select Delete Node (or Delete Element, depending on which browser you are using)
      3. You should see that the box next to the username field is gone. Click on Test Connection.
      4. 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.

      Attachments

        1. Error_Example1.png
          53 kB
          Julien Rey
        2. Error_Example2.png
          85 kB
          Julien Rey
        3. screenshot-1.png
          526 kB
          Thomas Connally
        4. Workaround1.png
          215 kB
          Julien Rey
        5. Workaround2.png
          70 kB
          Julien Rey
        6. Workaround3.png
          114 kB
          Julien Rey
        7. Workaround4.png
          133 kB
          Julien Rey

        Issue Links

          Activity

            People

              d996197e70d9 Artur Falborski
              jrey Julien Rey
              Votes:
              11 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated: