Sending Email through an SMTP Server via SSL Fails Due to Resource Configuration

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When sending a test email via an SSL connection (configured as a JNDI resource), mail won't be sent and the following error message is displayed:

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

Cause

The issue is caused due to the inclusion of mail.smtp.socketFactory.class property in the JNDI definition:

<Resource name="mail/SmtpServer"    
    auth="Container" 
    type="javax.mail.Session" 
    mail.smtp.host="mail.mycompany.com" 
    mail.smtp.port="587" 
    mail.smtp.auth="true" 
    mail.smtp.user="jira@mycompany.com" 
    password="mypassword" 
    mail.smtp.starttls.enable="true" 
    mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>

Resolution

Remove the mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" line in conf/server.xml and restart JIRA.

 

 

 

 

 

 

 

 

 

 

 

 

 

   

 

 

 

 

 

 

 

 

 

 

 

 

 

Last modified on Mar 30, 2016

Was this helpful?

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