No authentication mechanisms supported by both server and client when Configuring Microsoft Exchange SMTP Server

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 trying to establish connection to your Microsoft Exchange SMTP server, an error returns.

The following appears in the atlassian-confluence.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 com.atlassian.mail.MailException: javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:193) at com.atlassian.confluence.jmx.JmxSMTPMailServer.send(JmxSMTPMailServer.java:80) at com.atlassian.confluence.admin.actions.mail.SendTestEmailAction.execute(SendTestEmailAction.java:53) Caused by: javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:760) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:673) 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.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:164) ... 257 more

Oops! We misspelled 'mechanisms' in the error message in the logs.

Cause

Recent changes in the JavaMail API has changed certain authentication defaults and sometimes will create an authentication error with some Exchange Server environments dependent on the configuration.

Resolution 1

  1. Set-Dmail.smtp.auth.ntlm.domain=<Domain_name> and restart Confluence.

  2. Enable TLS or SSL on the your exchange mail server for the specific mailbox.

  3. Use one of the following syntaxes for your user:

    • Domain_name\username

    • username@Domain_name.com

If this is not successful, try downgrading the mail jar:

Resolution 2

  1. Make a backup of "$Confluence_install/confluence/WEB-INF/lib/mail-1.4.5.jar" and move it to another directory;

    If you're running Confluence EAR/WAR or has any mail server configured via JNDI, the "mail-1.4.5.jar" class will be on "$CATALINA_HOME/lib".

  2. Download mail-1.4.1.jar

  3. Stop Confluence;

  4. Copy the "mail-1.4.1.jar" for "$Confluence_install/confluence/WEB-INF/lib/" (or "$CATALINA_HOME/lib" in case of a EAR/WAR Confluence deploy);

  5. Start Confluence and check now if Confluence was able to connect in Exchange.

Resolution 3

  1. Remove the existing mail server configuration

  2. Create a new one leaving username and password empty

  3. Restart the server

    This will solve the problem when the authentication is not needed (usually for exchange servers)

Updated on April 16, 2025

Still need help?

The Atlassian Community is here for you.