[ 
https://issues.apache.org/jira/browse/ROL-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anil Gangolli resolved ROL-1694.
--------------------------------

    Resolution: Fixed

Suggested fix for Roller Weblogger is now in trunk at revision 816262

Additional notes:
- Planet MailUtil still uses static version.  Has no non-static transport 
instance there.  Planet needs more extensive changes to use a configured mail 
provider.
- Static send would also call saveChanges() but that is a no-op for the 
transient message case.

> Email notification for comments in Glassfish does not work, but could be a 
> general issue
> ----------------------------------------------------------------------------------------
>
>                 Key: ROL-1694
>                 URL: https://issues.apache.org/jira/browse/ROL-1694
>             Project: Roller
>          Issue Type: Bug
>    Affects Versions: 4.0
>         Environment: Glassfish 9.1_01
>            Reporter: Stephan Mühlstrasser
>            Assignee: Anil Gangolli
>             Fix For: 5.0
>
>
> Setting up email notification for Roller 4.0 under GlassFish didn't work with 
> the "mail.configurationType=properties" configuration. The SMTP server of the 
> hosting company requires SMTP authentication, and I had specified 
> "mail.username" and "mail.password" in the configuration. Nevertheless I 
> always received an javax.mail.AuthenticationFailedException exception.
> I believe the problem is in the following code in 
> org/apache/roller/weblogger/util/MailUtil.java (starting at line 642):
> -------------------------------------------------------------------------------------
> Transport transport = mailProvider.getTransport();
>  // Try to send while there remain some potentially good addresses
> try { 
>     do {
>         // Avoid a loop if we are stuck
>         nAddresses = remainingAddresses.length;
>         try {
>             // Send to the list of remaining addresses, ignoring the 
> addresses attached to the message
>                 transport.send(message, remainingAddresses);
> -----------------------------------------------------------------------------------------------
> The call "transport.send(...)" calls the method "public static void 
> send(Message msg, Address[] addresses)". In the API documentation there is 
> the following comment for "public static void send(Message msg)" method that 
> most likely applies to the other static "send" method as well:
> "Note that send is a static method that creates and manages its own 
> connection. Any connection associated with any Transport instance used to 
> invoke this method is ignored and not used. This method should only be 
> invoked using the form Transport.send(msg);, and should never be invoked 
> using an instance variable."
> This means that the username and password from the properties are ignored, 
> and that is the reason that the AuthenticationFailedException occurs.
> The solution is to use the non-static "transport.sendMessage(message, 
> remainingAddresses);" instead of the static "transport.send(message, 
> remainingAddresses);". With that change email notifications work in 
> GlassFish. But I think this is a general issue and this probably affects 
> Roller also under any  other application server if SMTP authentication is 
> necessary.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to