Notification emails not being sent with Office365 mail 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

Problem

Bamboo fails to send notification emails.

A stack trace similar to the following is found in the server logs:

1 2 3 4 5 6 7 8 Caused by: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [XXXXXXXXX] at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2202) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1693) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1194) at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendMimeMessage(SMTPMailServerImpl.java:245) at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:187) ... 281 more

ℹ️ This may also affect other mail servers, but it was repeatedly reported for Office365.

Cause

Office365 needs to have TLS enabled to make the connection work.

Resolution

Activate TLS on the UI. If a JNDI resource is being used, edit the <bamboo-installation-dir>/conf/server.xml file to include the following:

server.xml

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -->   <Resource name="mail/SmtpServer" auth="Container" type="javax.mail.Session" mail.smtp.host="smtp.office365.com" mail.smtp.port="587" mail.smtp.auth="true" mail.smtp.user="EMAIL_ADDRESS" password="password" mail.transport.protocol="smtp" mail.smtp.connectiontimeout="20000" mail.smtp.starttls.enable="true" mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" />
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.