|
IP*Works! SSL V9 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectipworksssl.Pops
public class Pops
The POPS Bean is used to easily retrieve electronic mail from Internet Post Office servers (POP).
The POPS Bean is the SSL-enabled equivalent (RFC 2595) of the IP*Works! POP bean. The main difference is the introduction of a set of new configuration settings, properties and events that deal with SSL security. The ipworksssl.Pops#config and {@link ipworksssl.Pops#config configuration settings determine which protocols are enabled and at what security level. The {@link ipworksssl.Pops#getSSLCert SSLCert} property is used to select a client certificate if the server is requesting client authentication. The {@link ipworksssl.Pops#config configuration setting, together with the {@link ipworksssl.PopsSSLServerAuthenticationEvent SSLServerAuthentication} event allow you to check the server identity and other security attributes. Finally, the {@link ipworksssl.PopsSSLStatusEvent SSLStatus} event provides information about the SSL handshake.
The POPS Bean implements a standard internet post office (POP3) client as specified in RFC 1725.
To connect to a {@link ipworksssl.Pops#getMailServer MailServer} first set the appropriate {@link ipworksssl.Pops#getUser User} and {@link ipworksssl.Pops#getPassword Password} and then connect by calling the {@link ipworksssl.Pops#connect Connect} method. Upon successful connection to the {@link ipworksssl.Pops#getMailServer MailServer} , the number of waiting messages is shown by the {@link ipworksssl.Pops#getMessageCount MessageCount} property. A message is selected by setting the {@link ipworksssl.Pops#getMessageNumber MessageNumber} property to a number between 1 and {@link ipworksssl.Pops#getMessageCount MessageCount} (inclusive). Then, message text and/or headers are received by calling the {@link ipworksssl.Pops#retrieve Retrieve} method.
The message text is received through the {@link ipworksssl.PopsTransferEvent Transfer} event, whereas the message headers are received through the {@link ipworksssl.PopsHeaderEvent Header} event. Additionally, up to {@link ipworksssl.Pops#getMaxLines MaxLines} from the message body are provided in the {@link ipworksssl.Pops#getMessageText MessageText} property. The body of the message is also saved in the file specified by the {@link ipworksssl.Pops#getLocalFile LocalFile} property. {@link ipworksssl.PopsStartTransferEvent StartTransfer} and {@link ipworksssl.PopsEndTransferEvent EndTransfer} events are fired at the beginning and end of message transmission. The {@link ipworksssl.PopsPITrailEvent PITrail} event provides a trace of the interaction between the client and server (excluding message transfers).
| Field Summary | |
|---|---|
static int |
amAPOP
|
static int |
amCRAMMD5
|
static int |
amKerberos
|
static int |
amNTLM
|
static int |
amSASLDigestMD5
|
static int |
amSASLPlain
|
static int |
amUserPassword
|
static int |
sslAutomatic
|
static int |
sslExplicit
|
static int |
sslImplicit
|
static int |
sslNone
|
| Constructor Summary | |
|---|---|
Pops()
Creates an instance of Pops Bean. |
|
Pops(java.lang.String runtimeLicense)
Creates an instance of Pops Bean with specified run-time license. |
|
| Method Summary | |
|---|---|
void |
addPopsEventListener(PopsEventListener l)
|
java.lang.String |
config(java.lang.String configurationString)
Sets or retrieves a {@link ipworksssl.Pops#config configuration setting. |
void |
connect()
Connects to the mail server and attempts to login. |
void |
delete()
Deletes a message specified by MessageNumber on the server. |
void |
disconnect()
Disconnects from the mail server. |
void |
doEvents()
Processes events from the internal message queue. |
int |
getAuthMechanism()
The authentication mechanism to be used when connecting to the mail server. |
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. |
int |
getMailPort()
The server port for POP (default 110). |
java.lang.String |
getMailServer()
The name or address of a mail server (internet post office server). |
int |
getMaxLines()
The maximum number of message lines besides headers to retrieve. |
byte[] |
getMessage()
Provides the raw message content. |
java.lang.String |
getMessageCc()
The value of the CC header of the last retrieved message. |
int |
getMessageCount()
The number of messages in the mailbox. |
java.lang.String |
getMessageDate()
The value of the date header of the last retrieved message. |
java.lang.String |
getMessageFrom()
The value of the from header of the last retrieved message. |
HeaderList |
getMessageHeaders()
Collection of the message headers as retrieved from the server. |
java.lang.String |
getMessageHeadersString()
A string representation of the full headers of the message as retrieved from the server. |
int |
getMessageNumber()
Current (selected) message. |
MessageRecipientList |
getMessageRecipients()
A collection of recipients for the current message. |
java.lang.String |
getMessageReplyTo()
The value of the Reply-To header of the last retrieved message. |
int |
getMessageSize()
The size in bytes of the current message. |
java.lang.String |
getMessageSubject()
The value of the Subject header of the last retrieved message. |
java.lang.String |
getMessageText()
The full text of the message as retrieved from the server. |
java.lang.String |
getMessageTo()
The value of the To header of the last retrieved message. |
java.lang.String |
getMessageUID()
The unique identifier of the message as specified by the server. |
java.lang.String |
getPassword()
The password for the mailbox user. |
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. |
int |
getTimeout()
A timeout for the bean. |
long |
getTotalSize()
Cumulative size in bytes of messages in the mailbox (including headers). |
java.lang.String |
getUser()
The user identifier for the mailbox. |
void |
interrupt()
Interrupt the current method. |
boolean |
isConnected()
Shows whether the bean is connected. |
boolean |
isIdle()
The current status of the component. |
boolean |
isIncludeHeaders()
Instructs the component to include the headers in the MessageText and LocalFile. |
void |
listMessageSizes()
Retrieves a list of all message sizes from the server. |
void |
listMessageUIDs()
Retrieves a list of all message UIDs from the server. |
java.lang.String |
localizeDate(java.lang.String dateTime)
Converts a valid RFC 822 message date to local date and time. |
void |
removePopsEventListener(PopsEventListener l)
|
void |
reset()
Resets all changes and revert back to the state when the user first connected. |
void |
retrieve()
Retrieves a message specified by MessageNumber from the server. |
void |
retrieveHeaders()
Retrieves headers for a message specified by MessageNumber . |
void |
setAuthMechanism(int authMechanism)
The authentication mechanism to be used when connecting to the mail server. |
void |
setCommand(java.lang.String command)
Used to send additional commands directly to the server. |
void |
setConnected(boolean connected)
Shows whether the bean is connected. |
void |
setFirewall(Firewall firewall)
A set of properties related to firewall access. |
void |
setIncludeHeaders(boolean includeHeaders)
Instructs the component to include the headers in the MessageText and LocalFile. |
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 |
setMailPort(int mailPort)
The server port for POP (default 110). |
void |
setMailServer(java.lang.String mailServer)
The name or address of a mail server (internet post office server). |
void |
setMaxLines(int maxLines)
The maximum number of message lines besides headers to retrieve. |
void |
setMessageNumber(int messageNumber)
Current (selected) message. |
void |
setMessageStream(java.io.OutputStream messageStream)
Sets the stream to which the message downloaded from the server will be written. |
void |
setPassword(java.lang.String password)
The password for the mailbox user. |
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 |
setTimeout(int timeout)
A timeout for the bean. |
void |
setUser(java.lang.String user)
The user identifier for the mailbox. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int amUserPassword
public static final int amCRAMMD5
public static final int amNTLM
public static final int amAPOP
public static final int amSASLPlain
public static final int amSASLDigestMD5
public static final int amKerberos
public static final int sslAutomatic
public static final int sslImplicit
public static final int sslExplicit
public static final int sslNone
| Constructor Detail |
|---|
public Pops()
public Pops(java.lang.String runtimeLicense)
| Method Detail |
|---|
public int getAuthMechanism()
This property is used as the authentication mechanism when connecting to the mail server. By default, this property is amUserPassword (0), and default plaintext authentication is used to login to the server. Other, more secure, options include amCRAMMD5 (1) for CRAM-MD5, amNTLM (2) for NTLM authentication, amAPOP (3) for APOP authentication, and amSASLDigestMD5 (5) for SASL DIGEST-MD5 authentication.
amSASLPlain (4) is also available, but most servers require a secure SSL connection when utilizing this authentication mechanism.
amKerberos (6) is for Kerberos authentication. NOTE: This functionality is only available in Windows.
public void setAuthMechanism(int authMechanism)
throws IPWorksSSLException
This property is used as the authentication mechanism when connecting to the mail server. By default, this property is amUserPassword (0), and default plaintext authentication is used to login to the server. Other, more secure, options include amCRAMMD5 (1) for CRAM-MD5, amNTLM (2) for NTLM authentication, amAPOP (3) for APOP authentication, and amSASLDigestMD5 (5) for SASL DIGEST-MD5 authentication.
amSASLPlain (4) is also available, but most servers require a secure SSL connection when utilizing this authentication mechanism.
amKerberos (6) is for Kerberos authentication. NOTE: This functionality is only available in Windows.
IPWorksSSLException
public void setCommand(java.lang.String command)
throws IPWorksSSLException
This property can be used to send additional commands directly to the server. Check the LastReply property and/or trap the PITrail events
coming from the server to get the response.
IPWorksSSLExceptionpublic boolean isConnected()
This property is used to determine whether or not the bean is connected to the remote host.
public void setConnected(boolean connected)
throws IPWorksSSLException
This property is used to determine whether or not the bean is connected to the remote host.
IPWorksSSLExceptionpublic Firewall getFirewall()
This is a Firewall type property which
contains fields describing the firewall
through which the bean will attempt to connect.
public void setFirewall(Firewall firewall)
throws IPWorksSSLException
This is a Firewall type property which
contains fields describing the firewall
through which the bean will attempt to connect.
IPWorksSSLExceptionpublic boolean isIdle()
Idle will be False if the component is currently busy (communicating
and/or waiting for an answer), and True at all other times.
public boolean isIncludeHeaders()
This property instructs the component to include the headers in the MessageText and LocalFile. If set to true, the headers for the message you are retrieving will be placed before the message body in the MessageText property;. If LocalFile is set, then the headers will be written to that file before the message body. In this manner,
the whole content of a MIME-encoded message can be passed to the MIME bean for further message processing.
public void setIncludeHeaders(boolean includeHeaders)
throws IPWorksSSLException
This property instructs the component to include the headers in the MessageText and LocalFile. If set to true, the headers for the message you are retrieving will be placed before the message body in the MessageText property;. If LocalFile is set, then the headers will be written to that file before the message body. In this manner,
the whole content of a MIME-encoded message can be passed to the MIME bean for further message processing.
IPWorksSSLExceptionpublic java.lang.String getLastReply()
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.
public java.lang.String getLocalFile()
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.
public void setLocalFile(java.lang.String localFile)
throws IPWorksSSLException
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.
IPWorksSSLExceptionpublic java.lang.String getLocalHost()
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.
public void setLocalHost(java.lang.String localHost)
throws IPWorksSSLException
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.
IPWorksSSLExceptionpublic int getMailPort()
This property contains the server port for POP (default 110). 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 995 (please refer to the SSLStartMode property
for more information).
public void setMailPort(int mailPort)
throws IPWorksSSLException
This property contains the server port for POP (default 110). 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 995 (please refer to the SSLStartMode property
for more information).
IPWorksSSLExceptionpublic java.lang.String getMailServer()
This property specifies the IP address (IP number in dotted internet format) or the Domain Name of the mail server. It is 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 and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful the bean throws an exception.
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.
public void setMailServer(java.lang.String mailServer)
throws IPWorksSSLException
This property specifies the IP address (IP number in dotted internet format) or the Domain Name of the mail server. It is 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 and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful the bean throws an exception.
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.
IPWorksSSLExceptionpublic int getMaxLines()
This property is used to limit the number of text lines besides headers retrieved for messages. It can be used to preview message headers and a portion of their contents, without incurring the overhead of downloading the entire message.
The default value of the property is 0. In this case the entire message will be retrieved, without interruptions.
public void setMaxLines(int maxLines)
throws IPWorksSSLException
This property is used to limit the number of text lines besides headers retrieved for messages. It can be used to preview message headers and a portion of their contents, without incurring the overhead of downloading the entire message.
The default value of the property is 0. In this case the entire message will be retrieved, without interruptions.
IPWorksSSLExceptionpublic byte[] getMessage()
This property is populated after calling Retrieve and holds the raw message content.
This can be used to access the data before any processing is done by the bean.
public java.lang.String getMessageCc()
This property contains the value of the CC header of the last retrieved message. The same information may also be retrieved through the Header event.
public int getMessageCount()
This property contains the number of messages in the mailbox. When the bean is not connected to the server, the value of this property is 0. When connected, it contains the number of messages in the mail box as reported by the POP server.
public java.lang.String getMessageDate()
This property contains the value of the date header of the last retrieved message. The same information may also be retrieved through the Header event.
public java.lang.String getMessageFrom()
This property contains the value of the from header of the last retrieved message. The same information may also be retrieved through the Header event.
public HeaderList getMessageHeaders()
This property contains a collection of the message headers as retrieved from the server. If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is an
empty collection. Otherwise, it contains a parsed collection of the full
headers of the mail message as reported by the server.
The MailServer is asked about the headers of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
Example (Connect and Retrieve Message)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
MessageText = POPControl.MessageText
MessageHeaders = POPControl.MessageHeaders
public java.lang.String getMessageHeadersString()
This property contains a string representation of the full headers of the message as retrieved from the server. If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is an
empty string. Otherwise, it contains the full headers of the mail message
as reported by the server.
The MailServer is asked about the headers of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
Example (Connect and Retrieve Message)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
MessageText = POPControl.MessageText
MessageHeadersString = POPControl.MessageHeadersString
public int getMessageNumber()
This property indicates the current/selected message. This property specifies a message number in between
1 and MessageCount . The various bean methods related to
single messages use this property as a message pointer (see method
descriptions and the MessageSize property).
public void setMessageNumber(int messageNumber)
throws IPWorksSSLException
This property indicates the current/selected message. This property specifies a message number in between
1 and MessageCount . The various bean methods related to
single messages use this property as a message pointer (see method
descriptions and the MessageSize property).
IPWorksSSLExceptionpublic MessageRecipientList getMessageRecipients()
This property contains a collection of recipients for the current message. This collection describes all of the people
to whom the last retrieved message was sent.
Each messagerecipient contains information
describing that recipient, and what type of
recipient it is.
This collection is indexed from 0 to size - 1.
public java.lang.String getMessageReplyTo()
This property contains the value of the Reply-To header of the last retrieved message. The same information may also be retrieved through the Header event.
public int getMessageSize()
This property contains the size in bytes of the current message. If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is 0.
Otherwise, it contains the size of the mail message (including
headers) as reported by the server.
The MailServer is asked about the size of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
public java.lang.String getMessageSubject()
This property contains the value of the Subject header of the last retrieved message. The same information may also be retrieved through the Header event.
public java.lang.String getMessageText()
This property contains the full text of the message as retrieved from the server. If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is an
empty string. Otherwise, it contains the text of the mail message
as reported by the server (a maximum of MaxLines ).
The MailServer is asked about the text of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
Example (Connect and Retrieve Message)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
MessageText = POPControl.MessageText
MessageHeaders = POPControl.MessageHeaders
public java.lang.String getMessageTo()
This property contains the value of the To header of the last retrieved message. The same information may also be retrieved through the Header event.
public java.lang.String getMessageUID()
This property contains the unique identifier of the message as specified by the server. If the bean is not connected, or MessageNumber does not
contain a valid message number, the value of this property is an
empty string. Otherwise, it contains the UID of the mail message
as reported by the server.
The MailServer is asked about the UID of the message only
if the MessageNumber property has changed. If MessageNumber has not changed, the bean returns a cached value.
public java.lang.String getPassword()
This property contains the password for the mailbox user. This property must be set before the bean connects to the MailServer .
public void setPassword(java.lang.String password)
throws IPWorksSSLException
This property contains the password for the mailbox user. This property must be set before the bean connects to the MailServer .
IPWorksSSLExceptionpublic Certificate getSSLAcceptServerCert()
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.
public void setSSLAcceptServerCert(Certificate SSLAcceptServerCert)
throws IPWorksSSLException
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.
IPWorksSSLExceptionpublic Certificate getSSLCert()
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.
public void setSSLCert(Certificate SSLCert)
throws IPWorksSSLException
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.
IPWorksSSLExceptionpublic Certificate getSSLServerCert()
SSLServerCert contains the server certificate for the
last established connection.
SSLServerCert is reset every time a new connection is attempted.
public int getSSLStartMode()
The SSLStartMode property may have one of the following values:
SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit
( sslImplicit ).
public void setSSLStartMode(int SSLStartMode)
throws IPWorksSSLException
The SSLStartMode property may have one of the following values:
SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit
( sslImplicit ).
IPWorksSSLExceptionpublic int getTimeout()
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.Pops#config configuration setting.
The default value for the {@link ipworksssl.Pops#getTimeout Timeout} property is 60 (seconds).
public void setTimeout(int timeout)
throws IPWorksSSLException
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.Pops#config configuration setting.
The default value for the {@link ipworksssl.Pops#getTimeout Timeout} property is 60 (seconds).
IPWorksSSLExceptionpublic long getTotalSize()
This property contains the cumulative size in bytes of messages in the mailbox (including headers). When the bean is not connected to the server, the value of this property is 0. When connected, it contains the cumulative size of all the messages in the mail box as reported by the POP server.
public java.lang.String getUser()
This property contains the user identifier for the mailbox. This property must be set before the bean connects to the MailServer .
public void setUser(java.lang.String user)
throws IPWorksSSLException
This property contains the user identifier for the mailbox. This property must be set before the bean connects to the MailServer .
IPWorksSSLException
public java.lang.String config(java.lang.String configurationString)
throws IPWorksSSLException
{@link ipworksssl.Pops#config Config} is a generic method available in every bean. It is used to set and retrieve {@link ipworksssl.Pops#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.Pops#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.Pops#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.Pops#config Config} method.
NOTE: This functionality is only available in Java and .NET.
NOTE: This is the same as Host . This setting is provided for use by beans that do not directly expose Firewall properties.
{@link ipworksssl.Pops#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.PopsConnectionStatusEvent ConnectionStatus} event.
The connection to the firewall is made by calling the {@link ipworksssl.Pops#connect Connect} method.
In the second scenario, {@link ipworksssl.Pops#config is a positive value, the system will attempt to send pending data until the specified {@link ipworksssl.Pops#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.
If the bean is connected, the {@link ipworksssl.Pops#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).
{@link ipworksssl.Pops#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.
If no {@link ipworksssl.Pops#getEOL EOL} is found, and {@link ipworksssl.Pops#config bytes are accumulated in the buffer, the {@link ipworksssl.PopsDataInEvent DataIn} event is fired with the EOL parameter set to False, and the buffer is reset.
The minimum value for {@link ipworksssl.Pops#config is 256 bytes. The default value is 2048 bytes. The maximum value is 65536 bytes.
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.Pops#config config setting.
When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the {@link ipworksssl.Pops#config config setting.
TLS 1.1 and TLS1.2 support are only available starting with Windows 7.
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.
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:
SSLEnabledCipherSuites is used together with SSLCipherStrength .
Note: This configuration setting is available only in .NET and Java.
obj.Config("SSLEnabledProtocols=3072"); // TLS1.2 (supports SHA_256)
obj.Config("SSLAlgorithmList=CALG_SHA_256;CALG_MD5"); Possible values include:
This option is only valid in Windows.
IPWorksSSLException
public void connect()
throws IPWorksSSLException
This method connects to the mail server and attempts to login using the current User and Password . Then it retrieves initial statistics about
the mailbox contents ( MessageCount and TotalSize ).
Example (Connect to POP Mailbox)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
POPControl.Retrieve()
MessageText = POPControl.MessageText
MessageHeaders = POPControl.MessageHeaders
IPWorksSSLException
public void delete()
throws IPWorksSSLException
MessageNumber on the server.
This method asks the MailServer to delete the message specified by MessageNumber . The message will not
actually be deleted from the server until the connection is closed. In order to cancel a previous
Delete, use the Reset method.
IPWorksSSLException
public void disconnect()
throws IPWorksSSLException
This method makes the bean disconnect from the MailServer by sending the QUIT
command. If successful, all changes to the mailbox are committed by the server.
Otherwise, changes are rolled back to the initial state that the server was in before
the connection.
IPWorksSSLException
public void doEvents()
throws IPWorksSSLException
When DoEvents is called, the bean processes any
available events. If no events are available, it waits for a
preset period of time, and then returns.
IPWorksSSLException
public void interrupt()
throws IPWorksSSLException
If there is no method in progress, Interrupt simply returns, doing nothing.
IPWorksSSLException
public void listMessageSizes()
throws IPWorksSSLException
This message retrieves a list of all message sizes from the server. For each message listed, a MessageList event will fire containing the number and size of the message.
IPWorksSSLException
public void listMessageUIDs()
throws IPWorksSSLException
This method retrieves a list of all message UIDs from the server. For each message listed, a MessageList event will fire containing the number and UID of the message.
IPWorksSSLException
public java.lang.String localizeDate(java.lang.String dateTime)
throws IPWorksSSLException
This method can be used to convert an RFC 822 date/time string to the corresponding local date and time.
Dates will be returned in the format: "MM/dd/yyyy hh:mm:ss".
IPWorksSSLException
public void reset()
throws IPWorksSSLException
This method is used to reset all changes and revert back to the state when the user first connected. Asks the MailServer to reset all changes and revert back to the state
it was when connected.
IPWorksSSLException
public void retrieve()
throws IPWorksSSLException
MessageNumber from the server.
This method is used to retrieve a message specified by MessageNumber from the server. It asks the MailServer to retrieve the message specified by MessageNumber .
The message headers will arrive in the Header event, and the message text will
arrive in the Transfer event.
The MaxLines property defines the number of lines retrieved.
Example (Connect and Retrieve Message)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
POPControl.Retrieve()
IPWorksSSLException
public void retrieveHeaders()
throws IPWorksSSLException
MessageNumber .
Calling this method will retrieve the headers for the message specified
by the MessageNumber property. The message headers
will be provided by the Header event and also stored in the MessageHeaders property.
Example (Connect and Retrieve Message Headers)
POPControl.MailServer = "MyPOPServer"
POPControl.User = "username"
POPControl.Password = "password"
POPControl.Connect()
POPControl.MessageNumber = 1
POPControl.RetrieveHeaders()
IPWorksSSLException
public void setMessageStream(java.io.OutputStream messageStream)
throws IPWorksSSLException
This method sets the stream to which the message 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.Pops#config is set to true (default). If the stream is closed, you will need to call {@link ipworksssl.Pops#setMessageStream SetMessageStream} again before calling {@link ipworksssl.Pops#retrieve Retrieve} again.
The downloaded content will be written starting at the current position in the stream.
Note: {@link ipworksssl.Pops#setMessageStream SetMessageStream} and {@link ipworksssl.Pops#getLocalFile LocalFile} will reset the other.
IPWorksSSLException
public void addPopsEventListener(PopsEventListener l)
throws java.util.TooManyListenersException
java.util.TooManyListenersExceptionpublic void removePopsEventListener(PopsEventListener l)
|
IP*Works! SSL V9 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||