Using CRAM-MD5 authentication |
The Imap class supports digest authentication using the AUTHENTICATE CRAM-MD5 command as described in RFC 2195. Authentication using CRAM-MD5 provides a more secure session ensuring that your username an password are not submitted over the network in plain text. If your server supports CRAM-MD5 authentication you may set the authentication method prior to establishing a connection to the IMAP server by invoking the Imap#setAuthMode method.
Example
// create new Imap instance Imap imap = new Imap("imap.myserver.com","jsmith","secret");
// set authentication mode imap.setAuthMode(Imap.AUTH_CRAM_MD5);
// connect and login imap.connect(); |