geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick McGuire <rick...@gmail.com>
Subject Re: Establishing the need to authenticate for POP3?
Date Mon, 20 Nov 2006 09:59:12 GMT
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


Mime
View raw message