roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Hosemann (JIRA)" <j...@apache.org>
Subject [jira] Commented: (ROL-1694) Email notification for comments in Glassfish does not work, but could be a general issue
Date Tue, 04 Aug 2009 15:16:14 GMT

    [ https://issues.apache.org/jira/browse/ROL-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739002#action_12739002
] 

Konrad Hosemann commented on ROL-1694:
--------------------------------------

I can confirm, that
 - this is an issue also on Tomcat. It has nothing to do with the container, though
 - the fix suggested by Stephan works
 - and should be included in the trunk


> 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: David Johnson
>             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.


Mime
View raw message