Class com.tdac.mail.MailConnection
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.tdac.mail.MailConnection

java.lang.Object
   |
   +----com.tdac.mail.SocketConnection
           |
           +----com.tdac.mail.MailConnection

public class MailConnection
extends SocketConnection
implements MailBoxInterface
This base class defines a mail connection to a mail server using Sockets.
Version:
1.0, 11/11/96
Author:
Timothy D. A. Cox

Constructor Index

 o MailConnection()

Method Index

 o closeBox()
Close a mail box folder, expunging deleted messages
 o connect(String)
Connect to a server.
 o connect(String, int)
Connect to a server on a port.
 o deleteMessage(int)
Delete a specific message
 o getFolders(String, List)
Return a single folder 'inbox'
 o getHeaders(List, int, int)
Retrieve all the mail headers parse into a List
 o getMessage(int, boolean)
Retrieve a specific message.
 o getMessage(TextArea, int, boolean)
Retrieve a specific message into a TextArea
 o login(String, String)
Login to the connected mail server using a userid and password
 o logout()
Logoff from the connected mail server using a userid and password
 o openBox(String)
Open a mail box folder for reading
 o parseFlags(Response)
Determine the available flags values (eg.
 o parseHeader(List, Response, int)
Parse a server response for the mail headers and place them into a list component.
 o parseNumMessages(Response)
Determine the number of messages in the mail box
 o parseNumRecent(Response)
Determine the number of un-seen messages in the mail box
 o parsePermanentFlags(Response)
Determine the available permanent flags values (eg.
 o purgeMessages()
Purge all deleted messages
 o undeleteMessage(int)
Un-delete a specific message

Constructors

 o MailConnection
  public MailConnection()

Methods

 o connect
  public abstract String connect(String server) throws ExceptionMailConnection
Connect to a server. Will setup the private stream objects and read the mail server greeting. The extender of this class must provide the port.
Parameters:
server - the mail server name (eg. mail.domain.com)
Returns:
the mail server greeting string
 o connect
  public synchronized String connect(String server,
                                     int port) throws ExceptionMailConnection
Connect to a server on a port. Will setup the private stream objects and read the mail server greeting.
Parameters:
server - the mail server name (eg. mail.domain.com)
port - the server socket port # (110 or 143)
Returns:
the mail server greeting string
 o getFolders
  public Response getFolders(String dir,
                             List list) throws ExceptionMailConnection
Return a single folder 'inbox'
Parameters:
dir - the root directory for mail folders (eg. ~user/mail)
name - the mailbox folder to open (default: 'inbox'
Returns:
null

All Packages  Class Hierarchy  This Package  Previous  Next  Index