IP*Works! SSL V6

ipworksssl
Class Imaps

java.lang.Object
  |
  +--ipworksssl.Imaps

public class Imaps
extends java.lang.Object

The IMAPS bean is used to communicate with IMAP servers using the IMAP (Internet Message Access) protocol.

The IMAPS bean is the SSL-enabled equivalent (RFC 2595) of the IP*Works! IMAP bean. The main difference is the introduction of a set of new configuration settings, properties and events that deal with SSL security. TheSSLProviderconfiguration setting chooses a security provider subsystem. TheSSLEnabledProtocolsandSSLCipherStrengthconfiguration settings determine which protocols are enabled and at what security level. The SSLCertStore , SSLCertSubject , and SSLCertEncoded properties are used to select a client certificate if the server is requesting client authentication. TheSSLSecurityFlagsconfiguration setting, together with the SSLServerAuthentication event allow you to check the server identity and other security attributes. Finally, the SSLStatus event provides information about the SSL handshake.

The IMAPS bean implements a standard IMAP client as specified in RFC 1730 and RFC 2060.

The first step in using the bean is specifying a MailServer , a User to connect as, and a Password to authenticate with. After that, one or more requests may be sent to the server via the bean's methods. Results are retrieved through events and a number of key properties.

Normally, after connecting to the server a Mailbox is selected (or examined) using the ExamineMailbox method. After the Mailbox is selected, MessageCount and RecentMessageCount show the number of messages in the mailbox, and MailboxFlags show the flags pertaining to the mailbox.

A number of operations may be performed by the server in response to commands sent via the bean's methods. The main arguments for most commands is the Mailbox property or the MessageSet property. The MessageSet property denotes either a single message, or a range of messages. Other arguments are specified through other properties such as SearchCriteria , MessageFlags , etc.

Responses are received through events such as MessageInfo , MailboxList , and also reflected to properties such as MessageText , MessageSubject , etc.

The MessagePart event describes the MIME structure of retrieved messages. One MessagePart event is fired for every message part, giving information about the particular part. Later on, message parts may be retrieved separately through the FetchMessagePart method. This speeds up processing by avoiding the need to retrieve full messages from the server.

The PITrail event traces the interaction between the client and the server. It includes all exchanges except for transfers of messages, message parts, and message headers.


Field Summary
static int amCRAMMD5
           
static int amUserPassword
           
static int fwNone
           
static int fwSOCKS4
           
static int fwSOCKS5
           
static int fwTunnel
           
static int sslAutomatic
           
static int sslExplicit
           
static int sslImplicit
           
static int sslNone
           
static int sstMachine
           
static int sstPEMKey
           
static int sstPFXBlob
           
static int sstPFXFile
           
static int sstUser
           
 
Constructor Summary
Imaps()
           
 
Method Summary
 void addImapsEventListener(ImapsEventListener l)
           
 void addMessageFlags(java.lang.String flags)
          Add the specified flags to the messages specified by MessageSet .
 void appendToMailbox()
          Appends the message in MessageText to the mailbox specified by Mailbox .
 void checkMailbox()
          Sends a 'CHECK' command to the server.
 void closeMailbox()
          Remove all messages marked with 'Deleted' flag from the currently selected mailbox and unselect mailbox.
 java.lang.String config(java.lang.String configurationString)
          Sets or retrieves a beanconfiguration setting.
 void connect()
          Connect to an IMAP server.
 void copyToMailbox()
          Copies the messages specified by MessageSet to the mailbox specified by Mailbox .
 void createMailbox()
          Create a new mailbox specified by Mailbox .
 void deleteFromMailbox()
          Marks the messages specified by MessageSet as deleted.
 void deleteMailbox()
          Delete a mailbox specified by Mailbox .
 void deleteMailboxACL(java.lang.String user)
          Deletes mailbox access control rights for a specific user.
 void disconnect()
          Disconnect from an IMAP server.
 void doEvents()
          Processes events from the internal message queue.
 void examineMailbox()
          Select a Mailbox (Read-only mode).
 void expungeMailbox()
          Remove all messages marked with 'Deleted' flag from the currently selected mailbox.
 void fetchMessageHeaders()
          Get the message headers of messages specified by the MessageSet property.
 void fetchMessageInfo()
          Get information about messages specified by the MessageSet property.
 void fetchMessagePart()
          Get a message part specified by PartId .
 void fetchMessageText()
          Get the message text of messages specified by the MessageSet property.
 int getAuthMechanism()
          The authentication mechanism to be used when connecting to the mail server.
 int getEndByte()
          The byte index of the position where the transfer should end.
 java.lang.String getFirewallHost()
          Name or IP address of firewall (optional).
 java.lang.String getFirewallPassword()
          A password if authentication is to be used when connecting through the firewall.
 int getFirewallPort()
          Port of the firewall to connect to.
 int getFirewallType()
          Determines the type of firewall to connect through.
 java.lang.String getFirewallUser()
          A user name if authentication is to be used connecting through a firewall.
 java.lang.String getLastReply()
          The last reply from the server.
 java.lang.String getLocalFile()
          The path to a local file for downloading the message body.
 java.lang.String getLocalHost()
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 java.lang.String getMailbox()
          Name of the mailbox selected on the server.
 void getMailboxACL()
          Gets mailbox access control rights.
 java.lang.String getMailboxFlags()
          Defined flags in the selected mailbox.
 int getMailPort()
          The port of the IMAP server (default is 143).
 java.lang.String getMailServer()
          The name or address of the mail server (IMAP server).
 java.lang.String getMessageBCc(int addressIndex)
          Array property with the list of BCc recipients of the message.
 java.lang.String getMessageCc(int addressIndex)
          Array property with the list of Cc recipients of the message.
 java.lang.String getMessageContentEncoding()
          The ContentEncoding of the selected message.
 java.lang.String getMessageContentType()
          The ContentType of the message.
 int getMessageCount()
          The total number of messages on the Mailbox .
 java.lang.String getMessageDate()
          The time the message was created.
 java.lang.String getMessageDeliveryTime()
          The time the message was delivered to the mail server.
 java.lang.String getMessageFlags()
          Contains the flags of the current message.
 java.lang.String getMessageFrom()
          The address of the author of the message.
 java.lang.String getMessageHeaders()
          RFC822-encoded headers of the message.
 java.lang.String getMessageId()
          The message id of the current message.
 java.lang.String getMessageInReplyTo()
          The unique message ID of the message this one is in reply to.
 java.lang.String getMessageNetId()
          The globally unique id of the message.
 java.lang.String getMessageReplyTo()
          Email address(s) where replies to the message should be sent.
 java.lang.String getMessageSender()
          The address of the sender of the message.
 java.lang.String getMessageSet()
          The set of messages to operate on.
 int getMessageSize()
          The size of the selected message.
 java.lang.String getMessageSubject()
          The subject of the message.
 java.lang.String getMessageText()
          The body of the retrieved message
 java.lang.String getMessageTo(int addressIndex)
          Array property with the list of direct recipients of the message.
 java.lang.String getPartId()
          The PartId of the part to retrieve.
 java.lang.String getPassword()
          The password used to authenticate to the MailServer .
 int getRecentMessageCount()
          Number of new messages on the Mailbox .
 java.lang.String getSearchCriteria()
          Search criteria to use for search operations.
 java.lang.String getSortCriteria()
          Sort criteria to use for message retrieval operations.
 byte[] getSSLAcceptServerCert()
          Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.
 byte[] getSSLCertEncoded()
          The SSL certificate (PEM/base64 encoded).
 byte[] getSSLCertStore()
          The name of the certificate store for the client certificate.
 java.lang.String getSSLCertStorePassword()
          The password for the certificate store (if any).
 int getSSLCertStoreType()
          The type of certificate store for the client certificate.
 java.lang.String getSSLCertSubject()
          The subject of the certificate used for client authentication.
 byte[] getSSLServerCert()
          The server certificate for the last established connection.
 java.lang.String getSSLServerCertStatus()
          The verification status of the server certificate for the last established connection.
 int getSSLStartMode()
          Determines how the bean starts the SSL negotiation.
 int getStartByte()
          The byte index of the position where the transfer should start.
 int getTimeout()
          A timeout for the bean.
 java.lang.String getUser()
          The user name used to authenticate to the MailServer .
 void interrupt()
          Interrupt the current method.
 boolean isConnected()
          Shows whether the bean is connected.
 boolean isIdle()
          The current status of the component.
 boolean isPeekMode()
          When set to True, the message Seen flag is not changed during reading.
 boolean isUIDMode()
          If true, permanent message id-s are used instead of the default temporary id-s.
 void listMailboxes()
          List all mailboxes matching all criteria in the Mailbox property.
 void listSubscribedMailboxes()
          List all subscribed mailboxes matching all criteria in the Mailbox property.
 java.lang.String localizeDate(java.lang.String dateTime)
          Converts a valid RFC 822 message date to local date and time.
 void moveToMailbox()
          Moves the messages specified by MessageSet to the mailbox specified by Mailbox .
 void noop()
          Sends a 'NOOP' command to the server.
 void removeImapsEventListener(ImapsEventListener l)
           
 void renameMailbox(java.lang.String newName)
          Change the name of Mailbox to NewName .
 void resetMessageFlags()
          Replace the flags of the messages specified by MessageSet with the flags specified by MessageFlags .
 void searchMailbox()
          Search selected mailbox for specified text.
 void selectMailbox()
          Select a Mailbox.
 void setAuthMechanism(int authMechanism)
          The authentication mechanism to be used when connecting to the mail server.
 void setCommand(java.lang.String command)
          Can be used to send additional commands directly to the server.
 void setConnected(boolean connected)
          Shows whether the bean is connected.
 void setEndByte(int endByte)
          The byte index of the position where the transfer should end.
 void setFirewallHost(java.lang.String firewallHost)
          Name or IP address of firewall (optional).
 void setFirewallPassword(java.lang.String firewallPassword)
          A password if authentication is to be used when connecting through the firewall.
 void setFirewallPort(int firewallPort)
          Port of the firewall to connect to.
 void setFirewallType(int firewallType)
          Determines the type of firewall to connect through.
 void setFirewallUser(java.lang.String firewallUser)
          A user name if authentication is to be used connecting through a firewall.
 void setLocalFile(java.lang.String localFile)
          The path to a local file for downloading the message body.
 void setLocalHost(java.lang.String localHost)
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 void setMailbox(java.lang.String mailbox)
          Name of the mailbox selected on the server.
 void setMailboxACL(java.lang.String user, java.lang.String rights)
          Sets mailbox access control rights for a specific user.
 void setMailPort(int mailPort)
          The port of the IMAP server (default is 143).
 void setMailServer(java.lang.String mailServer)
          The name or address of the mail server (IMAP server).
 void setMessageFlags(java.lang.String messageFlags)
          Contains the flags of the current message.
 void setMessageHeaders(java.lang.String messageHeaders)
          RFC822-encoded headers of the message.
 void setMessageSet(java.lang.String messageSet)
          The set of messages to operate on.
 void setMessageText(java.lang.String messageText)
          The body of the retrieved message
 void setPartId(java.lang.String partId)
          The PartId of the part to retrieve.
 void setPassword(java.lang.String password)
          The password used to authenticate to the MailServer .
 void setPeekMode(boolean peekMode)
          When set to True, the message Seen flag is not changed during reading.
 void setSearchCriteria(java.lang.String searchCriteria)
          Search criteria to use for search operations.
 void setSortCriteria(java.lang.String sortCriteria)
          Sort criteria to use for message retrieval operations.
 void setSSLAcceptServerCert(byte[] SSLAcceptServerCert)
          Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.
 void setSSLCertEncoded(byte[] SSLCertEncoded)
          The SSL certificate (PEM/base64 encoded).
 void setSSLCertStore(byte[] SSLCertStore)
          The name of the certificate store for the client certificate.
 void setSSLCertStorePassword(java.lang.String SSLCertStorePassword)
          The password for the certificate store (if any).
 void setSSLCertStoreType(int SSLCertStoreType)
          The type of certificate store for the client certificate.
 void setSSLCertSubject(java.lang.String SSLCertSubject)
          The subject of the certificate used for client authentication.
 void setSSLStartMode(int SSLStartMode)
          Determines how the bean starts the SSL negotiation.
 void setStartByte(int startByte)
          The byte index of the position where the transfer should start.
 void setTimeout(int timeout)
          A timeout for the bean.
 void setUIDMode(boolean UIDMode)
          If true, permanent message id-s are used instead of the default temporary id-s.
 void setUser(java.lang.String user)
          The user name used to authenticate to the MailServer .
 void subscribeMailbox()
          Subscribe to the mailbox specified by Mailbox .
 void unsetMessageFlags()
          Remove the flags specified by MessageFlags from the messages specified by MessageSet .
 void unsubscribeMailbox()
          Unsubscribe from the mailbox specified by Mailbox .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

amUserPassword

public static final int amUserPassword
See Also:
Constant Field Values

amCRAMMD5

public static final int amCRAMMD5
See Also:
Constant Field Values

fwNone

public static final int fwNone
See Also:
Constant Field Values

fwTunnel

public static final int fwTunnel
See Also:
Constant Field Values

fwSOCKS4

public static final int fwSOCKS4
See Also:
Constant Field Values

fwSOCKS5

public static final int fwSOCKS5
See Also:
Constant Field Values

sstUser

public static final int sstUser
See Also:
Constant Field Values

sstMachine

public static final int sstMachine
See Also:
Constant Field Values

sstPFXFile

public static final int sstPFXFile
See Also:
Constant Field Values

sstPFXBlob

public static final int sstPFXBlob
See Also:
Constant Field Values

sstPEMKey

public static final int sstPEMKey
See Also:
Constant Field Values

sslAutomatic

public static final int sslAutomatic
See Also:
Constant Field Values

sslImplicit

public static final int sslImplicit
See Also:
Constant Field Values

sslExplicit

public static final int sslExplicit
See Also:
Constant Field Values

sslNone

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

Imaps

public Imaps()
Method Detail

getAuthMechanism

public int getAuthMechanism()
The authentication mechanism to be used when connecting to the mail server.

By default, AuthMechanism is amUserPassword (0), and default plaintext authentication is used to login to the server. If AuthMechanism is set to amCRAMMD5 (1), the more secure CRAM-MD5 authentication is used instead.


setAuthMechanism

public void setAuthMechanism(int authMechanism)
                      throws IPWorksSSLException
The authentication mechanism to be used when connecting to the mail server.

By default, AuthMechanism is amUserPassword (0), and default plaintext authentication is used to login to the server. If AuthMechanism is set to amCRAMMD5 (1), the more secure CRAM-MD5 authentication is used instead.

IPWorksSSLException

setCommand

public void setCommand(java.lang.String command)
                throws IPWorksSSLException
Can be used to send additional commands directly to the server.

Setting the Command property directs the bean to send the assigned command to the MailServer .

Check the LastReply property and/or trap the PITrail events coming from the server to get the response(s).

IPWorksSSLException

isConnected

public boolean isConnected()
Shows whether the bean is connected.

Use this property to determine whether the bean is connected to the remote host or not.


setConnected

public void setConnected(boolean connected)
                  throws IPWorksSSLException
Shows whether the bean is connected.

Use this property to determine whether the bean is connected to the remote host or not.

IPWorksSSLException

getEndByte

public int getEndByte()
The byte index of the position where the transfer should end.

StartByte and EndByte are used together with the FetchMessagePart method to specify the portion of the message part to be retrieved from the server.

When StartByte or EndByte contain values other than the defaults (0), only the corresponding portion of the message part is retrieved from the server.

Byte indexes start from 1. The default value for EndByte is 0, which corresponds to the end of the message.


setEndByte

public void setEndByte(int endByte)
                throws IPWorksSSLException
The byte index of the position where the transfer should end.

StartByte and EndByte are used together with the FetchMessagePart method to specify the portion of the message part to be retrieved from the server.

When StartByte or EndByte contain values other than the defaults (0), only the corresponding portion of the message part is retrieved from the server.

Byte indexes start from 1. The default value for EndByte is 0, which corresponds to the end of the message.

IPWorksSSLException

getFirewallHost

public java.lang.String getFirewallHost()
Name or IP address of firewall (optional).

If a FirewallHost is given, requested connections will be authenticated through the specified firewall when connecting.

If the FirewallHost property is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the FirewallHost property is set to the corresponding address. If the search is not successful, an error is returned.


setFirewallHost

public void setFirewallHost(java.lang.String firewallHost)
                     throws IPWorksSSLException
Name or IP address of firewall (optional).

If a FirewallHost is given, requested connections will be authenticated through the specified firewall when connecting.

If the FirewallHost property is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the FirewallHost property is set to the corresponding address. If the search is not successful, an error is returned.

IPWorksSSLException

getFirewallPassword

public java.lang.String getFirewallPassword()
A password if authentication is to be used when connecting through the firewall.

if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.


setFirewallPassword

public void setFirewallPassword(java.lang.String firewallPassword)
                         throws IPWorksSSLException
A password if authentication is to be used when connecting through the firewall.

if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.

IPWorksSSLException

getFirewallPort

public int getFirewallPort()
Port of the firewall to connect to.

The TCP port for the FirewallHost . See the description of the FirewallHost property for details.

Note that the FirewallPort is set automatically when FirewallType is set to a valid value. See the description of the FirewallType property for details.


setFirewallPort

public void setFirewallPort(int firewallPort)
                     throws IPWorksSSLException
Port of the firewall to connect to.

The TCP port for the FirewallHost . See the description of the FirewallHost property for details.

Note that the FirewallPort is set automatically when FirewallType is set to a valid value. See the description of the FirewallType property for details.

IPWorksSSLException

getFirewallType

public int getFirewallType()
Determines the type of firewall to connect through.

The applicable values are the following:

fwNone (0)
No firewall (default setting).
fwTunnel (1)
Connect through a tunneling proxy. FirewallPort is set to 80.
fwSOCKS4 (2)
Connect through a SOCKS4 Proxy. FirewallPort is set to 1080.
fwSOCKS5 (3)
Connect through a SOCKS5 Proxy. FirewallPort is set to 1080.


setFirewallType

public void setFirewallType(int firewallType)
                     throws IPWorksSSLException
Determines the type of firewall to connect through.

The applicable values are the following:

fwNone (0)
No firewall (default setting).
fwTunnel (1)
Connect through a tunneling proxy. FirewallPort is set to 80.
fwSOCKS4 (2)
Connect through a SOCKS4 Proxy. FirewallPort is set to 1080.
fwSOCKS5 (3)
Connect through a SOCKS5 Proxy. FirewallPort is set to 1080.

IPWorksSSLException

getFirewallUser

public java.lang.String getFirewallUser()
A user name if authentication is to be used connecting through a firewall.

if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.


setFirewallUser

public void setFirewallUser(java.lang.String firewallUser)
                     throws IPWorksSSLException
A user name if authentication is to be used connecting through a firewall.

if FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.

IPWorksSSLException

isIdle

public boolean isIdle()
The current status of the component.

Idle will be False if the component is currently busy (communicating and/or waiting for an answer), and True at all other times.


getLastReply

public java.lang.String getLastReply()
The last reply from the server.

This is the last reply received from the server. It can be used for information purposes. The same information and more can also be retrieved through the PITrail event.


getLocalFile

public java.lang.String getLocalFile()
The path to a local file for downloading the message body. If the file exists, it is overwritten (optional).

The LocalFile property is used when retrieving a message.

If LocalFile is empty then the received data is provided through the parameters of the Transfer event.


setLocalFile

public void setLocalFile(java.lang.String localFile)
                  throws IPWorksSSLException
The path to a local file for downloading the message body. If the file exists, it is overwritten (optional).

The LocalFile property is used when retrieving a message.

If LocalFile is empty then the received data is provided through the parameters of the Transfer event.

IPWorksSSLException

getLocalHost

public java.lang.String getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.


setLocalHost

public void setLocalHost(java.lang.String localHost)
                  throws IPWorksSSLException
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.

IPWorksSSLException

getMailbox

public java.lang.String getMailbox()
Name of the mailbox selected on the server.

Also used as argument to most methods. Please refer to the bean methods for more information.

Example (Open a Mailbox in Read/Write Mode)

 IMAPControl.Mailbox = "INBOX"
 IMAPControl.SelectMailbox 

Example (Open a Mailbox in Read-Only Mode)

 IMAPControl.Mailbox = "INBOX.Folder"
 IMAPControl.ExamineMailbox 


setMailbox

public void setMailbox(java.lang.String mailbox)
                throws IPWorksSSLException
Name of the mailbox selected on the server.

Also used as argument to most methods. Please refer to the bean methods for more information.

Example (Open a Mailbox in Read/Write Mode)

 IMAPControl.Mailbox = "INBOX"
 IMAPControl.SelectMailbox 

Example (Open a Mailbox in Read-Only Mode)

 IMAPControl.Mailbox = "INBOX.Folder"
 IMAPControl.ExamineMailbox 

IPWorksSSLException

getMailboxFlags

public java.lang.String getMailboxFlags()
Defined flags in the selected mailbox.

The bean fills out MessageCount , RecentMessageCount , and MailboxFlags after connecting to the MailServer and selecting or examining a Mailbox .


getMailPort

public int getMailPort()
The port of the IMAP server (default is 143).

A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.

For implicit SSL, use port 993 (please refer to the SSLStartMode property for more information).


setMailPort

public void setMailPort(int mailPort)
                 throws IPWorksSSLException
The port of the IMAP server (default is 143).

A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.

For implicit SSL, use port 993 (please refer to the SSLStartMode property for more information).

IPWorksSSLException

getMailServer

public java.lang.String getMailServer()
The name or address of the mail server (IMAP server).

The MailServer property specifies the IP address (IP number in dotted internet format) or Domain Name of the mail server. It must be set before a connection is attempted and cannot be changed once a connection is in progress.

If the MailServer property is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the MailServer property is set to the corresponding address. If the search is not successful, an error is returned.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with a "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.


setMailServer

public void setMailServer(java.lang.String mailServer)
                   throws IPWorksSSLException
The name or address of the mail server (IMAP server).

The MailServer property specifies the IP address (IP number in dotted internet format) or Domain Name of the mail server. It must be set before a connection is attempted and cannot be changed once a connection is in progress.

If the MailServer property is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the MailServer property is set to the corresponding address. If the search is not successful, an error is returned.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with a "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

IPWorksSSLException

getMessageBCc

public java.lang.String getMessageBCc(int addressIndex)
                               throws IPWorksSSLException
Array property with the list of BCc recipients of the message.

Recipient addresses are provided in the array starting from index 0 and going up. After the last address, empty strings are returned.

The BCc addresses are never shown to any of the recipients of the message but are stored in the original outgoing message.

IPWorksSSLException

getMessageCc

public java.lang.String getMessageCc(int addressIndex)
                              throws IPWorksSSLException
Array property with the list of Cc recipients of the message.

Recipient addresses are provided in the array starting from index 0 and going up. After the last address, empty strings are returned.

IPWorksSSLException

getMessageContentEncoding

public java.lang.String getMessageContentEncoding()
The ContentEncoding of the selected message.

The property is automatically set by the bean when message information is retrieved via the FetchMessageInfo method.


getMessageContentType

public java.lang.String getMessageContentType()
The ContentType of the message.

The MessageContentType property denotes the type of content contained in the message, such as plain, multipart, multipart/alternative etc. You may also need to check the MessageContentEncoding property or read the individual message parts.


getMessageCount

public int getMessageCount()
The total number of messages on the Mailbox .

The bean fills out MessageCount , RecentMessageCount , and MailboxFlags after connecting to the MailServer and selecting or examining a Mailbox .


getMessageDate

public java.lang.String getMessageDate()
The time the message was created.

The MessageDate holds the date and time when the message was created.

RFC 822 contains detailed date format specifications. An example of a valid date is "Fri, 1 Mar 96 21:24:52 EST".


getMessageDeliveryTime

public java.lang.String getMessageDeliveryTime()
The time the message was delivered to the mail server.

The time format is defined in RFC821.


getMessageFlags

public java.lang.String getMessageFlags()
Contains the flags of the current message.

Contains the flags of the current message. It is also used to specify flags when AppendToMailbox is called.

Examples of possible flag values are server dependent, but can include:

\\Deleted
Mark a message as deleted (for removal by later ExpungeMailbox ).
\\Seen \011
Mark a message as read.
\\Answered
Mark a message as answered.
\\Flagged\011
Mark a message as flagged.
\\Draft \011
Mark a message as being incomplete (under composition).
Example (Setting MessageFlags)

 IMAPControl.MessageSet = "1"
 IMAPControl.AddMessageFlags("\\Deleted") 


setMessageFlags

public void setMessageFlags(java.lang.String messageFlags)
                     throws IPWorksSSLException
Contains the flags of the current message.

Contains the flags of the current message. It is also used to specify flags when AppendToMailbox is called.

Examples of possible flag values are server dependent, but can include:

\\Deleted
Mark a message as deleted (for removal by later ExpungeMailbox ).
\\Seen \011
Mark a message as read.
\\Answered
Mark a message as answered.
\\Flagged\011
Mark a message as flagged.
\\Draft \011
Mark a message as being incomplete (under composition).
Example (Setting MessageFlags)

 IMAPControl.MessageSet = "1"
 IMAPControl.AddMessageFlags("\\Deleted") 

IPWorksSSLException

getMessageFrom

public java.lang.String getMessageFrom()
The address of the author of the message.

MessageFrom normally has the same value as MessageSender .

There are cases when a message may have more than one From address. If this is the case, the addresses are provided in the MessageFrom property separated by commas.


getMessageHeaders

public java.lang.String getMessageHeaders()
RFC822-encoded headers of the message.

This property holds the full headers of the message in RFC822 format. The headers are retrieved by calling the FetchMessageHeaders method.


setMessageHeaders

public void setMessageHeaders(java.lang.String messageHeaders)
                       throws IPWorksSSLException
RFC822-encoded headers of the message.

This property holds the full headers of the message in RFC822 format. The headers are retrieved by calling the FetchMessageHeaders method.

IPWorksSSLException

getMessageId

public java.lang.String getMessageId()
The message id of the current message.

The bean fills out the MessageId property when message information is retrieved from the MailServer .

The id is permanent if UIDMode is set, and temporary otherwise.


getMessageInReplyTo

public java.lang.String getMessageInReplyTo()
The unique message ID of the message this one is in reply to.

The bean fills out MessageInReplyTo with the value of the In-Reply-To: message header.

This value can be useful when threading messages by referring to the message you are replying to.

The unique message Id of the message itself is given by the MessageNetId property.


getMessageNetId

public java.lang.String getMessageNetId()
The globally unique id of the message.

The bean fills the MessageId with the value of the Message-Id: header. This is a globally unique value normally created by the first mail server the message is sent to.


getMessageReplyTo

public java.lang.String getMessageReplyTo()
Email address(s) where replies to the message should be sent.

There are cases when a message may have more than one Reply-To address. If this is the case, the addresses are provided in the MessageReplyTo property separated by commas.


getMessageSender

public java.lang.String getMessageSender()
The address of the sender of the message.

MessageSender has normally the same value as MessageFrom .

There are cases when a message may have more than one sender. If this is the case, the addresses are provided in the MessageSender property separated by commas.


getMessageSet

public java.lang.String getMessageSet()
The set of messages to operate on.

Used as an argument to most method calls.

It may consist of a single message number, a range of messages specified by two message numbers separated by ':' (e.g. "1:5"), and/or individual message numbers separated by ',' (e.g. "1:5,7,10").

Example (Setting MessageSet)

 IMAPControl.MessageSet = "1"
 IMAPControl.FetchMessageInfo()
 
 IMAPControl.MessageSet = "1:5"
 IMAPControl.FetchMessageInfo()
 
 IMAPControl.MessageSet = "1,5,7"
 IMAPControl.FetchMessageInfo() 


setMessageSet

public void setMessageSet(java.lang.String messageSet)
                   throws IPWorksSSLException
The set of messages to operate on.

Used as an argument to most method calls.

It may consist of a single message number, a range of messages specified by two message numbers separated by ':' (e.g. "1:5"), and/or individual message numbers separated by ',' (e.g. "1:5,7,10").

Example (Setting MessageSet)

 IMAPControl.MessageSet = "1"
 IMAPControl.FetchMessageInfo()
 
 IMAPControl.MessageSet = "1:5"
 IMAPControl.FetchMessageInfo()
 
 IMAPControl.MessageSet = "1,5,7"
 IMAPControl.FetchMessageInfo() 

IPWorksSSLException

getMessageSize

public int getMessageSize()
The size of the selected message.

The bean fills out the MessageSize property when message information is retrieved from the MailServer .


getMessageSubject

public java.lang.String getMessageSubject()
The subject of the message.

The bean fills out the MessageSubject property when message information is retrieved from the MailServer .


getMessageText

public java.lang.String getMessageText()
The body of the retrieved message

The bean fills out MessageText with the contents of the message body (in RFC822 format) when a call to FetchMessageText completes successfully.


setMessageText

public void setMessageText(java.lang.String messageText)
                    throws IPWorksSSLException
The body of the retrieved message

The bean fills out MessageText with the contents of the message body (in RFC822 format) when a call to FetchMessageText completes successfully.

IPWorksSSLException

getMessageTo

public java.lang.String getMessageTo(int addressIndex)
                              throws IPWorksSSLException
Array property with the list of direct recipients of the message.

Recipient addresses are provided in the array starting from index 0 and going up. After the last address, empty strings are returned.

IPWorksSSLException

getPartId

public java.lang.String getPartId()
The PartId of the part to retrieve.

The bean will retrieve the part specified in PartId when FetchMessagePart is called.

The part id-s of each message part (if any) are provided through the corresponding MessagePart events.


setPartId

public void setPartId(java.lang.String partId)
               throws IPWorksSSLException
The PartId of the part to retrieve.

The bean will retrieve the part specified in PartId when FetchMessagePart is called.

The part id-s of each message part (if any) are provided through the corresponding MessagePart events.

IPWorksSSLException

getPassword

public java.lang.String getPassword()
The password used to authenticate to the MailServer .

Both the User and Password properties must be set before connecting to the MailServer .


setPassword

public void setPassword(java.lang.String password)
                 throws IPWorksSSLException
The password used to authenticate to the MailServer .

Both the User and Password properties must be set before connecting to the MailServer .

IPWorksSSLException

isPeekMode

public boolean isPeekMode()
When set to True, the message Seen flag is not changed during reading.

When PeekMode is True, a "PEEK" option is added to all IMAP FETCH commands sent to the server. An RFC compliant IMAP server should not set the "Seen" flag on the message in this case.


setPeekMode

public void setPeekMode(boolean peekMode)
                 throws IPWorksSSLException
When set to True, the message Seen flag is not changed during reading.

When PeekMode is True, a "PEEK" option is added to all IMAP FETCH commands sent to the server. An RFC compliant IMAP server should not set the "Seen" flag on the message in this case.

IPWorksSSLException

getRecentMessageCount

public int getRecentMessageCount()
Number of new messages on the Mailbox .

The bean fills out MessageCount , RecentMessageCount , and MailboxFlags after connecting to the MailServer and selecting or examining a Mailbox .


getSearchCriteria

public java.lang.String getSearchCriteria()
Search criteria to use for search operations.

The exact format of the search criteria is specified by the IMAP RFCs. The string consists of one or more search keys and their corresponding values (if any) separated by spaces, for example: "SINCE 1-Feb-1994 NOT FROM Smith".

Possible search keys include:

<message set>
Messages with message sequence numbers corresponding to the specified message sequence number set
ALL
All messages in the mailbox - this is the default initial key for AND-ing.
ANSWERED
Messages with the \\Answered flag set.
BCC <string>
Messages that contain the specified string in the envelope structure's BCC field.
BEFORE <date>
Messages whose internal date is earlier than the specified date.
BODY <string>
Messages that contain the specified string in the body of the message.
CC <string>
Messages that contain the specified string in the envelope structure's CC field.
DELETED
Messages with the \\Deleted flag set.
DRAFT
Messages with the \\Draft flag set.
FLAGGED
Messages with the \\Flagged flag set.
FROM <string>
Messages that contain the specified string in the envelope structure's FROM field.
HEADER <field-name> <string>
Messages that have a header with the specified field-name (as defined in [RFC-822]) and that contains the specified string in the [RFC-822] field-body.
KEYWORD <flag>
Messages with the specified keyword set.
LARGER <n>
Messages with an RFC822.SIZE larger than the specified number of octets.
NEW
Messages that have the \\Recent flag set but not the \\Seen flag. This is functionally equivalent to "(RECENT UNSEEN)".
NOT <search-key>
Messages that do not match the specified search key.
OLD
Messages that do not have the \\Recent flag set. This is functionally equivalent to "NOT RECENT" (as opposed to "NOT NEW").
ON <date>
Messages whose internal date is within the specified date.
OR <search-key1> <search-key2>
Messages that match either search key.
RECENT
Messages that have the \\Recent flag set.
SEEN
Messages that have the \\Seen flag set.
SENTBEFORE <date>
Messages whose [RFC-822] Date: header is earlier than the specified date.
SENTON <date>
Messages whose [RFC-822] Date: header is within the specified date.
SENTSINCE <date>
Messages whose [RFC-822] Date: header is within or later than the specified date.
SINCE <date>
Messages whose internal date is within or later than the specified date.
SMALLER <n>
Messages with an RFC822.SIZE smaller than the specified number of octets.
SUBJECT <string>
Messages that contain the specified string in the envelope structure's SUBJECT field.
TEXT <string>
Messages that contain the specified string in the header or body of the message.
TO <string>
Messages that contain the specified string in the envelope structure's TO field.
UID <message set>
Messages with unique identifiers corresponding to the specified unique identifier set.
UNANSWERED
Messages that do not have the \\Answered flag set.
UNDELETED
Messages that do not have the \\Deleted flag set.
UNDRAFT
Messages that do not have the \\Draft flag set.
UNFLAGGED
Messages that do not have the \\Flagged flag set.
UNKEYWORD <flag>
Messages that do not have the specified keyword set.
UNSEEN
Messages that do not have the \\Seen flag set.


setSearchCriteria

public void setSearchCriteria(java.lang.String searchCriteria)
                       throws IPWorksSSLException
Search criteria to use for search operations.

The exact format of the search criteria is specified by the IMAP RFCs. The string consists of one or more search keys and their corresponding values (if any) separated by spaces, for example: "SINCE 1-Feb-1994 NOT FROM Smith".

Possible search keys include:

<message set>
Messages with message sequence numbers corresponding to the specified message sequence number set
ALL
All messages in the mailbox - this is the default initial key for AND-ing.
ANSWERED
Messages with the \\Answered flag set.
BCC <string>
Messages that contain the specified string in the envelope structure's BCC field.
BEFORE <date>
Messages whose internal date is earlier than the specified date.
BODY <string>
Messages that contain the specified string in the body of the message.
CC <string>
Messages that contain the specified string in the envelope structure's CC field.
DELETED
Messages with the \\Deleted flag set.
DRAFT
Messages with the \\Draft flag set.
FLAGGED
Messages with the \\Flagged flag set.
FROM <string>
Messages that contain the specified string in the envelope structure's FROM field.
HEADER <field-name> <string>
Messages that have a header with the specified field-name (as defined in [RFC-822]) and that contains the specified string in the [RFC-822] field-body.
KEYWORD <flag>
Messages with the specified keyword set.
LARGER <n>
Messages with an RFC822.SIZE larger than the specified number of octets.
NEW
Messages that have the \\Recent flag set but not the \\Seen flag. This is functionally equivalent to "(RECENT UNSEEN)".
NOT <search-key>
Messages that do not match the specified search key.
OLD
Messages that do not have the \\Recent flag set. This is functionally equivalent to "NOT RECENT" (as opposed to "NOT NEW").
ON <date>
Messages whose internal date is within the specified date.
OR <search-key1> <search-key2>
Messages that match either search key.
RECENT
Messages that have the \\Recent flag set.
SEEN
Messages that have the \\Seen flag set.
SENTBEFORE <date>
Messages whose [RFC-822] Date: header is earlier than the specified date.
SENTON <date>
Messages whose [RFC-822] Date: header is within the specified date.
SENTSINCE <date>
Messages whose [RFC-822] Date: header is within or later than the specified date.
SINCE <date>
Messages whose internal date is within or later than the specified date.
SMALLER <n>
Messages with an RFC822.SIZE smaller than the specified number of octets.
SUBJECT <string>
Messages that contain the specified string in the envelope structure's SUBJECT field.
TEXT <string>
Messages that contain the specified string in the header or body of the message.
TO <string>
Messages that contain the specified string in the envelope structure's TO field.
UID <message set>
Messages with unique identifiers corresponding to the specified unique identifier set.
UNANSWERED
Messages that do not have the \\Answered flag set.
UNDELETED
Messages that do not have the \\Deleted flag set.
UNDRAFT
Messages that do not have the \\Draft flag set.
UNFLAGGED
Messages that do not have the \\Flagged flag set.
UNKEYWORD <flag>
Messages that do not have the specified keyword set.
UNSEEN
Messages that do not have the \\Seen flag set.

IPWorksSSLException

getSortCriteria

public java.lang.String getSortCriteria()
Sort criteria to use for message retrieval operations.

When set, the bean will send the SORT command to the server before any retrieval. If the server supports the SORT command, the results from the fetch operation will be sorted according to SortCriteria . The format of the SortCriteria property consists of a parenthesized list of one or more sort keys.

Example (Setting SortCriteria)

 IMAPControl.SortCriteria = "DATE"
 
 IMAPControl.SortCriteria = "SUBJECT FROM"
 
 IMAPControl.SortCriteria = "REVERSE SUBJECT" 

Possible sort keys include:

ARRIVAL
Internal date and time of the message.
DATE
The value of the message's DATE header, adjusted by time zone
CC
The value of the message's CC header.
FROM
The value of the message's FROM header.
SUBJECT
The value of the message's SUBJECT header.
TO
The value of the message's TO header.
SIZE
The size of the message
REVERSE <criterion>
Followed by another sort criterion, has the effect of that criterion but in reverse (descending) order

Please note that IMAP SORT functionality is relatively new and not all servers may implement it.


setSortCriteria

public void setSortCriteria(java.lang.String sortCriteria)
                     throws IPWorksSSLException
Sort criteria to use for message retrieval operations.

When set, the bean will send the SORT command to the server before any retrieval. If the server supports the SORT command, the results from the fetch operation will be sorted according to SortCriteria . The format of the SortCriteria property consists of a parenthesized list of one or more sort keys.

Example (Setting SortCriteria)

 IMAPControl.SortCriteria = "DATE"
 
 IMAPControl.SortCriteria = "SUBJECT FROM"
 
 IMAPControl.SortCriteria = "REVERSE SUBJECT" 

Possible sort keys include:

ARRIVAL
Internal date and time of the message.
DATE
The value of the message's DATE header, adjusted by time zone
CC
The value of the message's CC header.
FROM
The value of the message's FROM header.
SUBJECT
The value of the message's SUBJECT header.
TO
The value of the message's TO header.
SIZE
The size of the message
REVERSE <criterion>
Followed by another sort criterion, has the effect of that criterion but in reverse (descending) order

Please note that IMAP SORT functionality is relatively new and not all servers may implement it.

IPWorksSSLException

getSSLAcceptServerCert

public byte[] getSSLAcceptServerCert()
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.

If it finds any issues with the certificate presented by the server, the bean will normally terminate the connection with an error.

You may override this behavior by supplying a value for SSLAcceptServerCert . If the certificate supplied in SSLAcceptServerCert is the same as the certificate presented by the server, then the server certificate is accepted unconditionally, and the connection will continue normally.

Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, these property will create a security breach. Use it at your own risk.


setSSLAcceptServerCert

public void setSSLAcceptServerCert(byte[] SSLAcceptServerCert)
                            throws IPWorksSSLException
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.

If it finds any issues with the certificate presented by the server, the bean will normally terminate the connection with an error.

You may override this behavior by supplying a value for SSLAcceptServerCert . If the certificate supplied in SSLAcceptServerCert is the same as the certificate presented by the server, then the server certificate is accepted unconditionally, and the connection will continue normally.

Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, these property will create a security breach. Use it at your own risk.

IPWorksSSLException

getSSLCertEncoded

public byte[] getSSLCertEncoded()
The SSL certificate (PEM/base64 encoded).

This property is used to assign a specific certificate for SSL client authentication (SSL server authentication in the case of the IPDaemonS bean). The SSLCertStore and SSLCertSubject properties may also be used to specify a certificate.

When SSLCertEncoded is set, a search is initiated in the current SSLCertStore for the private key of the certificate. If the key is found, SSLCertSubject is updated to reflect the full subject of the selected certificate, otherwise SSLCertSubject is set to empty string.


setSSLCertEncoded

public void setSSLCertEncoded(byte[] SSLCertEncoded)
                       throws IPWorksSSLException
The SSL certificate (PEM/base64 encoded).

This property is used to assign a specific certificate for SSL client authentication (SSL server authentication in the case of the IPDaemonS bean). The SSLCertStore and SSLCertSubject properties may also be used to specify a certificate.

When SSLCertEncoded is set, a search is initiated in the current SSLCertStore for the private key of the certificate. If the key is found, SSLCertSubject is updated to reflect the full subject of the selected certificate, otherwise SSLCertSubject is set to empty string.

IPWorksSSLException

getSSLCertStore

public byte[] getSSLCertStore()
The name of the certificate store for the client certificate.

The SSLCertStoreType property specifies the type of the certificate store specified by SSLCertStore . If the store is password protected, specify the password in SSLCertStorePassword .

SSLCertStore is used in conjunction with the SSLCertSubject property in order to specify client certificates. If SSLCertStore has a value, and SSLCertSubject or SSLCertEncoded is set, a search for a certificate is initiated. Please refer to the SSLCertSubject property for details.

Designations of certificate stores are platform-dependent.

The following are designations of the most common User and Machine certificate stores in Windows:

MY
A certificate store holding personal certificates with their associated private keys.
CA
Certifying authority certificates.
ROOT
Root certificates.
SPC
Software publisher certificates.

In Java, the certificate store normally is a file containing certificates and optional private keys.

When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).

If the provider is OpenSSL, the certificate store is a file containing a certificate and a private key. This property must be set to the name of the file.


setSSLCertStore

public void setSSLCertStore(byte[] SSLCertStore)
                     throws IPWorksSSLException
The name of the certificate store for the client certificate.

The SSLCertStoreType property specifies the type of the certificate store specified by SSLCertStore . If the store is password protected, specify the password in SSLCertStorePassword .

SSLCertStore is used in conjunction with the SSLCertSubject property in order to specify client certificates. If SSLCertStore has a value, and SSLCertSubject or SSLCertEncoded is set, a search for a certificate is initiated. Please refer to the SSLCertSubject property for details.

Designations of certificate stores are platform-dependent.

The following are designations of the most common User and Machine certificate stores in Windows:

MY
A certificate store holding personal certificates with their associated private keys.
CA
Certifying authority certificates.
ROOT
Root certificates.
SPC
Software publisher certificates.

In Java, the certificate store normally is a file containing certificates and optional private keys.

When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).

If the provider is OpenSSL, the certificate store is a file containing a certificate and a private key. This property must be set to the name of the file.

IPWorksSSLException

getSSLCertStorePassword

public java.lang.String getSSLCertStorePassword()
The password for the certificate store (if any).

If the certificate store is of a type that requires a password, the value of this property is used to open the certificate store.


setSSLCertStorePassword

public void setSSLCertStorePassword(java.lang.String SSLCertStorePassword)
                             throws IPWorksSSLException
The password for the certificate store (if any).

If the certificate store is of a type that requires a password, the value of this property is used to open the certificate store.

IPWorksSSLException

getSSLCertStoreType

public int getSSLCertStoreType()
The type of certificate store for the client certificate.

This property can take one of the following values:

0 (sstUser - default)
For Windows, this specifies that the certificate store is a certificate store owned by the current user. For Java, this specifies that the certificate store is the name of a JKS (Java Key Store) file. If the provider is OpenSSL, this specifies that the certificate store is a file that contains PEM encoded certificate and private key.
1 (sstMachine)
The certificate store is a machine store (not available in Java and when provider is OpenSSL).
2 (sstPFXFile)
The certificate store is the name of a PFX (PKCS12) file containing certificates. If the provider is OpenSSL, the file may contain only one certificate and private key.
3 (sstPFXBlob)
The certificate store is a string (binary or base64 encoded) representing a certificate store in PFX (PKCS12) format.This setting is currently not supported when the provider is OpenSSL.

4 (sstPEMKey)
The certificate store is a string or filename that contains a PEM encoded certificate and private key.This store type is currently not supported in Java.


setSSLCertStoreType

public void setSSLCertStoreType(int SSLCertStoreType)
                         throws IPWorksSSLException
The type of certificate store for the client certificate.

This property can take one of the following values:

0 (sstUser - default)
For Windows, this specifies that the certificate store is a certificate store owned by the current user. For Java, this specifies that the certificate store is the name of a JKS (Java Key Store) file. If the provider is OpenSSL, this specifies that the certificate store is a file that contains PEM encoded certificate and private key.
1 (sstMachine)
The certificate store is a machine store (not available in Java and when provider is OpenSSL).
2 (sstPFXFile)
The certificate store is the name of a PFX (PKCS12) file containing certificates. If the provider is OpenSSL, the file may contain only one certificate and private key.
3 (sstPFXBlob)
The certificate store is a string (binary or base64 encoded) representing a certificate store in PFX (PKCS12) format.This setting is currently not supported when the provider is OpenSSL.

4 (sstPEMKey)
The certificate store is a string or filename that contains a PEM encoded certificate and private key.This store type is currently not supported in Java.

IPWorksSSLException

getSSLCertSubject

public java.lang.String getSSLCertSubject()
The subject of the certificate used for client authentication.

When this property is set, a search is performed in the current certificate store certificate with matching subject.

If an exact match is not found, the store is searched for subjects containing the value of the property.

When setting the property to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US

Example (Searching with partial subject)

 Control.CertSubject = "Test" 

If a match is not found, the property is set to an empty string, and no certificate is selected.

The special value "*" picks a random certificate in the certificate store.

If a matching certificate is found, the SSLCertSubject property is set to the full subject of the matching certificate.


setSSLCertSubject

public void setSSLCertSubject(java.lang.String SSLCertSubject)
                       throws IPWorksSSLException
The subject of the certificate used for client authentication.

When this property is set, a search is performed in the current certificate store certificate with matching subject.

If an exact match is not found, the store is searched for subjects containing the value of the property.

When setting the property to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US

Example (Searching with partial subject)

 Control.CertSubject = "Test" 

If a match is not found, the property is set to an empty string, and no certificate is selected.

The special value "*" picks a random certificate in the certificate store.

If a matching certificate is found, the SSLCertSubject property is set to the full subject of the matching certificate.

IPWorksSSLException

getSSLServerCert

public byte[] getSSLServerCert()
The server certificate for the last established connection.

SSLServerCert contains the server certificate for the last established connection.

SSLServerCert is reset every time a new connection is attempted.


getSSLServerCertStatus

public java.lang.String getSSLServerCertStatus()
The verification status of the server certificate for the last established connection.

When the verification fails, SSLServerCertStatus contains a string that indicates the reason(s) why, otherwise, it contains the string "OK".

Please note that the value of SSLServerCertStatus must be considered as only a suggestion as to the validity of the certificate. Application software must use its own logic to determine whether to accept the certificate or not, by using the SSLServerCert to access other certificate properties, or other application-specific information.

SSLServerCertStatus is reset an empty string every time a new connection is attempted.


getSSLStartMode

public int getSSLStartMode()
Determines how the bean starts the SSL negotiation.

The SSLStartMode property may have one of the following values:

0 (sslAutomatic - default)
If the remote port is set to the standard plaintext port of the protocol (where applicable), the bean will behave the same as if SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit ( sslImplicit ).
1 (sslImplicit)
The SSL negotiation will start immediately after the connection is established.
2 (sslExplicit)
The bean will first connect in plaintext, and then explicitly start SSL negotiation through a protocol command such as STARTTLS.
3 (sslNone)
No SSL negotiation, no SSL security. All communication will be in plaintext mode.


setSSLStartMode

public void setSSLStartMode(int SSLStartMode)
                     throws IPWorksSSLException
Determines how the bean starts the SSL negotiation.

The SSLStartMode property may have one of the following values:

0 (sslAutomatic - default)
If the remote port is set to the standard plaintext port of the protocol (where applicable), the bean will behave the same as if SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit ( sslImplicit ).
1 (sslImplicit)
The SSL negotiation will start immediately after the connection is established.
2 (sslExplicit)
The bean will first connect in plaintext, and then explicitly start SSL negotiation through a protocol command such as STARTTLS.
3 (sslNone)
No SSL negotiation, no SSL security. All communication will be in plaintext mode.

IPWorksSSLException

getStartByte

public int getStartByte()
The byte index of the position where the transfer should start.

StartByte and EndByte are used together with the FetchMessagePart method to specify the portion of the message part to be retrieved from the server.

When StartByte or EndByte contain values other than the defaults (0), only the corresponding portion of the message part is retrieved from the server.

Byte indexes start from 1. The default value for EndByte is 0, which corresponds to the end of the message.


setStartByte

public void setStartByte(int startByte)
                  throws IPWorksSSLException
The byte index of the position where the transfer should start.

StartByte and EndByte are used together with the FetchMessagePart method to specify the portion of the message part to be retrieved from the server.

When StartByte or EndByte contain values other than the defaults (0), only the corresponding portion of the message part is retrieved from the server.

Byte indexes start from 1. The default value for EndByte is 0, which corresponds to the end of the message.

IPWorksSSLException

getTimeout

public int getTimeout()
A timeout for the bean.

If the Timeout property is set to 0, all operations will run uninterrupted until successful completion, or an error condition is encountered.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an IPWorksException raises an IPWorksException exception .

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by theAbsoluteTimeoutconfiguration setting.

The default value for the Timeout property is 60 (seconds).


setTimeout

public void setTimeout(int timeout)
                throws IPWorksSSLException
A timeout for the bean.

If the Timeout property is set to 0, all operations will run uninterrupted until successful completion, or an error condition is encountered.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an IPWorksException raises an IPWorksException exception .

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by theAbsoluteTimeoutconfiguration setting.

The default value for the Timeout property is 60 (seconds).

IPWorksSSLException

isUIDMode

public boolean isUIDMode()
If true, permanent message id-s are used instead of the default temporary id-s.

Normally, the IMAP server uses temporary message id-s that are valid only during the current session. If UIDMode is true, permanent message id-s are used instead.

The IMAP protocol operations where UID mode is used are the following: COPY , FETCH , STORE , SEARCH .


setUIDMode

public void setUIDMode(boolean UIDMode)
                throws IPWorksSSLException
If true, permanent message id-s are used instead of the default temporary id-s.

Normally, the IMAP server uses temporary message id-s that are valid only during the current session. If UIDMode is true, permanent message id-s are used instead.

The IMAP protocol operations where UID mode is used are the following: COPY , FETCH , STORE , SEARCH .

IPWorksSSLException

getUser

public java.lang.String getUser()
The user name used to authenticate to the MailServer .

Both the User and Password properties must be set before connecting to the MailServer .


setUser

public void setUser(java.lang.String user)
             throws IPWorksSSLException
The user name used to authenticate to the MailServer .

Both the User and Password properties must be set before connecting to the MailServer .

IPWorksSSLException

config

public java.lang.String config(java.lang.String configurationString)
                        throws IPWorksSSLException
Sets or retrieves a beanconfiguration setting.

Config is a generic method available in every bean. It is used to set and retrieveconfiguration settingsfor the bean.

Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY , you must call Config("PROPERTY=VALUE") , where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.

IPWorksSSLException

addMessageFlags

public void addMessageFlags(java.lang.String flags)
                     throws IPWorksSSLException
Add the specified flags to the messages specified by MessageSet .

Add the specified flags to the messages specified by the MessageSet property. The format of the flags is specified by the IMAP RFCs.

Examples of possible flag values are server dependent, but can include:

\\Deleted
Mark a message as deleted (for removal by later ExpungeMailbox ).
\\Seen \011
Mark a message as read.
\\Answered
Mark a message as answered.
\\Flagged\011
Mark a message as flagged.
\\Draft \011
Mark a message as being incomplete (under composition).
Example (Setting Adding Message Flags)

 IMAPControl.MessageSet = "1"
 IMAPControl.AddMessageFlags("\\Deleted") 

IPWorksSSLException

appendToMailbox

public void appendToMailbox()
                     throws IPWorksSSLException
Appends the message in MessageText to the mailbox specified by Mailbox .

Appends the RFC822-encoded message in MessageText to the mailbox specified by Mailbox . If the MessageFlags property is not an empty string, it's contents are supplied with the 'APPEND' command sent to the server.

Example (Append Message to Mailbox)

 IMAPControl.MessageText = MessageHeaders + CRLF + CRLF + MessageBody + CRLF
 IMAPControl.Mailbox = "INBOX"
 IMAPControl.MessageFlags = "\\Deleted"
 IMAPControl.AppendToMailbox() 

IPWorksSSLException

checkMailbox

public void checkMailbox()
                  throws IPWorksSSLException
Sends a 'CHECK' command to the server.

Sends a 'CHECK' command to the server, asking it to perform any necessary 'housekeeping' operations on, and update the state of the currently selected mailbox.

IPWorksSSLException

closeMailbox

public void closeMailbox()
                  throws IPWorksSSLException
Remove all messages marked with 'Deleted' flag from the currently selected mailbox and unselect mailbox.

Permanently remove all messages that have the 'Deleted' flag set from the current (selected) mailbox, and then close (deselect) the mailbox.

IPWorksSSLException

connect

public void connect()
             throws IPWorksSSLException
Connect to an IMAP server.

Connect to the IMAP server specified by MailServer and authenticate using the user name and password supplied in the User and Password properties.

Example (Connect IMAP Server)

 IMAPControl.MailServer = "myserver"
 IMAPControl.Mailbox = "INBOX"
 IMAPControl.User = "myusername"
 IMAPControl.Password = "mypassword"
 IMAPControl.Connect()
 
 IMAPControl.MailServer = "myserver"
 IMAPControl.Mailbox = "DOMAIN/USERNT/INBOX"
 IMAPControl.User = "myusername"
 IMAPControl.Password = "mypassword"
 IMAPControl.Connect() 

IPWorksSSLException

copyToMailbox

public void copyToMailbox()
                   throws IPWorksSSLException
Copies the messages specified by MessageSet to the mailbox specified by Mailbox .

Copies the messages specified by the MessageSet property to the mailbox specified by the Mailbox property.

IPWorksSSLException

createMailbox

public void createMailbox()
                   throws IPWorksSSLException
Create a new mailbox specified by Mailbox .

Create a new mailbox. The mailbox name is specified by the Mailbox property.

IPWorksSSLException

deleteFromMailbox

public void deleteFromMailbox()
                       throws IPWorksSSLException
Marks the messages specified by MessageSet as deleted.

Calling the DeleteFromMailbox method is equivalent to calling AddMessageFlags with "\\Deleted" as the Flags parameter.

IPWorksSSLException

deleteMailbox

public void deleteMailbox()
                   throws IPWorksSSLException
Delete a mailbox specified by Mailbox .

Delete a mailbox. The mailbox name is specified by the Mailbox property.

IPWorksSSLException

deleteMailboxACL

public void deleteMailboxACL(java.lang.String user)
                      throws IPWorksSSLException
Deletes mailbox access control rights for a specific user.

Ask the server to remove all rights associated with User from the mailbox specified in the Mailbox property. Refer to SetMailboxACL and GetMailboxACL for more information on mailbox access rights.

IPWorksSSLException

disconnect

public void disconnect()
                throws IPWorksSSLException
Disconnect from an IMAP server.

Logout and disconnect from the IMAP server.

IPWorksSSLException

doEvents

public void doEvents()
              throws IPWorksSSLException
Processes events from the internal message queue.

When DoEvents is called, the bean processes any available events. If no events are available, it waits for a preset period of time, and then returns.

IPWorksSSLException

examineMailbox

public void examineMailbox()
                    throws IPWorksSSLException
Select a Mailbox (Read-only mode).

Ask the server to select the mailbox specified in the Mailbox property in read-only mode.

Example (Open a Mailbox in Read/Write Mode)

 IMAPControl.Mailbox = "INBOX"
 IMAPControl.SelectMailbox 

Example (Open a Mailbox in Read-Only Mode)

 IMAPControl.Mailbox = "INBOX.Folder"
 IMAPControl.ExamineMailbox 

IPWorksSSLException

expungeMailbox

public void expungeMailbox()
                    throws IPWorksSSLException
Remove all messages marked with 'Deleted' flag from the currently selected mailbox.

Permanently remove all messages that have the 'Deleted' flag set from the current (selected) mailbox. Example (Set "Deleted" flag and Expunge)

 IMAPControl.MessageSet = "1"
 IMAPControl.AddMessageFlags("\\Deleted")
 IMAPControl.ExpungeMailbox() 

IPWorksSSLException

fetchMessageHeaders

public void fetchMessageHeaders()
                         throws IPWorksSSLException
Get the message headers of messages specified by the MessageSet property.

Retrieves RFC822 headers of the message specified by MessageSet and stores them in the MessageHeaders property.

IPWorksSSLException

fetchMessageInfo

public void fetchMessageInfo()
                      throws IPWorksSSLException
Get information about messages specified by the MessageSet property.

Retrieves message information for the messages specified by the MessageSet property. This includes information about the message envelope as well as message structure. Every time a message envelope is retrieved, a MessageInfo event is fired, and message envelope information is stored in properties such as: MessageSubject , MessageFrom , MessageTo , MessageCc , etc.. If the message is a multipart message, one or more MessagePart events are fired before the MessageInfo event - one for each message part.

IPWorksSSLException

fetchMessagePart

public void fetchMessagePart()
                      throws IPWorksSSLException
Get a message part specified by PartId .

Retrieves the contents of the message part specified by the PartId property of the message specified by the MessageSet property. If the LocalFile property contains a file name, the message part is stored in LocalFile , and the Transfer events denote the progress. If the LocalFile property contains an empty string, the message part is stored in the MessageText property, as well as provided through the Transfer event.

IPWorksSSLException

fetchMessageText

public void fetchMessageText()
                      throws IPWorksSSLException
Get the message text of messages specified by the MessageSet property.

Retrieves the RFC822-encoded text of the message specified by MessageSet . If the LocalFile property contains a file name, the text is stored in LocalFile , and the Transfer events denote the progress. If the LocalFile property contains an empty string, the text is stored in the MessageText property, as well as provided through the Transfer event.

IPWorksSSLException

getMailboxACL

public void getMailboxACL()
                   throws IPWorksSSLException
Gets mailbox access control rights.

Mailbox rights are provided through one or more MailboxACL events.

IPWorksSSLException

interrupt

public void interrupt()
               throws IPWorksSSLException
Interrupt the current method.

If there is no method in progress, Interrupt simply returns doing nothing.

IPWorksSSLException

listMailboxes

public void listMailboxes()
                   throws IPWorksSSLException
List all mailboxes matching all criteria in the Mailbox property.

List all mailboxes matching the criteria in the Mailbox property. Matching mailboxes are returned through the MailboxList event.

Example (List All Mailboxes)

 IMAPControl.Mailbox = "*"
 IMAPControl.ListMailboxes() 

Example (List All Mailboxes Inside INBOX)

 IMAPControl.Mailbox = "INBOX.*"
 IMAPControl.ListMailboxes() 

IPWorksSSLException

listSubscribedMailboxes

public void listSubscribedMailboxes()
                             throws IPWorksSSLException
List all subscribed mailboxes matching all criteria in the Mailbox property.

List all subscribed mailboxes matching the criteria in the Mailbox property. Matching mailboxes are returned through MailboxList event.

Example (List All Subscribed Mailboxes)

 IMAPControl.Mailbox = "*"
 IMAPControl.ListSubscribedMailboxes() 

Example (List All Subscribed Mailboxes Inside INBOX)

 IMAPControl.Mailbox = "INBOX.*"
 IMAPControl.ListSubscribedMailboxes() 

IPWorksSSLException

localizeDate

public java.lang.String localizeDate(java.lang.String dateTime)
                              throws IPWorksSSLException
Converts a valid RFC 822 message date to local date and time.

This method can be used to convert an RFC 822 date/time string to the corresponding local date and time.

Dates will be returned in the format: "MM/dd/yyyy hh:mm:ss".

IPWorksSSLException

moveToMailbox

public void moveToMailbox()
                   throws IPWorksSSLException
Moves the messages specified by MessageSet to the mailbox specified by Mailbox .

Moves the messages specified by the MessageSet property to the mailbox specified by the Mailbox property.

IPWorksSSLException

noop

public void noop()
          throws IPWorksSSLException
Sends a 'NOOP' command to the server.

Sends an IMAP 'NOOP' command to the server. This is useful when the connection needs to be kept alive for long periods of time. (Normally, servers break the connection automatically after 30 minutes of inactivity).

IPWorksSSLException

renameMailbox

public void renameMailbox(java.lang.String newName)
                   throws IPWorksSSLException
Change the name of Mailbox to NewName .

Rename a mailbox. The mailbox is specified by the Mailbox property, and the new name is specified by the NewName parameter.

IPWorksSSLException

resetMessageFlags

public void resetMessageFlags()
                       throws IPWorksSSLException
Replace the flags of the messages specified by MessageSet with the flags specified by MessageFlags .

Replace the flags of the messages specified by the MessageSet property with the flags specified by the MessageFlags property. The format of the flags is specified by the IMAP RFCs.

Examples of possible flag values are server dependent, but can include:

\\Deleted
Mark a message as deleted (for removal by later ExpungeMailbox ).
\\Seen \011
Mark a message as read.
\\Answered
Mark a message as answered.
\\Flagged\011
Mark a message as flagged.
\\Draft \011
Mark a message as being incomplete (under composition).

IPWorksSSLException

searchMailbox

public void searchMailbox()
                   throws IPWorksSSLException
Search selected mailbox for specified text.

Search the selected mailbox using the criteria specified in the SearchCriteria property. For every message matching the criteria, the FetchMessageInfo method is called and a MessageInfo event is fired. For more information about the format of the search criteria, please refer to the SearchCriteria property.

IPWorksSSLException

selectMailbox

public void selectMailbox()
                   throws IPWorksSSLException
Select a Mailbox.

Ask the server to select the mailbox specified in the Mailbox property. The mailbox is selected in read/write mode (if the server permits).

Example (Open a Mailbox in Read/Write Mode)

 IMAPControl.Mailbox = "INBOX"
 IMAPControl.SelectMailbox 

Example (Open a Mailbox in Read-Only Mode)

 IMAPControl.Mailbox = "INBOX.Folder"
 IMAPControl.ExamineMailbox 

IPWorksSSLException

setMailboxACL

public void setMailboxACL(java.lang.String user,
                          java.lang.String rights)
                   throws IPWorksSSLException
Sets mailbox access control rights for a specific user.

Changes the access control list for the mailbox specified in the Mailbox property so that User is granted the permissions specified in Rights .

Rights is a string containing an optional plus ("+") or minus ("-") prefix, followed by zero or more rights characters. If the string starts with a plus, the rights are added to any existing rights for the identifier. If the string starts with a minus, the rights are removed from any existing rights for the identifier. If the string does not start with a plus or minus, the rights replace any existing rights for the identifier.

Standard rights include:

l
Lookup (visible to be listed)
r
Read (Can be selected, fetched, searched, and copied)
s
Keep seen/unseen information across sessions
w
Write (Store flags other than SEEN and DELETED)
i
Insert (Can be appended, and copied into)
p
Post (Can send mail to submission address for mailbox)
c
Create (Can create new sub-mailboxes)
d
Delete (Store DELETED flag, perform EXPUNGE)
a
Administer (Set access permissions)

IPWorksSSLException

subscribeMailbox

public void subscribeMailbox()
                      throws IPWorksSSLException
Subscribe to the mailbox specified by Mailbox .

Subscribe to the mailbox specified by the Mailbox property.

IPWorksSSLException

unsetMessageFlags

public void unsetMessageFlags()
                       throws IPWorksSSLException
Remove the flags specified by MessageFlags from the messages specified by MessageSet .

Remove the flags specified by the MessageFlags property from the messages specified by the MessageSet property. The format of the flags is specified by the IMAP RFCs.

Examples of possible flag values are server dependent, but can include:

\\Deleted
Mark a message as deleted (for removal by later ExpungeMailbox ).
\\Seen \011
Mark a message as read.
\\Answered
Mark a message as answered.
\\Flagged\011
Mark a message as flagged.
\\Draft \011
Mark a message as being incomplete (under composition).

IPWorksSSLException

unsubscribeMailbox

public void unsubscribeMailbox()
                        throws IPWorksSSLException
Unsubscribe from the mailbox specified by Mailbox .

Unsubscribe from the mailbox specified by the Mailbox property.

IPWorksSSLException

addImapsEventListener

public void addImapsEventListener(ImapsEventListener l)
                           throws java.util.TooManyListenersException
java.util.TooManyListenersException

removeImapsEventListener

public void removeImapsEventListener(ImapsEventListener l)

IP*Works! SSL V6

Copyright (c) 2004 /n software inc. - All rights reserved.