Office 365 SMTP Configuration throws 'Unrecognized SSL message' error and fails in Crowd

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

Attempting to configuring a SMTP connection in Crowd to Office 365 fails.

The following appears in the Crowd logs:

java.lang.RuntimeException: Could not send email to <email-address>: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

Cause

The built in SMTP configuration screen for Crowd does not work with Office 365.

Workaround

  1. Stop Crowd
  2. Move activation-1.1.1.jar from <crowd-install>/crowd-webapp/WEB-INF/lib to <crowd-install>/apache-tomcat/lib
  3. Add the following to <crowd-install>/apache-tomcat/conf/Catalina/localhost/crowd.xml before the </Context>:

    <Resource name="mail/Office365"
    auth="Container"
    type="javax.mail.Session"
    mail.smtp.host="smtp.office365.com"
    mail.smtp.port="587"
    mail.smtp.auth="true"
    mail.smtp.user="yourEmailAddress@yourOffice365.com"
    password="yourPassword"
    mail.smtp.starttls.enable="true"
    mail.transport.protocol="smtps"
    />
  4. Start Crowd
  5. Configure the SMTP mail server to use the JNDI location of java:comp/env/mail/Office365
  6. Save and send a test email
Last modified on Mar 30, 2016

Was this helpful?

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