You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jason Warner <ja...@gmail.com> on 2006/11/19 21:28:20 UTC
Establishing the need to authenticate for POP3?
Hello All,
I'm implementing authenticatation support for pop3 and I'm trying to
figure out how to indicate to javamail that authentication is to be used
when trying to access a pop3 server. I see that in the smtp protocol it is
a property of the session whether to authenticate or not. Does anyone know
how that flag gets set? Can the same method be used for pop3? Thanks.
- Jason
Re: Establishing the need to authenticate for POP3?
Posted by Rick McGuire <ri...@gmail.com>.
Jason Warner wrote:
> Hello All,
>
> I'm implementing authenticatation support for pop3 and I'm trying to
> figure out how to indicate to javamail that authentication is to be
> used when trying to access a pop3 server. I see that in the smtp
> protocol it is a property of the session whether to authenticate or
> not. Does anyone know how that flag gets set?
The property is created at the time the mail Session is created by
setting the appropriate property bundle. This can be done just by
setting the appropriate property in the bundle passed to
Session.getInstance() or configured with the GBeans if running under
Geronimo. For example:
Properties props = System.getProperties();
props.put("mail.smtp.auth", "true");
props.put("mail.debug", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.port", "587");
// Get a Session object
Session mailSession = Session.getInstance(props);
Properties that apply to just the smtp transport begin with
"mail.smtp.". Properties that are global to the entire session just use
"mail.".
> Can the same method be used for pop3? Thanks.
Same general method, just different in the specifics. The smtp
implementation supports the same properties that the Sun provider
supports for compatibility. This makes sense to do this for POP3 as
well. The documentation is here:
http://java.sun.com/products/javamail/javadocs/com/sun/mail/pop3/package-summary.html
It appears that "mail.pop3.apop" property controls authentication.
>
> - Jason