IP*Works! OpenPGP V9 - Online Help
IP*Works! OpenPGP V9
Questions / Feedback?

PIMAP Bean

Properties   Methods   Events   Configuration Settings   Errors  

The PIMAP component is used to communicate with IMAP servers to retrieve and process OpenPGP encrypted and/or signed messages and any attachments.

Syntax

IPWorksOpenPGP.Pimap

Remarks

The PIMAP bean offers an easy-to-use interface: it implements a standard IMAP client, as specified in RFC 1730 and RFC 2060, and supports decrypting and verifying signatures of encrypted and signed emails using OpenPGP. Additionally, it enables you to create messages bound for multiple recipients with different keys, simultaneously encrypt and compress with the most popular compression algorithms, and control other aspects such as the encrypting algorithm to use.

Connect to a Mail Server

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

Examine a Mailbox

Normally, after connecting to the server a Mailbox is selected (or examined) using the ExamineMailbox method. After the Mailbox is selected, MessageCount and RecentMessageCount show the number of messages in the mailbox, and MailboxFlags shows 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 Mailbox property and the MessageSet property. The MessageSet property denotes either a single message or a range of messages. Other arguments are specified through other properties such as SortCriteria, MessageFlags, etc.

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

Decrypt

To process an encrypted or signed message, first retrieve the message text and headers by calling FetchMessageHeaders and FetchMessageText. To decrypt a message specify the private key to be used for decryption by adding a key to Keys. For instance:

pimap.Keys.Add(new Key("c:\\my_keyring_dir", "recipient@nsoftware.com"));
pimap.Keys[0].Passphrase = "password";
The specified private key will be used to decrypt the message when calling Decrypt.

Verify

To verify the signature of a message specify the public key to be used for signature verification by adding a key to SignerKeys. For instance:

pimap.Keys.Add(new Key("c:\\my_keyring_dir", "sender@nsoftware.com"));
The specified public key will be used to verify the signature when calling VerifySignature. To decrypt and verify in one step call DecryptAndVerifySignature.

Retrieve MIME Message Parts

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

Trace Client and Server Communication

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

Property List


The following is the full list of the properties of the bean with short descriptions. Click on the links for further details.

AuthMechanismThe authentication mechanism to be used when connecting to the mail server.
AutoDecodePartsDetermines whether to automatically decode message parts.
CommandCan be used to send additional commands directly to the server.
ConnectedShows whether the component is connected.
EndByteThe byte index of the position where the transfer should end.
FirewallA set of properties related to firewall access.
IdleThe current status of the component.
KeysA collection of keys used for cryptographic operations.
LastReplyThe last reply from the server.
LocalHostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
MailboxName of the mailbox selected on the server.
MailboxFlagsDefines flags in the selected mailbox.
MailboxListCollection of mailboxes listed by the server.
MailPortThe port of the IMAP server (default is 143).
MailServerThe name or address of the mail server (IMAP server).
MessageProvides the raw message content.
MessageContentEncodingThe ContentEncoding of the selected message.
MessageContentTypeThe ContentType of the message.
MessageCountThe total number of messages on the Mailbox .
MessageDateThe time the message was created.
MessageDeliveryTimeThe time the message was delivered to the mail server.
MessageFlagsContains the flags of the current message.
MessageFromThe address of the author of the message.
MessageHeadersCollection of RFC822-encoded headers of the message.
MessageHeadersStringString version of RFC822-encoded headers of the message.
MessageIdThe message identifier of the current message.
MessageInfoCollection of messages retrieved by FetchMessageInfo .
MessageInReplyToThe unique message identifier of the message this one is in reply to.
MessageNetIdThe globally unique identifier of the message.
MessagePartsCollection of message parts collected by FetchMessageInfo .
MessageRecipientsCollection of recipients for the current message.
MessageReplyToEmail address(s) where replies to the message should be sent.
MessageSenderThe address of the sender of the message.
MessageSetThe set of messages to operate on.
MessageSizeThe size of the selected message.
MessageSubjectThe subject of the message.
MessageTextThe body of the retrieved message.
OverwriteIndicates whether or not the component should overwrite files during transfer.
PasswordThe password used to authenticate to the MailServer .
PeekModeWhen set to True, the message Seen flag is not changed during reading.
RecentMessageCountNumber of new messages in the Mailbox .
SignerKeysThe collection of keys belonging to the signer of the message.
SortCriteriaSorts criteria to use for message retrieval operations.
SSLAcceptServerCertInstructs the component to unconditionally accept the server certificate that matches the supplied certificate.
SSLCertThe certificate to be used during SSL negotiation.
SSLServerCertThe server certificate for the last established connection.
SSLStartModeDetermines how the component starts the SSL negotiation.
StartByteThe byte index of the position where the transfer should start.
TimeoutA timeout for the component.
UIDModeIf true, permanent message identifiers are used instead of the default temporary identifiers.
UIDValidityThe UIDValidity parameter sent from the server in response to SelectMailbox command.
UserThe user name used to authenticate to the MailServer .

Method List


The following is the full list of the methods of the bean with short descriptions. Click on the links for further details.

addMessageFlagsAdds the specified flags to the messages specified by MessageSet .
appendToMailboxAppends the message in MessageText to the mailbox specified by Mailbox .
checkMailboxSends a 'CHECK' command to the server.
closeMailboxRemoves all messages marked with 'Deleted' flag from the currently selected mailbox and unselect mailbox.
configSets or retrieves a configuration setting .
connectConnects to an IMAP server.
copyToMailboxCopies the messages specified by MessageSet to the mailbox specified by Mailbox .
createMailboxCreates a new mailbox specified by Mailbox .
decryptDecrypts the message.
decryptAndVerifySignatureDecrypts and verifies the signature of the message.
deleteFromMailboxMarks the messages specified by MessageSet as deleted.
deleteMailboxDeletes a mailbox specified by Mailbox .
deleteMailboxACLDeletes mailbox access control rights for a specific user.
disconnectDisconnects from an IMAP server.
doEventsProcesses events from the internal message queue.
examineMailboxSelects a Mailbox (Read-only mode).
expungeMailboxRemoves all messages marked with 'Deleted' flag from the currently selected mailbox.
fetchMessageHeadersRetrieves the message headers of messages specified by the MessageSet property.
fetchMessageInfoRetrieves information about messages specified by the MessageSet property.
fetchMessagePartRetrieves the message part specified by PartID.
fetchMessagePartHeadersRetrieves the headers of message part specified by PartID.
fetchMessageTextRetrieves the message text of messages specified by the MessageSet property.
getMailboxACLRetrieves mailbox access control rights.
interruptInterrupt the current method.
listMailboxesLists all mailboxes matching all criteria in the Mailbox property.
listSubscribedMailboxesLists all subscribed mailboxes matching all criteria in the Mailbox property.
localizeDateConverts a valid RFC 822 message date to local date and time.
moveToMailboxMoves the messages specified by MessageSet to the mailbox specified by Mailbox .
noopSends a 'NOOP' command to the server.
renameMailboxChange the name of Mailbox to NewName .
resetMessageFlagsReplaces the flags of the messages specified by MessageSet with the flags specified by MessageFlags .
searchMailboxSearch selected mailbox for specified text.
selectMailboxSelect a Mailbox.
setMailboxACLSets mailbox access control rights for a specific user.
setMessageStreamSets the stream to which the message (or message part) downloaded from the server will be written.
subscribeMailboxSubscribes to the mailbox specified by Mailbox .
unsetMessageFlagsRemoves the flags specified by MessageFlags from the messages specified by MessageSet .
unsubscribeMailboxUnsubscribes from the mailbox specified by Mailbox .
verifySignatureVerifies the signature of the current message.

Event List


The following is the full list of the events fired by the bean with short descriptions. Click on the links for further details.

ConnectionStatusFired to indicate changes in connection state.
EndTransferFired when the message or the part data finishes transferring.
ErrorInformation about errors during data delivery.
HeaderFired every time a header line comes in.
KeyPassphraseFired if the passphrase of current key is incorrect or empty.
MailboxACLFires for each set of access control rights returned by the server.
MailboxListFired for each mailbox received through the ListMailboxes and ListSubscribedMailboxes methods.
MessageInfoFired with information for the message(s) retrieved by the server.
MessagePartFired for each message part when FetchMessageInfo is called.
PITrailTraces the commands sent to the mail server, and the respective replies.
ProgressFired as progress is made.
RecipientInfoFired for each recipient key of the encrypted message.
SignatureInfoFired during verification of the signed message.
SSLServerAuthenticationFired after the server presents its certificate to the client.
SSLStatusShows the progress of the secure connection.
StartTransferFired when the message or the part data starts transferring.
StatusShows the progress of the operation.
TransferFired while the message gets transferred from the MailServer .
VerificationStatusFired after verification of the signed message.

Configuration Settings


The following is a list of configuration settings for the bean with short descriptions. Click on the links for further details.

CommentThe OpenPGP message comment.
ProcessAttachmentsWhether or not to process attachments.
LogLevelSpecifies the level of detail that is logged.
RequireValidSignatureSpecifies if an invalid signature is considered an error condition.
SymmetricPassphraseThe password used for symmetric encryption or decryption.
VersionHeaderThe Version header value in the ASCII armored OpenPGP message.
AlwaysReturnUIDsInstructs the server to return UIDs even if not in UIDMode.
AppendToMailboxDateTimeSpecifies the date-time parameter used in the initial APPEND request.
AuthorizationIdentityThe value to use as the authorization identity when SASL authentication is used.
AutoDecodeSubjectInstructs the component to automatically decode message subjects.
EnableIMAPIDLEEnables or disables IDLE command support in the component.
FetchAfterSearchDetermines if messages matching the SearchCriteria are fetched after calling SearchMailbox.
IncludeHeadersInstructs the component to include the headers in the LocalFile.
UTF7MailboxNamesSpecifies whether or not to automatically encode and decode UTF-7 mailbox names.
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the component whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe TCP port in the local host where the component binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
RecordLengthThe length of received data records.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
UseIPv6Whether to use IPv6.
TcpNoDelayWhether or not to delay when sending packets.
ReuseSSLSessionDetermines if the SSL session is reused.
SSLCipherStrengthThe minimum cipher strength used for bulk encryption.
SSLEnabledProtocolsUsed to enable/disable the supported security protocols.
SSLProviderThe name of the security provider to use.
SSLSecurityFlagsFlags that control certificate verification.
OpenSSLCADirThe path to a directory containing CA certificates.
OpenSSLCAFileName of the file containing the list of CA's trusted by your application.
OpenSSLCipherListA string that controls the ciphers to be used by SSL.
OpenSSLPrngSeedDataThe data to seed the pseudo random number generator (PRNG).
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
CodePageThe system code page used for Unicode to Multibyte translations.

 
 
Copyright (c) 2017 /n software inc. - All rights reserved.
Build 9.0.6240.0