Connection to Microsoft Exchange SMTP server fails with no authentication mechanisms supported error in Jira 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-jira.log:

[action.admin.mail.VerifyMailServerConnection$VerifyMailServer] Unable to connect to the server at <mail_server> due to the following exception: javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client

And, the following appears in jira-outgoing-mail.log:

com.atlassian.mail.MailException: javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client
	at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:201)
	at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:44)
(...)
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)

(warning)  Oops! We misspelled 'mechansims in the error message in the logs.

Cause

Misconfiguration between the JIRA application and the Exchange Server.

Resolution

  1. Set the following JVM startup argument "-Dmail.smtp.auth.ntlm.domain=<Domain_name>" by following the Setting properties and options on startup documentation and restart the JIRA application.
  2. Ensure the configuration of the SMTP is correct: check the protocol, port and also if the Exchange Mail Server for the specific mailbox requires or not TLS.
  3. Use one of the following syntaxes for your user:
    • Domain_name\username

    • username@Domain_name.com

    • Some Exchange servers do not require username and password, try leaving both empty in JIRA SMTP configuration.

       

The above suggestion is expected to work for most customers. However, if you are unable to apply this fix, or it doesn't work, there's another possible fix:

Workaround for versions below 5.2

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

    If you're running JIRA 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 (or pick it from from an older JIRA version such as 4.4.4);
  3. Stop JIRA;
  4. Copy the "mail-1.4.1.jar" for "$JIRA_INSTALL/atlassian-jira/WEB-INF/lib" (or "$CATALINA_HOME/lib" in case of a EAR/WAR JIRA deploy);
  5. Start your JIRA application and check now if it was able to connect in Exchange.
Last modified on Sep 25, 2019

Was this helpful?

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