IP*Works! SSL V9

ipworksssl
Class Imaps

java.lang.Object
  extended by 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. The ipworksssl.Imaps#config and {@link ipworksssl.Imaps#config configuration settings determine which protocols are enabled and at what security level. The {@link ipworksssl.Imaps#getSSLCert SSLCert} property is used to select a client certificate if the server is requesting client authentication. The {@link ipworksssl.Imaps#config configuration setting, together with the {@link ipworksssl.ImapsSSLServerAuthenticationEvent SSLServerAuthentication} event allow you to check the server identity and other security attributes. Finally, the {@link ipworksssl.ImapsSSLStatusEvent 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 {@link ipworksssl.Imaps#getMailServer MailServer} , a {@link ipworksssl.Imaps#getUser User} to connect as, and a {@link ipworksssl.Imaps#getPassword 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 {@link ipworksssl.Imaps#getMailbox Mailbox} is selected (or examined) using the {@link ipworksssl.Imaps#examineMailbox ExamineMailbox} method. After the {@link ipworksssl.Imaps#getMailbox Mailbox} is selected, {@link ipworksssl.Imaps#getMessageCount MessageCount} and {@link ipworksssl.Imaps#getRecentMessageCount RecentMessageCount} show the number of messages in the mailbox, and {@link ipworksssl.Imaps#getMailboxFlags 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 primary arguments for most commands are the {@link ipworksssl.Imaps#getMailbox Mailbox} property and the {@link ipworksssl.Imaps#getMessageSet MessageSet} property. The {@link ipworksssl.Imaps#getMessageSet MessageSet} property denotes either a single message, or a range of messages. Other arguments are specified through other properties such as {@link ipworksssl.Imaps#getSortCriteria SortCriteria} , {@link ipworksssl.Imaps#getMessageFlags MessageFlags} , etc.

Responses are received through events such as {@link ipworksssl.ImapsMessageInfoEvent MessageInfo} , {@link ipworksssl.ImapsMailboxListEvent MailboxList} , and also reflected to properties such as {@link ipworksssl.Imaps#getMessageText MessageText} , {@link ipworksssl.Imaps#getMessageSubject MessageSubject} , etc.

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

The {@link ipworksssl.ImapsPITrailEvent 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 amKerberos
           
static int amNTLM
           
static int amSASLDigestMD5
           
static int amSASLPlain
           
static int amUserPassword
           
static int amXOAUTH2
           
static int sslAutomatic
           
static int sslExplicit
           
static int sslImplicit
           
static int sslNone
           
 
Constructor Summary
Imaps()
          Creates an instance of Imaps Bean.
Imaps(java.lang.String runtimeLicense)
          Creates an instance of Imaps Bean with specified run-time license.
 
Method Summary
 void addImapsEventListener(ImapsEventListener l)
           
 void addMessageFlags(java.lang.String flags)
          Adds 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()
          Removes 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 {@link ipworksssl.Imaps#config configuration setting.
 void connect()
          Connects to an IMAP server.
 void copyToMailbox()
          Copies the messages specified by MessageSet to the mailbox specified by Mailbox .
 void createMailbox()
          Creates a new mailbox specified by Mailbox .
 void deleteFromMailbox()
          Marks the messages specified by MessageSet as deleted.
 void deleteMailbox()
          Deletes a mailbox specified by Mailbox .
 void deleteMailboxACL(java.lang.String user)
          Deletes mailbox access control rights for a specific user.
 void disconnect()
          Disconnects from an IMAP server.
 void doEvents()
          Processes events from the internal message queue.
 void examineMailbox()
          Selects a Mailbox (Read-only mode).
 void expungeMailbox()
          Removes all messages marked with 'Deleted' flag from the currently selected mailbox.
 void fetchMessageHeaders()
          Retrieves the message headers of messages specified by the MessageSet property.
 void fetchMessageInfo()
          Retrieves information about messages specified by the MessageSet property.
 void fetchMessagePart(java.lang.String partId)
          Retrieves the message part specified by PartID.
 void fetchMessagePartHeaders(java.lang.String partId)
          Retrieves the headers of message part specified by PartID.
 void fetchMessageText()
          Retrieves the message text of messages specified by the MessageSet property.
 int getAuthMechanism()
          The authentication mechanism to be used when connecting to the mail server.
 long getEndByte()
          The byte index of the position where the transfer should end.
 Firewall getFirewall()
          A set of properties related to firewall access.
 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()
          Retrieves mailbox access control rights.
 java.lang.String getMailboxFlags()
          Defines flags in the selected mailbox.
 MailboxList getMailboxList()
          Collection of mailboxes listed by the server.
 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).
 byte[] getMessage()
          Provides the raw message content.
 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.
 HeaderList getMessageHeaders()
          Collection of RFC822-encoded headers of the message.
 java.lang.String getMessageHeadersString()
          String version of RFC822-encoded headers of the message.
 java.lang.String getMessageId()
          The message identifier of the current message.
 MessageInfoList getMessageInfo()
          Collection of messages retrieved by FetchMessageInfo .
 java.lang.String getMessageInReplyTo()
          The unique message identifier of the message this one is in reply to.
 java.lang.String getMessageNetId()
          The globally unique identifier of the message.
 MessagePartList getMessageParts()
          Collection of message parts collected by FetchMessageInfo .
 MessageRecipientList getMessageRecipients()
          Collection of recipients for the current 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.
 long 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 getPassword()
          The password used to authenticate to the MailServer .
 int getRecentMessageCount()
          Number of new messages in the Mailbox .
 java.lang.String getSortCriteria()
          Sorts criteria to use for message retrieval operations.
 Certificate getSSLAcceptServerCert()
          Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.
 Certificate getSSLCert()
          The certificate to be used during SSL negotiation.
 Certificate getSSLServerCert()
          The server certificate for the last established connection.
 int getSSLStartMode()
          Determines how the bean starts the SSL negotiation.
 long getStartByte()
          The byte index of the position where the transfer should start.
 int getTimeout()
          A timeout for the bean.
 java.lang.String getUIDValidity()
          The UIDValidity parameter sent from the server in response to SelectMailbox command.
 java.lang.String getUser()
          The user name used to authenticate to the MailServer .
 void interrupt()
          Interrupt the current method.
 boolean isAutoDecodeParts()
          Determines whether to automatically decode message parts.
 boolean isConnected()
          Shows whether the bean is connected.
 boolean isIdle()
          The current status of the component.
 boolean isOverwrite()
          Indicates whether or not the bean should overwrite files during transfer.
 boolean isPeekMode()
          When set to True, the message Seen flag is not changed during reading.
 boolean isUIDMode()
          If true, permanent message identifiers are used instead of the default temporary identifiers.
 void listMailboxes()
          Lists all mailboxes matching all criteria in the Mailbox property.
 void listSubscribedMailboxes()
          Lists 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()
          Replaces the flags of the messages specified by MessageSet with the flags specified by MessageFlags .
 void searchMailbox(java.lang.String searchCriteria)
          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 setAutoDecodeParts(boolean autoDecodeParts)
          Determines whether to automatically decode message parts.
 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(long endByte)
          The byte index of the position where the transfer should end.
 void setFirewall(Firewall firewall)
          A set of properties related to firewall access.
 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 setMessage(byte[] message)
          Provides the raw message content.
 void setMessageFlags(java.lang.String messageFlags)
          Contains the flags of the current message.
 void setMessageHeadersString(java.lang.String messageHeadersString)
          String version of RFC822-encoded headers of the message.
 void setMessageSet(java.lang.String messageSet)
          The set of messages to operate on.
 void setMessageStream(java.io.OutputStream messageStream)
          Sets the stream to which the message (or message part) downloaded from the server will be written.
 void setMessageText(java.lang.String messageText)
          The body of the retrieved message
 void setOverwrite(boolean overwrite)
          Indicates whether or not the bean should overwrite files during transfer.
 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 setSortCriteria(java.lang.String sortCriteria)
          Sorts criteria to use for message retrieval operations.
 void setSSLAcceptServerCert(Certificate SSLAcceptServerCert)
          Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.
 void setSSLCert(Certificate SSLCert)
          The certificate to be used during SSL negotiation.
 void setSSLStartMode(int SSLStartMode)
          Determines how the bean starts the SSL negotiation.
 void setStartByte(long 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 identifiers are used instead of the default temporary identifiers.
 void setUser(java.lang.String user)
          The user name used to authenticate to the MailServer .
 void subscribeMailbox()
          Subscribes to the mailbox specified by Mailbox .
 void unsetMessageFlags()
          Removes the flags specified by MessageFlags from the messages specified by MessageSet .
 void unsubscribeMailbox()
          Unsubscribes 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

amNTLM

public static final int amNTLM
See Also:
Constant Field Values

amSASLPlain

public static final int amSASLPlain
See Also:
Constant Field Values

amSASLDigestMD5

public static final int amSASLDigestMD5
See Also:
Constant Field Values

amKerberos

public static final int amKerberos
See Also:
Constant Field Values

amXOAUTH2

public static final int amXOAUTH2
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()
Creates an instance of Imaps Bean.


Imaps

public Imaps(java.lang.String runtimeLicense)
Creates an instance of Imaps Bean with specified run-time license.

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.

If AuthMechanism is set to amNTLM (2) NTLM authentication will be used.

AuthMechanism can be set to amSASLPlain (4) as well. Note, however, that servers will often require SSL or some other encrypted session protection be used when this authentication mechanism is requested.

If AuthMechanism is set to amKerberos (6) Kerberos authentication will be used. NOTE: This functionality is only available in Windows.


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.

If AuthMechanism is set to amNTLM (2) NTLM authentication will be used.

AuthMechanism can be set to amSASLPlain (4) as well. Note, however, that servers will often require SSL or some other encrypted session protection be used when this authentication mechanism is requested.

If AuthMechanism is set to amKerberos (6) Kerberos authentication will be used. NOTE: This functionality is only available in Windows.

Throws:
IPWorksSSLException

isAutoDecodeParts

public boolean isAutoDecodeParts()
Determines whether to automatically decode message parts.

This property determines whether or not to automatically decode message parts. Message parts, especially binary message parts, are normally sent by the server encoded (Base64 or other format). If this setting is True, the parts are automatically decoded while being received.


setAutoDecodeParts

public void setAutoDecodeParts(boolean autoDecodeParts)
                        throws IPWorksSSLException
Determines whether to automatically decode message parts.

This property determines whether or not to automatically decode message parts. Message parts, especially binary message parts, are normally sent by the server encoded (Base64 or other format). If this setting is True, the parts are automatically decoded while being received.

Throws:
IPWorksSSLException

setCommand

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

Setting this 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).

Throws:
IPWorksSSLException

isConnected

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

This property is used to determine whether or not the bean is connected to the remote host.


setConnected

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

This property is used to determine whether or not the bean is connected to the remote host.

Throws:
IPWorksSSLException

getEndByte

public long 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(long 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.

Throws:
IPWorksSSLException

getFirewall

public Firewall getFirewall()
A set of properties related to firewall access.

This is a Firewall type property which contains fields describing the firewall through which the bean will attempt to connect.


setFirewall

public void setFirewall(Firewall firewall)
                 throws IPWorksSSLException
A set of properties related to firewall access.

This is a Firewall type property which contains fields describing the firewall through which the bean will attempt to connect.

Throws:
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 property indicates the last reply received from the server. It can be used for informational 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).

This property is used when retrieving a message.

If this property 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).

This property is used when retrieving a message.

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

Throws:
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 multi-homed 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 multi-homed 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 multi-homed 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 multi-homed 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.

Throws:
IPWorksSSLException

getMailbox

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

This method contains the name of the mailbox selected on the server, and is 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.

This method contains the name of the mailbox selected on the server, and is 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 

Throws:
IPWorksSSLException

getMailboxFlags

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

This method defines flags in the selected mailbox. The bean fills out MessageCount , RecentMessageCount , and MailboxFlags after connecting to the MailServer and selecting or examining a Mailbox .


getMailboxList

public MailboxList getMailboxList()
Collection of mailboxes listed by the server.

This collection contains a list of mailboxes returned by the server when ListMailboxes or ListSubscribedMailboxes is called.

{@link ipworksssl.Imaps#config can be used to control the number of mailboxes saved.

This collection is indexed from 0 to size - 1.


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).

Throws:
IPWorksSSLException

getMailServer

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

This 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 this 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 an "*". 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).

This 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 this 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 an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

Throws:
IPWorksSSLException

getMessage

public byte[] getMessage()
Provides the raw message content.

This property is populated after calling FetchMessagePart and holds the raw message content. This can be used to access the data before any processing is done by the bean.


setMessage

public void setMessage(byte[] message)
                throws IPWorksSSLException
Provides the raw message content.

This property is populated after calling FetchMessagePart and holds the raw message content. This can be used to access the data before any processing is done by the bean.

Throws:
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.

This 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 .

This property contains 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.

This property contains 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.

This property contains 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.

This property 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
Mark a message as read.
\Answered
Mark a message as answered.
\Flagged
Mark a message as flagged.
\Draft
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.

This property 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
Mark a message as read.
\Answered
Mark a message as answered.
\Flagged
Mark a message as flagged.
\Draft
Mark a message as being incomplete (under composition).
Example (Setting MessageFlags)

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

Throws:
IPWorksSSLException

getMessageFrom

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

This property 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 HeaderList getMessageHeaders()
Collection of RFC822-encoded headers of the message.

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


getMessageHeadersString

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

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


setMessageHeadersString

public void setMessageHeadersString(java.lang.String messageHeadersString)
                             throws IPWorksSSLException
String version of RFC822-encoded headers of the message.

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

Throws:
IPWorksSSLException

getMessageId

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

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

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


getMessageInfo

public MessageInfoList getMessageInfo()
Collection of messages retrieved by FetchMessageInfo .

This property is populated when messages are searched, listed, or message information is received from the server. The collection contains a list of each message's messageinfo as returned by the server.

ipworksssl.Imaps#config can be used to control the number of {@link ipworksssl.Imaps#messageinfoList messageinfo} s saved.

This collection is indexed from 0 to size - 1.


getMessageInReplyTo

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

The bean fills out this property 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 identifier of the message itself is given by the MessageNetId property.


getMessageNetId

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

This property contains the globally unique identifier 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.


getMessageParts

public MessagePartList getMessageParts()
Collection of message parts collected by FetchMessageInfo .

This property contains a collection of message parts that is populated when you call FetchMessageInfo . Once the message is received from the server, the bean parses the different parts and their corresponding information into the MESSAGEPARTS collection. Each messagepart contains a unique Id .

{@link ipworksssl.Imaps#config can be used to control the number of message parts saved.

This collection is indexed from 0 to size - 1.


getMessageRecipients

public MessageRecipientList getMessageRecipients()
Collection of recipients for the current message.

This property contains a collection of the people to whom the message was sent. Each messagerecipient contains information describing that recipient, and what type of recipient it is. This collection is populated when the FetchMessageInfo method is called.

This collection is indexed from 0 to size - 1.


getMessageReplyTo

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

This property contains the 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 this property separated by commas.


getMessageSender

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

This property contains the address of the sender of the message. Which is 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.

This property indicates 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.

This property indicates 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() 

Throws:
IPWorksSSLException

getMessageSize

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

The bean fills out this property with the size of the selected message when message information is retrieved from the MailServer .


getMessageSubject

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

The bean fills out this property with the subject of the message when message information is retrieved from the MailServer .


getMessageText

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

The bean fills out this property 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 this property with the contents of the message body (in RFC822 format) when a call to FetchMessageText completes successfully.

Throws:
IPWorksSSLException

isOverwrite

public boolean isOverwrite()
Indicates whether or not the bean should overwrite files during transfer.

This property is a value indicating whether or not the bean should overwrite files when downloading the message text or a message part and LocalFile is set. If Overwrite is false, an error will be thrown whenever LocalFile exists.


setOverwrite

public void setOverwrite(boolean overwrite)
                  throws IPWorksSSLException
Indicates whether or not the bean should overwrite files during transfer.

This property is a value indicating whether or not the bean should overwrite files when downloading the message text or a message part and LocalFile is set. If Overwrite is false, an error will be thrown whenever LocalFile exists.

Throws:
IPWorksSSLException

getPassword

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

This property contains 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 .

This property contains the password used to authenticate to the MailServer . Both the User and Password properties must be set before connecting to the MailServer .

Throws:
IPWorksSSLException

isPeekMode

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

This property contains a true or false to determine whether or not this message should be seen. When this property is set to 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.

This property contains a true or false to determine whether or not this message should be seen. When this property is set to 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.

Throws:
IPWorksSSLException

getRecentMessageCount

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

This property contains the number of new messages that are in the Mailbox . The bean fills out MessageCount , RecentMessageCount , and MailboxFlags after connecting to the MailServer and selecting or examining a Mailbox .


getSortCriteria

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

This property sorts 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
Sorts criteria to use for message retrieval operations.

This property sorts 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.

Throws:
IPWorksSSLException

getSSLAcceptServerCert

public Certificate 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, this property may create a security breach. Use it at your own risk.


setSSLAcceptServerCert

public void setSSLAcceptServerCert(Certificate 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, this property may create a security breach. Use it at your own risk.

Throws:
IPWorksSSLException

getSSLCert

public Certificate getSSLCert()
The certificate to be used during SSL negotiation.

The digital certificate that the bean will use during SSL negotiation. Set this property to a valid certificate before starting SSL negotiation. To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the store and subject fields.


setSSLCert

public void setSSLCert(Certificate SSLCert)
                throws IPWorksSSLException
The certificate to be used during SSL negotiation.

The digital certificate that the bean will use during SSL negotiation. Set this property to a valid certificate before starting SSL negotiation. To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the store and subject fields.

Throws:
IPWorksSSLException

getSSLServerCert

public Certificate 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.


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.

Throws:
IPWorksSSLException

getStartByte

public long 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(long 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.

Throws:
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 exception.

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when any amount of 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 the ipworksssl.Imaps#config configuration setting.

The default value for the {@link ipworksssl.Imaps#getTimeout 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 exception.

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when any amount of 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 the ipworksssl.Imaps#config configuration setting.

The default value for the {@link ipworksssl.Imaps#getTimeout Timeout} property is 60 (seconds).

Throws:
IPWorksSSLException

isUIDMode

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

This property indicates if a permanent identifier should be used. Normally, the IMAP server uses temporary message identifiers that are valid only during the current session. If UIDMode is true, permanent message identifiers 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 identifiers are used instead of the default temporary identifiers.

This property indicates if a permanent identifier should be used. Normally, the IMAP server uses temporary message identifiers that are valid only during the current session. If UIDMode is true, permanent message identifiers are used instead.

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

Throws:
IPWorksSSLException

getUIDValidity

public java.lang.String getUIDValidity()
The UIDValidity parameter sent from the server in response to SelectMailbox command.

Every time a mailbox is selected a UIDValidity is returned from the server. Most of the time this value will not change from call to call. In case it does change, it means that all previously returned UIDs for messages inside this mailbox are now invalid.


getUser

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

This property contains 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 .

This property contains the user name used to authenticate to the MailServer . Both the User and Password properties must be set before connecting to the MailServer .

Throws:
IPWorksSSLException

addMessageFlags

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

This method adds 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
Mark a message as read.
\Answered
Mark a message as answered.
\Flagged
Mark a message as flagged.
\Draft
Mark a message as being incomplete (under composition).
Example (Setting Adding Message Flags)

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

Throws:
IPWorksSSLException

appendToMailbox

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

This method 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() 

Throws:
IPWorksSSLException

checkMailbox

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

This method 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.

Throws:
IPWorksSSLException

closeMailbox

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

This method permanently removes all messages that have the 'Deleted' flag set from the current (selected) mailbox, and then closes (deselect) the mailbox.

Throws:
IPWorksSSLException

config

public java.lang.String config(java.lang.String configurationString)
                        throws IPWorksSSLException
Sets or retrieves a ipworksssl.Imaps#config configuration setting.

{@link ipworksssl.Imaps#config Config} is a generic method available in every bean. It is used to set and retrieve {@link ipworksssl.Imaps#config configuration settingsfor the bean.

These 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 {@link ipworksssl.Imaps#config 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 {@link ipworksssl.Imaps#config configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.

The bean accepts one or more of the following configuration settings . 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 {@link ipworksssl.Imaps#config Config} method.

IMAP Configuration Settings

AlwaysReturnUIDs
Instructs the server to return UIDs even if not in UIDMode
If {@link ipworksssl.Imaps#isUIDMode UIDMode} is set to false the {@link ipworksssl.Imaps#getMessageSet MessageSet} contains session message ids, and the response from the server is going to contain session message ids as well. In some cases it is desirable that the server sends back UIDs; set the {@link ipworksssl.Imaps#config to True to instruct the server to do so.The default value for this setting is False.

AppendToMailboxDateTime
Specifies the date-time parameter used in the initial APPEND request
When appending to a mailbox using the {@link ipworksssl.Imaps#appendToMailbox AppendToMailbox} method, the IMAP RFC specifies a date-time parameter that can be used to set the internal date of the resulting message. This configuration setting can be used to specify the date-time parameter used in this case.The date-time should be formatted according to the IMAP RFC specifications. For example, "22-Jan-2013 12:34:56 -0500" indicates January 22nd, 2013 at 12:34:56 PM EST.

By default, if this setting is not specified, no date-time is sent with the APPEND request and the server will use the current time.

AuthorizationIdentity
The value to use as the authorization identity when SASL authentication is used
When {@link ipworksssl.Imaps#getAuthMechanism AuthMechanism} is set to amSASLPlain, amSASLDigestMD5, or amXOAUTH2 you may use this setting to specify an authorization identity to be used when authenticating. In the case of amXOAUTH2 this should be your OAUTH authorization string. For instance:
 Bearer ya29.AHES6ZRmS-8xPbpGetC1VbABJIBRdKm-c4X7wMVGAbgxdGt5q8Ts3Q 
Note: When using amXOAUTH2 {@link ipworksssl.Imaps#getUser User} must be specified, but {@link ipworksssl.Imaps#getPassword Password} is not required.
EnableIMAPIDLE
Enables or disables IDLE command support in the bean
If set to True, {@link ipworksssl.Imaps#setCommand Command} may then be set to "IDLE" to begin idling. Set {@link ipworksssl.Imaps#setCommand Command} to "DONE" to stop idling.
FetchAfterSearch
Determines if messages matching the SearchCriteria are fetched after calling SearchMailbox
If set to False, {@link ipworksssl.Imaps#fetchMessageInfo FetchMessageInfo} will not be called for messages matching the SearchCriteria after calling {@link ipworksssl.Imaps#searchMailbox SearchMailbox} . {@link ipworksssl.ImapsMessageInfoEvent MessageInfo} will still fire, but the MessageId parameter will be the only parameter populated. The default value of this setting is True.
HeaderLimit
Instructs bean to save the amount of headers specified that are returned by the server after a Header event has been fired
This config should be set when populating the {@link ipworksssl.Imaps#getMessageHeaders MessageHeaders} collection as a result of retrieving message headers. This value represents the number of headers that are to be saved in the collection .To save all items to the collection , set this config to -1. If no items are wanted, set this to 0, which will not save any to the collection . The default for this config is -1, so all items will be included in the collection .

NOTE: This functionality is only available in Java and .NET.

IncludeHeaders
Instructs the bean to include the headers in the LocalFile
When set to true, the headers for the message you are fetching will be written to the LocalFile before the message body. In this manner, the whole content of a MIME-encoded message will be written to the file.
MailboxLimit
Instructs bean to save the amount of mailboxes specified that are returned by the server after a ListMailboxes call has been made
This config should be set when populating the {@link ipworksssl.Imaps#getMailboxList MailboxList} collection as a result of a call to either {@link ipworksssl.Imaps#listMailboxes ListMailboxes} or {@link ipworksssl.Imaps#listSubscribedMailboxes ListSubscribedMailboxes} . This value represents the number of mailboxes that are to be saved in the collection .To save all items to the collection , set this config to -1. If no items are wanted, set this to 0, which will not save any to the collection . The default for this config is -1, so all items will be included in the collection .

NOTE: This functionality is only available in Java and .NET.

MessageInfoLimit
Instructs bean to save the amount of messages specified that are returned by the server after a FetchMessageInfo call has been made
This config should be set when populating the {@link ipworksssl.Imaps#getMessageInfo MessageInfo} collection as a result of a call to {@link ipworksssl.Imaps#fetchMessageInfo FetchMessageInfo} . This value represents the number of messages that are to be saved in the collection .To save all items to the collection , set this config to -1. If no items are wanted, set this to 0, which will not save any to the collection . The default for this config is -1, so all items will be included in the collection .

NOTE: This functionality is only available in Java and .NET.

MessagePartLimit
Instructs bean to save the amount of message parts specified that are returned by the server after a FetchMessageInfo call has been made
This config should be set when populating the {@link ipworksssl.Imaps#getMessageParts MessageParts} collection as a result of a call to {@link ipworksssl.Imaps#fetchMessageInfo FetchMessageInfo} . This value represents the number of message parts that are to be saved in the collection .To save all items to the collection , set this config to -1. If no items are wanted, set this to 0, which will not save any to the collection . The default for this config is -1, so all items will be included in the collection .

NOTE: This functionality is only available in Java and .NET.

UTF7MailboxNames
Specifies whether or not to automatically encode and decode UTF-7 mailbox names
IMAP servers may represent some characters in a mailbox name in UTF-7 format. This setting determines whether or not the bean should automatically encode and decode these values. When set to false no encoding or decoding will be performed by the bean. The default value is true.

IPPort Configuration Settings

ConnectionTimeout
Sets a separate timeout value for establishing a connection
When set, this configuration setting allows you to specify a different timeout value for establishing a connection. Otherwise, the bean will use {@link ipworksssl.Imaps#getTimeout Timeout} for establishing a connection and transmitting/receiving data.
FirewallAutoDetect
Tells the bean whether or not to automatically detect and use firewall system settings, if available
This is the same as AutoDetect . This setting is provided for use by beans that do not directly expose Firewall properties.
FirewallHost
Name or IP address of firewall (optional)
If a {@link ipworksssl.Imaps#config is given, requested connections will be authenticated through the specified firewall when connecting.If the {@link ipworksssl.Imaps#config setting is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the {@link ipworksssl.Imaps#config setting is set to the corresponding address. If the search is not successful, an error is returned.

NOTE: This is the same as Host . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallListener
If true, the component binds to a SOCKS firewall as a server (IPPort only)
This entry is for IPPort only and does not work for other components that descend from IPPort.If this entry is set, the bean acts as a server. {@link ipworksssl.Imaps#getRemoteHost RemoteHost} and {@link ipworksssl.Imaps#getRemotePort RemotePort} are used to tell the SOCKS firewall in which address and port to listen to. The firewall rules may ignore {@link ipworksssl.Imaps#getRemoteHost RemoteHost} , and it is recommended that {@link ipworksssl.Imaps#getRemoteHost RemoteHost} be set to empty string in this case.

{@link ipworksssl.Imaps#getRemotePort RemotePort} is the port in which the firewall will listen to. If set to 0, the firewall will select a random port. The binding (address and port) is provided through the {@link ipworksssl.ImapsConnectionStatusEvent ConnectionStatus} event.

The connection to the firewall is made by calling the {@link ipworksssl.Imaps#connect Connect} method.

FirewallPassword
Password to be used if authentication is to be used when connecting through the firewall
If {@link ipworksssl.Imaps#config is specified, the {@link ipworksssl.Imaps#config and {@link ipworksssl.Imaps#config settings are used to connect and authenticate to the given firewall. If the authentication fails, the bean throws an exception.NOTE: This is the same as Password . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallPort
The TCP port for the FirewallHost;
Note that the {@link ipworksssl.Imaps#config is set automatically when {@link ipworksssl.Imaps#config is set to a valid value.NOTE: This is the same as Port . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallType
Determines the type of firewall to connect through
The appropriate values are as follows:
0
No firewall (default setting).
1
Connect through a tunneling proxy. {@link ipworksssl.Imaps#config is set to 80.
2
Connect through a SOCKS4 Proxy. {@link ipworksssl.Imaps#config is set to 1080.
3
Connect through a SOCKS5 Proxy. {@link ipworksssl.Imaps#config is set to 1080.
NOTE: This is the same as FirewallType . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallUser
A user name if authentication is to be used connecting through a firewall
If the {@link ipworksssl.Imaps#config is specified, the {@link ipworksssl.Imaps#config and {@link ipworksssl.Imaps#config settings are used to connect and authenticate to the Firewall. If the authentication fails, the bean throws an exception.NOTE: This is the same as User . This setting is provided for use by beans that do not directly expose Firewall properties.

KeepAliveTime
The inactivity time in milliseconds before a TCP keep-alive packet is sent
When set, {@link ipworksssl.Imaps#config will automatically be set to true. By default the operating system will determine the time a connection is idle before a TCP keep-alive packet is sent. This system default if this value is not specified here is 2 hours. In many cases a shorter interval is more useful. Set this value to the desired interval in milliseconds.Note: This value is not applicable in Java.

KeepAliveInterval
The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received
When set, {@link ipworksssl.Imaps#config will automatically be set to true. A TCP keep-alive packet will be sent after a period of inactivity as defined by {@link ipworksssl.Imaps#config . If no acknowledgement is received from the remote host the keep-alive packet will be re-sent. This setting specifies the interval at which the successive keep-alive packets are sent in milliseconds. This system default if this value is not specified here is 1 second.Note: This value is not applicable in Java or MAC.

Linger
When set to True, connections are terminated gracefully
This property controls how a connection is closed. The default is True.In the case that Linger is True (default), there are two scenarios for determining how long the connection will linger. The first, if {@link ipworksssl.Imaps#config is 0 (default), the system will attempt to send pending data for a connection until the default IP protocol timeout expires.

In the second scenario, {@link ipworksssl.Imaps#config is a positive value, the system will attempt to send pending data until the specified {@link ipworksssl.Imaps#config is reached. If this attempt fails, then the system will reset the connection.

The default behavior (which is also the default mode for stream sockets) might result in a long delay in closing the connection. Although the bean returns control immediately, the system could hold system resources until all pending data is sent (even after your application closes).

Setting this property to False forces an immediate disconnection. If you know that the other side has received all the data you sent (by a client acknowledgment, for example), setting this property to False might be the appropriate course of action.

LingerTime
Time in seconds to have the connection linger
LingerTime is the time, in seconds, to leave the socket connection linger. This value is 0 by default, which means it will use the default IP protocol timeout.
LocalHost
The name of the local host through which connections are initiated or accepted
The {@link ipworksssl.Imaps#getLocalHost LocalHost} setting 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 multi-homed 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 {@link ipworksssl.Imaps#getLocalHost LocalHost} setting 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 multi-homed hosts (machines with more than one IP interface).

LocalPort
The TCP port in the local host where the bean binds
This must be set before a connection is attempted. It instructs the bean to bind to a specific port (or communication endpoint) in the local machine.Setting this to 0 (default) enables the system to choose a port at random. The chosen port will be shown by {@link ipworksssl.Imaps#getLocalPort LocalPort} after the connection is established.

{@link ipworksssl.Imaps#getLocalPort LocalPort} cannot be changed once a connection is made. Any attempt to set this when a connection is active will generate an error.

This; setting is useful when trying to connect to services that require a trusted port in the client side. An example is the remote shell (rsh) service in UNIX systems.

MaxLineLength
The maximum amount of data to accumulate when no EOL is found
{@link ipworksssl.Imaps#config is the size of an internal buffer, which holds received data while waiting for an {@link ipworksssl.Imaps#getEOL EOL} string.If an {@link ipworksssl.Imaps#getEOL EOL} string is found in the input stream before {@link ipworksssl.Imaps#config bytes are received, the {@link ipworksssl.ImapsDataInEvent DataIn} event is fired with the EOL parameter set to True, and the buffer is reset.

If no {@link ipworksssl.Imaps#getEOL EOL} is found, and {@link ipworksssl.Imaps#config bytes are accumulated in the buffer, the {@link ipworksssl.ImapsDataInEvent DataIn} event is fired with the EOL parameter set to False, and the buffer is reset.

The minimum value for {@link ipworksssl.Imaps#config is 256 bytes. The default value is 2048 bytes. The maximum value is 65536 bytes.

MaxTransferRate
The transfer rate limit in bytes per second
This setting can be used to throttle outbound TCP traffic. Set this to the number of bytes to be sent per second. By default this is not set and there is no limit.
TCPKeepAlive
Determines whether or not the keep alive socket option is enabled
If set to true, the socket's keep-alive option is enabled and keep-alive packets will be sent periodically to maintain the connection. Set {@link ipworksssl.Imaps#config and {@link ipworksssl.Imaps#config to configure the timing of the keep-alive packets.Note: This value is not applicable in Java.

UseIPv6
Whether or not to use IPv6
By default, the component expects an IPv4 address for local and remote host properties, and will create an IPv4 socket. To use IPv6 instead, set this to True.
CloseStreamAfterTransfer
If true, the component will close the upload or download stream after the transfer
This setting determines whether the input or output stream is closed after the transfer completes. When set to True (default), all streams will be closed after a transfer is completed. In order to keep streams open after the transfer of data, set this to False. the default value is True.
TcpNoDelay
Whether or not to delay when sending packets
When true, the socket will send all data that is ready to send at once. When false, the socket will send smaller buffered packets of data at small intervals. This is known as the Nagle algorithm.By default, this config is set to false.

SSL Configuration Settings

ReuseSSLSession
Determines if the SSL session is reused
If set to true, the component will reuse the context if and only if the following criteria are met:
  • The target host name is the same.
  • The system cache entry has not expired (default timeout is 10 hours).
  • The application process that calls the function is the same.
  • The logon session is the same.
  • The instance of the component is the same.

SSLCipherStrength
The minimum cipher strength used for bulk encryption
This minimum cipher strength largely dependent on the security modules installed on the system. If the cipher strength specified is not supported, an error will be returned when connections are initiated.Please note that this setting contains the minimum cipher strength requested from the security library. The actual cipher strength used for the connection is shown by the {@link ipworksssl.ImapsSSLStatusEvent SSLStatus} event.

Use this setting with caution. Requesting a lower cipher strength than necessary could potentially cause serious security vulnerabilities in your application.

When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the {@link ipworksssl.Imaps#config config setting.

SSLEnabledProtocols
Used to enable/disable the supported security protocols
Used to enable/disable the supported security protocols.Not all supported protocols are enabled by default (the value of this setting is 192). If you want more granular control over the enabled protocols, you can set this property to the binary 'OR' of one or more of the following values:
TLS1.2
3072 (Hex C00)
TLS1.1
768 (Hex 300)
TLS1
192 (Hex C0) (Default)
SSL3
48 (Hex 30)
SSL2
12 (Hex 0C)
Please note that although a number of sites still support SSL2, it is usually a good idea to disable it because of potential security vulnerabilities.

When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the {@link ipworksssl.Imaps#config config setting.

TLS 1.1 and TLS1.2 support are only available starting with Windows 7.

SSLProvider
The name of the security provider to use
Change this setting to use security providers other than the system default.Use this setting with caution. Disabling SSL security or pointing to the wrong provider could potentially cause serious security vulnerabilities in your application.

The special value "*" (default) picks the default SSL provider defined in the system.

Note: On Windows systems, the default SSL Provider is "Microsoft Unified Security Protocol Provider" and cannot be changed.

SSLSecurityFlags
Flags that control certificate verification
The following flags are defined (specified in hexadecimal notation). They can be or-ed together to exclude multiple conditions:
0x00000001
Ignore time validity status of certificate.
0x00000002
Ignore time validity status of CTL.
0x00000004
Ignore non-nested certificate times.
0x00000010
Allow unknown Certificate Authority.
0x00000020
Ignore wrong certificate usage.
0x00000100
Ignore unknown certificate revocation status.
0x00000200
Ignore unknown CTL signer revocation status.
0x00000400
Ignore unknown Certificate Authority revocation status.
0x00000800
Ignore unknown Root revocation status.
0x00008000
Allow test Root certificate.
0x00004000
Trust test Root certificate.
0x80000000
Ignore non-matching CN (certificate CN not-matching server name).
This functionality is currently not available in Java or when the provider is OpenSSL.

SSLContextProtocol
The protocol used when getting an SSLContext instance
Possible values are SSL, SSLv2, SSLv3, TLS and TLSv1. Use it only in case your security provider does not support TLS. This is the parameter "protocol" inside the SSLContext.getInstance(protocol) call.
SSLTrustManagerFactoryAlgorithm
The algorithm to be used to create a TrustManager through TrustManagerFactory
Possible values include SunX509. This is the parameter "algorithm" inside the TrustManagerFactory.getInstance(algorithm) call.
SSLEnabledCipherSuites
The cipher suite to be used in an SSL negotiation
The enabled cipher suites to be used in SSL negotiation.By default, the enabled cipher suites will include all available ciphers ("*").

The special value "*" means that the component will pick all of the supported cipher suites. If SSLEnabledCipherSuites is set to any other value, only the specified cipher suites will be considered.

Multiple cipher suites are separated by semicolons.

Example values:

 obj.config("SSLEnabledCipherSuites=*");
 obj.config("SSLEnabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA");
 obj.config("SSLEnabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA; SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA"); 
Possible values include:
  • SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
  • SSL_RSA_WITH_RC4_128_SHA
  • SSL_RSA_WITH_DES_CBC_SHA
  • SSL_RSA_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DH_anon_WITH_DES_CBC_SHA
  • SSL_RSA_EXPORT_WITH_RC4_40_MD5
  • SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DH_anon_EXPORT_WITH_RC4_40_MD5
  • SSL_DHE_DSS_WITH_DES_CBC_SHA
  • SSL_RSA_WITH_NULL_MD5
  • SSL_DH_anon_WITH_3DES_EDE_CBC_SHA
  • SSL_DHE_RSA_WITH_DES_CBC_SHA
  • SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA
  • SSL_RSA_WITH_NULL_SHA
  • SSL_DH_anon_WITH_RC4_128_MD5
  • SSL_RSA_WITH_RC4_128_MD5
  • SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
  • SSL_RSA_WITH_3DES_EDE_CBC_SHA
  • TLS_ECDH_ECDSA_WITH_NULL_SHA
  • TLS_DH_anon_WITH_AES_128_CBC_SHA256
  • TLS_ECDH_anon_WITH_RC4_128_SHA
  • TLS_DH_anon_WITH_AES_128_CBC_SHA
  • TLS_DHE_RSA_WITH_AES_128_CBC_SHA
  • TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
  • TLS_KRB5_WITH_3DES_EDE_CBC_SHA
  • TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
  • TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
  • TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
  • TLS_KRB5_EXPORT_WITH_RC4_40_SHA
  • TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
  • TLS_ECDHE_RSA_WITH_RC4_128_SHA
  • TLS_ECDH_ECDSA_WITH_RC4_128_SHA
  • TLS_ECDH_anon_WITH_NULL_SHA
  • TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
  • TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  • TLS_RSA_WITH_NULL_SHA256
  • TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA
  • TLS_KRB5_WITH_RC4_128_MD5
  • TLS_ECDHE_ECDSA_WITH_NULL_SHA
  • TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
  • TLS_ECDH_RSA_WITH_RC4_128_SHA
  • TLS_EMPTY_RENEGOTIATION_INFO_SCSV
  • TLS_KRB5_WITH_3DES_EDE_CBC_MD5
  • TLS_KRB5_WITH_RC4_128_SHA
  • TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
  • TLS_ECDH_RSA_WITH_NULL_SHA
  • TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
  • TLS_KRB5_WITH_DES_CBC_MD5
  • TLS_KRB5_EXPORT_WITH_RC4_40_MD5
  • TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5
  • TLS_ECDH_anon_WITH_AES_128_CBC_SHA
  • TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
  • TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
  • TLS_KRB5_WITH_DES_CBC_SHA
  • TLS_RSA_WITH_AES_128_CBC_SHA
  • TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA
  • TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
  • TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
  • TLS_ECDHE_RSA_WITH_NULL_SHA
  • TLS_RSA_WITH_AES_128_CBC_SHA256
  • TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
  • TLS_DHE_DSS_WITH_AES_128_CBC_SHA

SSLEnabledCipherSuites is used together with SSLCipherStrength .

Note: This configuration setting is available only in .NET and Java.

SSLAlgorithmList
A string that controls the cipher algorithms to be used by SSL
This configuration option takes a semicolon (;) delimited list of cipher algorithms to specify what algorithms may be used by SSL. This option can be used in conjunction with SSLEnabledProtocols to control which ciphers are used.For example:
 obj.Config("SSLEnabledProtocols=3072"); // TLS1.2  (supports SHA_256)
   obj.Config("SSLAlgorithmList=CALG_SHA_256;CALG_MD5"); 
Possible values include:
  • CALG_3DES
  • CALG_3DES_112
  • CALG_AES
  • CALG_AES_128
  • CALG_AES_192
  • CALG_AES_256
  • CALG_AGREEDKEY_ANY
  • CALG_CYLINK_MEK
  • CALG_DES
  • CALG_DESX
  • CALG_DH_EPHEM
  • CALG_DH_SF
  • CALG_DSS_SIGN
  • CALG_ECDH
  • CALG_ECDSA
  • CALG_ECMQV
  • CALG_HASH_REPLACE_OWF
  • CALG_HUGHES_MD5
  • CALG_HMAC
  • CALG_KEA_KEYX
  • CALG_MAC
  • CALG_MD2
  • CALG_MD4
  • CALG_MD5
  • CALG_NO_SIGN
  • CALG_OID_INFO_CNG_ONLY
  • CALG_OID_INFO_PARAMETERS
  • CALG_PCT1_MASTER
  • CALG_RC2
  • CALG_RC4
  • CALG_RC5
  • CALG_RSA_KEYX
  • CALG_RSA_SIGN
  • CALG_SCHANNEL_ENC_KEY
  • CALG_SCHANNEL_MAC_KEY
  • CALG_SCHANNEL_MASTER_HASH
  • CALG_SEAL
  • CALG_SHA
  • CALG_SHA1
  • CALG_SHA_256
  • CALG_SHA_384
  • CALG_SHA_512
  • CALG_SKIPJACK
  • CALG_SSL2_MASTER
  • CALG_SSL3_MASTER
  • CALG_SSL3_SHAMD5
  • CALG_TEK
  • CALG_TLS1_MASTER
  • CALG_TLS1PRF

This option is only valid in Windows.

Socket Configuration Settings

AbsoluteTimeout
Determines whether timeouts are inactivity timeouts or absolute timeouts
If AbsoluteTimeout is set to True, any method which does not complete within Timeout seconds will be aborted. By default, AbsoluteTimeout is False, and the timeout is an inactivity timeout.Note: This option is not valid for UDP ports.

FirewallData
Used to send extra data to the firewall
When the firewall is a tunneling proxy, use this property to send custom (additional) headers to the firewall (e.g. headers for custom authentication schemes).
InBufferSize
The size in bytes of the incoming queue of the socket
This is the size of an internal queue in the TCP/IP stack. You can increase or decrease its size depending on the amount of data that you will be receiving. Increasing the value of the InBufferSize setting can provide significant improvements in performance in some cases.Some TCP/IP implementations do not support variable buffer sizes. If that is the case, when the bean is activated the InBufferSize reverts to its defined size. The same happens if you attempt to make it too large or too small.

OutBufferSize
The size in bytes of the outgoing queue of the socket
This is the size of an internal queue in the TCP/IP stack. You can increase or decrease its size depending on the amount of data that you will be sending. Increasing the value of the OutBufferSize setting can provide significant improvements in performance in some cases.Some TCP/IP implementations do not support variable buffer sizes. If that is the case, when the bean is activated the OutBufferSize reverts to its defined size. The same happens if you attempt to make it too large or too small.

Base Configuration Settings

GUIAvailable
Tells the bean whether or not a message loop is available for processing events
In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The bean will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.In some non-GUI applications an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GuiAvailable to false will ensure that the bean does not attempt to process external events.

UseDaemonThreads
Whether threads created by the bean are daemon threads
If set to True, when the bean creates a thread the thread's Daemon property will be explicitly set to True. By default this setting is False and the bean will not set the Daemon property on the created thread.

Throws:
IPWorksSSLException

connect

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

This method connects to the IMAP server specified by MailServer and authenticates 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() 

Throws:
IPWorksSSLException

copyToMailbox

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

This method copies the messages specified by the MessageSet property to the mailbox specified by the Mailbox property.

Throws:
IPWorksSSLException

createMailbox

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

This method creates a new mailbox. The mailbox name is specified by the Mailbox property.

Throws:
IPWorksSSLException

deleteFromMailbox

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

This method marks the messages specified by MessageSet as deleted. Calling this method is equivalent to calling AddMessageFlags with "\Deleted" as the Flags parameter.

Throws:
IPWorksSSLException

deleteMailbox

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

This method deletes a mailbox. The mailbox name is specified by the Mailbox property.

Throws:
IPWorksSSLException

deleteMailboxACL

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

This message asks 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.

Throws:
IPWorksSSLException

disconnect

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

This method logs out and disconnects from the IMAP server.

Throws:
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.

Throws:
IPWorksSSLException

examineMailbox

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

This method asks 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 

Throws:
IPWorksSSLException

expungeMailbox

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

This method permanently removes 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() 

Throws:
IPWorksSSLException

fetchMessageHeaders

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

This method retrieves RFC822 headers of the message specified by MessageSet and stores them in the MessageHeaders property.

Throws:
IPWorksSSLException

fetchMessageInfo

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

This method retrieves 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 , MessageRecipients , etc. If the message is a multipart message, one or more MessagePart events are fired before the MessageInfo event - one for each message part.

Throws:
IPWorksSSLException

fetchMessagePart

public void fetchMessagePart(java.lang.String partId)
                      throws IPWorksSSLException
Retrieves the message part specified by PartID.

This method 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.

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

Throws:
IPWorksSSLException

fetchMessagePartHeaders

public void fetchMessagePartHeaders(java.lang.String partId)
                             throws IPWorksSSLException
Retrieves the headers of message part specified by PartID.

This method retrieves RFC822 headers of the message part specified by PartID and stores them in the MessageHeaders property.

Throws:
IPWorksSSLException

fetchMessageText

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

This method 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.

Throws:
IPWorksSSLException

getMailboxACL

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

This method retrieves the mailbox access control rights, which are provided through one or more MailboxACL events. 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)

Throws:
IPWorksSSLException

interrupt

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

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

Throws:
IPWorksSSLException

listMailboxes

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

This method lists all of the 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() 

Throws:
IPWorksSSLException

listSubscribedMailboxes

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

This method lists 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() 

Throws:
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".

Throws:
IPWorksSSLException

moveToMailbox

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

This method moves the messages specified by the MessageSet property to the mailbox specified by the Mailbox property.

Throws:
IPWorksSSLException

noop

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

This method 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).

Throws:
IPWorksSSLException

renameMailbox

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

This method allows the renaming of a mailbox. The mailbox is specified by the Mailbox property, and the new name is specified by the NewName parameter.

Throws:
IPWorksSSLException

resetMessageFlags

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

This method replaces 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
Mark a message as read.
\Answered
Mark a message as answered.
\Flagged
Mark a message as flagged.
\Draft
Mark a message as being incomplete (under composition).

Throws:
IPWorksSSLException

searchMailbox

public void searchMailbox(java.lang.String searchCriteria)
                   throws IPWorksSSLException
Search selected mailbox for specified text.

This method searches the selected mailbox using the criteria specified in the SearchCriteria parameter. For every message matching the criteria, the FetchMessageInfo method is called and a MessageInfo event is fired.

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.

Throws:
IPWorksSSLException

selectMailbox

public void selectMailbox()
                   throws IPWorksSSLException
Select a Mailbox.

This method asks 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 

Throws:
IPWorksSSLException

setMailboxACL

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

This method 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)

Throws:
IPWorksSSLException

setMessageStream

public void setMessageStream(java.io.OutputStream messageStream)
                      throws IPWorksSSLException
Sets the stream to which the message (or message part) downloaded from the server will be written.

This method sets the stream to which the message (or message part) downloaded from the server will be written. If a download stream is set before the Retrieve method is called, the downloaded data will be written to the stream. The stream should be open and normally set to position 0. The bean will automatically close this stream if ipworksssl.Imaps#config is true (default). If the stream is closed, you will need to call {@link ipworksssl.Imaps#setMessageStream SetMessageStream} again before calling {@link ipworksssl.Imaps#retrieve Retrieve} again. The downloaded content will be written starting at the current position in the stream.

Note: {@link ipworksssl.Imaps#setMessageStream SetMessageStream} and {@link ipworksssl.Imaps#getLocalFile LocalFile} will reset the other.

Throws:
IPWorksSSLException

subscribeMailbox

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

This method subscribes to the mailbox specified by the Mailbox property.

Throws:
IPWorksSSLException

unsetMessageFlags

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

This method removes 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
Mark a message as read.
\Answered
Mark a message as answered.
\Flagged
Mark a message as flagged.
\Draft
Mark a message as being incomplete (under composition).

Throws:
IPWorksSSLException

unsubscribeMailbox

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

This method unsubscribes from the mailbox specified by the Mailbox property.

Throws:
IPWorksSSLException

addImapsEventListener

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

removeImapsEventListener

public void removeImapsEventListener(ImapsEventListener l)

IP*Works! SSL V9

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