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)
...

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 STMP server side: Microsoft Exchange

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

Tested on

The latest update of this article has been tested with: