WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Setting up JavaMail datasource with SSL, username and password

Re: Setting up JavaMail datasource with SSL, username and password

by Dave-481 :: Rate this Message:

| View in Thread

On Mon, Jun 30, 2008 at 4:21 PM, Ryan de Laplante <ryan@...> wrote:
> I'm having difficulty figuring out how to set up a JavaMail datasource that
> uses TLS SSL, username and password.  To do this in JavaCode:
>>     ...
>>        Properties props = new Properties();
>>        props.put("mail.smtp.auth", "true");
...
> It looks like it can't be done simply by adding properties to the JavaMail
> DataSource since the roller app needs to be able to use the username and
> password.   Does Roller have such a feature?
>
> BTW I'm using GlassFish V2.

I don't believe you can set username/password for container managed
mail sessions on Tomcat or Glassfish. That's why we have the plain old
mail setup (i.e. not container managed, not JNDI), which does allow
you to set username/password -- but does not do anything to configure
SSL (your code example doesn't seem to do SSL either).

Here's what you'd add to your roller-custom.properties file to setup
mail with username and password:

        mail.configurationType=properties
        mail.hostname=smtp-server.example.com
        mail.username=scott
        mail.password=tiger

- Dave

 « Return to Thread: Setting up JavaMail datasource with SSL, username and password