users@glassfish.java.net

Re: Glassfish JavaMail Session and SMTP Authentication

From: <glassfish_at_javadesktop.org>
Date: Fri, 21 Mar 2008 06:52:04 PST

My current conclusion is that Apache Roller 4.0 email notification cannot work in GlassFish, if a configuration via JNDI and a GlassFish JavaMail session is performed.

The reason is that it is not possible to specify the username and password for SMTP authentication in a GlassFish JavaMail session in a way that the container sets up the javax.mail.Session object with an Authenticator object. After reading the JavaMail API and the JavaMail Spec I believe that this would be the only way how the container can pass a javax.mail.Session object to the web application, which would perform SMTP authentication without further explicit JavaMail API calls by the web application. Please correct me someone if that conclusion is wrong.

I then resorted to the explicit configuration of the email properties in Apache Roller, and this didn't work too. I always got a javax.mail.AuthenticationFailedException in that case. I believe that I tracked this down to a problem in Apache Roller itself, and I'll try to verify this with the Apache Roller people. After changing the javax.mail.Transport API calling the Apache Roller source for sending a message from the static "send" method to the "sendMessage" method I finally got email notifications working.

Regards
Stephan
[Message sent by forum member 'smuehlst' (smuehlst)]

http://forums.java.net/jive/thread.jspa?messageID=265181