Class ImapAuth

java.lang.Object
  extended byImapAuth

public class ImapAuth
extends Object

A class to provide an interface for authenticating against an IMAP server. To perform the authentication, the class will open a socket to the specified IMAP server on the default IMAP port and try to authenticate the user against it. TODO: ConfigMgr support?

Version:
$Revision: #4 $
Author:
Kevin Thompson [antiduh@csh.rit.edu]

Field Summary
static String defaultHost
           
static int IMAP_PORT
           
 
Constructor Summary
ImapAuth()
           
 
Method Summary
static boolean authenticate(DrinkLoggerSpec log, String username, String password)
          Wrapper function - uses the default host and port.
static boolean authenticate(DrinkLoggerSpec log, String username, String password, String hostname, int port)
          Perform the authentication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultHost

public static final String defaultHost
See Also:
Constant Field Values

IMAP_PORT

public static final int IMAP_PORT
See Also:
Constant Field Values
Constructor Detail

ImapAuth

public ImapAuth()
Method Detail

authenticate

public static boolean authenticate(DrinkLoggerSpec log,
                                   String username,
                                   String password)
Wrapper function - uses the default host and port.


authenticate

public static boolean authenticate(DrinkLoggerSpec log,
                                   String username,
                                   String password,
                                   String hostname,
                                   int port)
Perform the authentication. Open a socket to the server, look for the server banner, send the username and password, look for the response, quit.

Parameters:
log - The DrinkLoggerSpec to log error/etc messages to.
username - The username of the account to authenticate.
password - The password of the account to authenticate.
hostname - The host IMAP server to use for authentication.
port - The port on the IMAP server host to connect to.