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

Article ID:360000075831
1 minute readKnowledge base

Issue

  • I have configured Microsoft Exchange as SMTP Server for Jenkins and a similar stacktrace on my job console output is being shown

javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client
at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:756)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:669)
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 javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at hudson.tasks.Mailer$DescriptorImpl.doSendTestMail(Mailer.java:566)
...

Environment

  • CloudBees Jenkins Enterprise - Managed controller (CJE-MM)

  • CloudBees Jenkins Enterprise - Operations center (CJE-OC)

  • Jenkins LTS

  • Microsoft Exchange - configured as NTLM authentication.

Resolution

On Jenkins side

  1. Add the Java Property -Dmail.smtp.auth.ntlm.domain=<Domain_name> and restart Jenkins

  2. Configure SMTP Server under Manage Jenkins > Configure System as follows:

    2.1. Use one of the following syntaxes for your user: Domain_name\username, username@Domain_name.com
    2.2. Enable SSL

    smtp_config.png

On SMTP server side: Microsoft Exchange

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

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.