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

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When trying to establish connection to your Microsoft Exchange SMTP server, an error returns.

The following appears in the atlassian-confluence.log:

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
tip/resting Created with Sketch.

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

    tip/resting Created with Sketch.

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


Last modified on Nov 12, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.