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

Setting up JavaMail datasource with SSL, username and password

by Ryan de Laplante :: Rate this Message:

Reply to Author | View in Thread

Hi,

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");
>         props.put("mail.smtp.host", "smtp.host.foo");
>         props.put("mail.smtp.port", "587");
>         props.put("mail.from", "foo@...");
>
>         Authenticator auth = Utils.getAuthenticator();
>         Session session = Session.getInstance(props, auth);
>         session.setDebug(false);
>         ...
>
>
>
>     public static Authenticator getAuthenticator() {
>         return new Authenticator() {
>             @Override
>             protected PasswordAuthentication
> getPasswordAuthentication() {
>                 return new PasswordAuthentication(user, password);
>             }
>         };
>     }

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.


Thanks,
Ryan


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