On Jan 27, 2009, at 2:43 PM, werni wrote:


The mail session factory org.apache.openejb.core.MailSessionFactory creates a
mail session as follows:

public Session create() {
   return Session.getDefaultInstance(properties);
}

This way only one mail session can be configured in openejb.xml, namely the
default mail session.

The following modification in MailSessionFactory allows to configure
multiple mail sessions in openejb.xml:

public Session create() {
    return Session.getInstance(properties);
}

The configuration in openejb.xml looks as follows:

<Resource id="mail/Test" type="javax.mail.Session">
        mail.debug true
        mail.transport.protocol smtp
        mail.smtp.user username
        mail.smtp.password changeit
        mail.smtp.starttls.enable true
        mail.smtp.auth true
        mail.smtp.host mail.xyz.com
        mail.smtp.port 25
        mail.from [email protected]
        mail.store.protocol pop3s
        mail.pop3s.host mail.xyz.com
        mail.pop3s.port 995
        mail.pop3s.auth true
        mail.pop3s.user username
        mail.pop3s.password changeit
</Resource>

Not sure whether this is a feature or a bug request.

Thanks, werni.  I've gone ahead and made the change.

Filed it as a bug:  https://issues.apache.org/jira/browse/OPENEJB-994

Thank you very much for finding this!

-David

Reply via email to