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.
-
IMAP4Client()
- Empty default constructor.
-
IMAP4Client(String)
- Construct an IMAP4 session with a mail server.
-
IMAP4Client(String, int)
- Construct an IMAP4 session with a mail server.
-
checkReply(String, String, String)
- Confirm that the reply string begins with a given tag and contains
the confirmation text.
-
deleteMessage(String)
- Delete specified message.
-
getTaggedReply(String)
-
-
listMessages()
- Retrieve list of messages.
-
listUniqueIdentifiers()
- Retrieve list of unique ids, one for each message.
-
logoff()
- Log off.
-
logon(String, String)
- Log on with with the specified user name and password.
-
main(String[])
-
-
messageSize(String)
- Retrieve size (bytes) of the specified message.
-
reset()
- Reset IMAP4 session with mail server.
-
retrieveMessage(String)
- Retrieve a buffered reader with which the specified message may
be read.
-
retrieveMessageTop(String, int)
- Retrieve a buffered reader with which the top lines of the
specified message may be read.
-
sendTaggedCommand(String)
- Send a tagged command to the server.
-
status()
- Fetch "drop listing", or status of the maildrop.
-
tag()
- Generate tag to be used in a server command.
-
uniqueIdentifier(String)
- Retrieve the unique ids for the specified message.
IMAP4Client
public IMAP4Client()
- Empty default constructor.
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
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
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.
logoff
public void logoff() throws IOException
- Log off.
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.
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).
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.
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.
messageSize
public int messageSize(String msgNum) throws IOException
- Retrieve size (bytes) of the specified message.
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.
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.
deleteMessage
public void deleteMessage(String msgNum) throws IOException
- Delete specified message.
reset
public void reset() throws IOException
- Reset IMAP4 session with mail server.
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.
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)
getTaggedReply
protected String[] getTaggedReply(String tag) throws IOException
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.
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index