I'm trying to register my own SMTPTransport-class in Confluence, so that I can do some custom actions when an outgoing E-Mail is about to be sent.
I already have a working library for Jira, that gets correctly registered and does the custom actions I want. Now I copied that over into a Confluence project, but it doesn't work there any longer. Whenever I try to send an email, an exception is thrown:
An error has occurred with sending the test email:
com.atlassian.mail.MailException: javax.mail.NoSuchProviderException: smtp
... 245 more
Caused by: javax.mail.NoSuchProviderException: smtp
... 361 more
Now I'm wondering why the same approach works in Jira, but not in Confluence, as the registering of the class has nothing to do with either Jira and Confluence, but with the underlying web-server. I was trying it on Confluence version 6.4, but it also didn't work in a lower version which I tried previously.
Here is what I did:
I added both those files into the META-INF directory src/main/resources
protocol=smtp; type=transport; class=class.that.extends.SMTPTransport;
And exported it as a jar file and copied it into the confluence/webapp/WEB-INF/lib folder. But somehow, it isn't recognized there.
I also tried copying the folder into the tomcat8/lib folder. There, the registration works and my class is at least about to get loaded. This then fails because it can't find imported classes (like com.sun.mail.smtp.SMTPTransport which it is extending).
I've googled a bit for the above mentioned exception, but all I could find is about an activation-library that is missing, but that is only for Java version 1.5 or lower. And for good measures, I tried it anyway, and it didn't work either.
So, my question now is, what am I doing wrong? What does it need so my SMTPTransport class is correctly loaded in Confluence? I really hope someone can help me there.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Hi Community, Jessica here from the Confluence Product Marketing team! July’s community challenge is all about sharing pictures — and as an extension of our first post on what ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs