All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.net.IMAP4Client

java.lang.Object
   |
   +----COM.ibm.net.InetProtocolClient
           |
           +----COM.ibm.net.IMAP4Client

public class IMAP4Client
extends InetProtocolClient
Implements an Internet Message Access Protocol 4 (RFC 2060) client.

 Copyright (c) Taligent, Inc.  1996 - 1997.
 Copyright (c) IBM Corporation 1996 - 1997.
 All Rights Reserved.
 


Constructor Index

 o IMAP4Client()
Empty default constructor.
 o IMAP4Client(String)
Construct an IMAP4 session with a mail server.
 o IMAP4Client(String, int)
Construct an IMAP4 session with a mail server.

Method Index

 o checkReply(String, String, String)
Confirm that the reply string begins with a given tag and contains the confirmation text.
 o deleteMessage(String)
Delete specified message.
 o getTaggedReply(String)
 o listMessages()
Retrieve list of messages.
 o listUniqueIdentifiers()
Retrieve list of unique ids, one for each message.
 o logoff()
Log off.
 o logon(String, String)
Log on with with the specified user name and password.
 o main(String[])
 o messageSize(String)
Retrieve size (bytes) of the specified message.
 o reset()
Reset IMAP4 session with mail server.
 o retrieveMessage(String)
Retrieve a buffered reader with which the specified message may be read.
 o retrieveMessageTop(String, int)
Retrieve a buffered reader with which the top lines of the specified message may be read.
 o sendTaggedCommand(String)
Send a tagged command to the server.
 o status()
Fetch "drop listing", or status of the maildrop.
 o tag()
Generate tag to be used in a server command.
 o uniqueIdentifier(String)
Retrieve the unique ids for the specified message.

Constructors

 o IMAP4Client
 public IMAP4Client()
Empty default constructor.

 o IMAP4Client
 public IMAP4Client(String mailServ)
Construct an IMAP4 session with a mail server. IMAP4Client will use port 143 by default.

Parameters:
mailServ - Name or IP address of mail server
 o IMAP4Client
 public IMAP4Client(String mailServ,
                    int port)
Construct an IMAP4 session with a mail server.

Parameters:
mailServ - Name or IP address of mail server
port - Port number of the server

Methods

 o logon
 public String[] logon(String user,
                       String password) throws IOException
Log on with with the specified user name and password. Returns informational messages or warnings or null if sucessful.

 o logoff
 public void logoff() throws IOException
Log off.

 o status
 public String status() throws IOException
Fetch "drop listing", or status of the maildrop. String contains (at least) two tokens: first is the number of messages and the second the total bytecount of the messages.

 o listMessages
 public String[] listMessages() throws IOException
Retrieve list of messages. Each message contains two tokens separated by a single whitespace. The first token is the message number and the second is its size (bytes).

 o uniqueIdentifier
 public String uniqueIdentifier(String msgNum) throws IOException
Retrieve the unique ids for the specified message. The returned string contains two tokens separated by a single whitespace. The first token is the message number and the second its unique id.

 o listUniqueIdentifiers
 public String[] listUniqueIdentifiers() throws IOException
Retrieve list of unique ids, one for each message. Each string contains two tokens separated by a single whitespace. The first token is the message number and the second its unique id.

 o messageSize
 public int messageSize(String msgNum) throws IOException
Retrieve size (bytes) of the specified message.

 o retrieveMessage
 public BufferedReader retrieveMessage(String msgNum) throws IOException
Retrieve a buffered reader with which the specified message may be read. A line containing only "." indicates terminates the message. Do not close the stream after completion.

 o retrieveMessageTop
 public BufferedReader retrieveMessageTop(String msgNum,
                                          int lines) throws IOException
Retrieve a buffered reader with which the top lines of the specified message may be read. A line containing only "." indicates terminates the message. Do not close the stream after completion.

 o deleteMessage
 public void deleteMessage(String msgNum) throws IOException
Delete specified message.

 o reset
 public void reset() throws IOException
Reset IMAP4 session with mail server.

 o tag
 public String tag()
Generate tag to be used in a server command. The tag string is terminated with a space. May be overwritten to customize tag generation.

 o checkReply
 protected String[] checkReply(String reply,
                               String tag,
                               String success) throws IOException
Confirm that the reply string begins with a given tag and contains the confirmation text.

Parameters:
reply - Server response string
tag - The reponse tag expected
success - A string indicating success
Returns:
An array of server warning strings or null if no warnings were returned
Throws: IOException
Reply could not confirmed; exception contains the reply (sans tag)
 o getTaggedReply
 protected String[] getTaggedReply(String tag) throws IOException
 o sendTaggedCommand
 protected String sendTaggedCommand(String cmd) throws IOException
Send a tagged command to the server. A newline character is sent following the command. Returns the tag generated for the command.

 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index