cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28485] New: - Cannot change SMTP in MailMessageSender after first initialisation of Session
Date Tue, 20 Apr 2004 05:11:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28485>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28485

Cannot change SMTP in MailMessageSender after first initialisation of Session

           Summary: Cannot change SMTP in MailMessageSender after first
                    initialisation of Session
           Product: Cocoon 2
           Version: 2.1.4
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: blocks
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: sdewar@tvnz.co.nz


The following works fine :

>org.apache.cocoon.mail.MailMessageSender _sendmail_mms =
>                new org.apache.cocoon.mail.MailMessageSender("myMailServer1");

but when I want to use another SMTPHost :

>org.apache.cocoon.mail.MailMessageSender _sendmail_mms =
>                new org.apache.cocoon.mail.MailMessageSender("myMailServer2");

it still uses myMailServer1.

>From what I can see, it is because it passes the SMTPHost in a Properties 
object (within java/org/apache/cocoon/mail/MailMessageSender.java) and a 
session is created using that properties object with 
javax.mail.Session.getDefaultInstance(properties). getDefaultInstance only uses 
the properties argument (which has the new SMTPHost) if Session has never been 
created (which it has from the first constructor).

In order to use a different SMTPHost, we're having to restart.

Please help :o)

Mime
View raw message