SecureBlackbox 2020 Python Edition

Questions / Feedback?

IMAPClient Class

Properties   Methods   Events   Configuration Settings   Errors  

The IMAPClient class provides client-side functionality for IMAP4 (Internet Message Access Protocol).

Syntax

class secureblackbox.IMAPClient

Remarks

Use this class to manage E-mail and retrieve E-mail messages from the remote IMAP servers.

Property List


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

blocked_cert_countThe number of records in the BlockedCert arrays.
blocked_cert_bytesReturns raw certificate data in DER format.
blocked_cert_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
client_cert_countThe number of records in the ClientCert arrays.
client_cert_bytesReturns raw certificate data in DER format.
client_cert_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
conn_info_aead_cipherIndicates whether the encryption algorithm used is an AEAD cipher.
conn_info_chain_validation_detailsThe details of a certificate chain validation outcome.
conn_info_chain_validation_resultThe outcome of a certificate chain validation routine.
conn_info_ciphersuiteThe cipher suite employed by this connection.
conn_info_client_authenticatedSpecifies whether client authentication was performed during this connection.
conn_info_client_auth_requestedSpecifies whether client authentication was requested during this connection.
conn_info_connection_establishedIndicates whether the connection has been established fully.
conn_info_connection_idThe unique identifier assigned to this connection.
conn_info_digest_algorithmThe digest algorithm used in a TLS-enabled connection.
conn_info_encryption_algorithmThe symmetric encryption algorithm used in a TLS-enabled connection.
conn_info_exportableIndicates whether a TLS connection uses a reduced-strength exportable cipher.
conn_info_key_exchange_algorithmThe key exchange algorithm used in a TLS-enabled connection.
conn_info_key_exchange_key_bitsThe length of the key exchange key of a TLS-enabled connection.
conn_info_named_ec_curveThe elliptic curve used in this connection.
conn_info_pfs_cipherIndicates whether the chosen ciphersuite provides perfect forward secrecy (PFS).
conn_info_pre_shared_identity_hintA hint professed by the server to help the client select the PSK identity to use.
conn_info_public_key_bitsThe length of the public key.
conn_info_resumed_sessionIndicates whether a TLS-enabled connection was spawned from another TLS connection.
conn_info_secure_connectionIndicates whether TLS or SSL is enabled for this connection.
conn_info_server_authenticatedIndicates whether server authentication was performed during a TLS-enabled connection.
conn_info_signature_algorithmThe signature algorithm used in a TLS handshake.
conn_info_symmetric_block_sizeThe block size of the symmetric algorithm used.
conn_info_symmetric_key_bitsThe key length of the symmetric algorithm used.
conn_info_total_bytes_receivedThe total number of bytes received over this connection.
conn_info_total_bytes_sentThe total number of bytes sent over this connection.
conn_info_validation_logContains the server certificate's chain validation log.
conn_info_versionIndicates the version of SSL/TLS protocol negotiated during this connection.
curr_mailbox_message_flagsContains message flags defined in the mailbox.
curr_mailbox_nameSpecifies mailbox name.
curr_mailbox_next_uidReturns the next unique identifier value.
curr_mailbox_permanent_flagsContains a list of message flags that can be changed permanently.
curr_mailbox_read_onlySpecifies whether the mailbox is write-protected.
curr_mailbox_recent_messagesThe number of recent messages in the mailbox.
curr_mailbox_total_messagesTotal number of messages in the mailbox.
curr_mailbox_uid_validitySpecifies UID validity value.
curr_mailbox_unseen_messagesThe number of unseen messages in the mailbox.
known_cert_countThe number of records in the KnownCert arrays.
known_cert_bytesReturns raw certificate data in DER format.
known_cert_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
known_crl_countThe number of records in the KnownCRL arrays.
known_crl_bytesReturns raw CRL data in DER format.
known_crl_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
known_ocsp_countThe number of records in the KnownOCSP arrays.
known_ocsp_bytesBuffer containing raw OCSP response data.
known_ocsp_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
mailbox_info_countThe number of records in the MailboxInfo arrays.
mailbox_info_delimiterMailbox hierarchy delimiter.
mailbox_info_has_childrenSpecifies whether the mailbox has \\HasChildren attribute specified.
mailbox_info_has_no_childrenSpecifies whether the mailbox has \\HasNoChildren attribute specified.
mailbox_info_markedSpecifies whether the mailbox has \\Marked attribute specified.
mailbox_info_nameSpecifies mailbox name.
mailbox_info_no_inferiorsSpecifies whether the mailbox has \\NoInferiors attribute specified.
mailbox_info_no_selectSpecifies whether the mailbox has \\NoSelect attribute specified.
mailbox_info_unmarkedSpecifies whether the mailbox has \\Unmarked attribute specified.
msg_attachment_countReturns the number of attachments in this message.
msg_bccThe contents of the BCC header property.
msg_ccThe value of the CC header property.
msg_commentsContains additional information about the message body.
msg_dateThe date and time when the message entered the mail delivery system.
msg_delivery_receiptEnables delivery notification.
msg_fromContains the value of the From header property.
msg_html_textThe HTML version of the message.
msg_idThe contents of the Message-ID header property.
msg_in_reply_toThe value of the In-Reply-To header property.
msg_keywordsThe value of the Keywords header property.
msg_mailerThe name of the software that was used to send the message.
msg_plain_textThe plain text version of the message.
msg_prioritySpecifies the message priority.
msg_read_receiptEnables a read notification.
msg_referencesThe value of the References header property.
msg_reply_toThe value of the Reply-To header property.
msg_return_pathThe value of the Return-Path header property.
msg_senderThe value of the Sender header property.
msg_send_toThe value of the To header property.
msg_subjectContains the subject property of this message.
msg_info_countThe number of records in the MsgInfo arrays.
msg_info_dateContains the value of the Date header property.
msg_info_flagsReturns the flags currently set to the mail message.
msg_info_fromContains the value of the From header property.
msg_info_internal_dateReturns the internal date of the mail message.
msg_info_sent_toContains the value of the To header property.
msg_info_sizeReturns the size of the message in bytes.
msg_info_subjectContains the value of the Subject header property.
msg_info_uidReturns the unique ID of the mail message.
passwordThe authentication password.
proxy_addressThe IP address of the proxy server.
proxy_authenticationThe authentication type used by the proxy server.
proxy_passwordThe password to authenticate to the proxy server.
proxy_portThe port on the proxy server to connect to.
proxy_proxy_typeThe type of the proxy server.
proxy_request_headersContains HTTP request headers for WebTunnel and HTTP proxy.
proxy_response_bodyContains the HTTP or HTTPS (WebTunnel) proxy response body.
proxy_response_headersContains response headers received from an HTTP or HTTPS (WebTunnel) proxy server.
proxy_use_i_pv6Specifies whether IPv6 should be used when connecting through the proxy.
proxy_use_proxyEnables or disables proxy-driven connection.
proxy_usernameSpecifies the username credential for proxy authentication.
server_cert_countThe number of records in the ServerCert arrays.
server_cert_bytesReturns raw certificate data in DER format.
server_cert_ca_key_idA unique identifier (fingerprint) of the CA certificate's private key.
server_cert_fingerprintContains the fingerprint (a hash imprint) of this certificate.
server_cert_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
server_cert_issuerThe common name of the certificate issuer (CA), typically a company name.
server_cert_issuer_rdnA collection of information, in the form of [OID, Value] pairs, uniquely identifying the certificate issuer.
server_cert_key_algorithmSpecifies the public key algorithm of this certificate.
server_cert_key_bitsReturns the length of the public key.
server_cert_key_fingerprintReturns a fingerprint of the public key contained in the certificate.
server_cert_key_usageIndicates the purposes of the key contained in the certificate, in the form of an OR'ed flag set.
server_cert_public_key_bytesContains the certificate's public key in DER format.
server_cert_self_signedIndicates whether the certificate is self-signed (root) or signed by an external CA.
server_cert_serial_numberReturns the certificate's serial number.
server_cert_sig_algorithmIndicates the algorithm that was used by the CA to sign this certificate.
server_cert_subjectThe common name of the certificate holder, typically an individual's name, a URL, an e-mail address, or a company name.
server_cert_subject_key_idContains a unique identifier (fingerprint) of the certificate's private key.
server_cert_subject_rdnA collection of information, in the form of [OID, Value] pairs, uniquely identifying the certificate holder (subject).
server_cert_valid_fromThe time point at which the certificate becomes valid, in UTC.
server_cert_valid_toThe time point at which the certificate expires, in UTC.
server_info_capabilitiesReturns the list of server capabilities.
server_info_idle_supportedIndicates whether the IMAP server supports the IDLE command.
server_info_login_disabledSpecifies whether the server forbids login.
socket_dns_modeSelects the DNS resolver to use: the class's (secure) built-in one, or the one provided by the system.
socket_dns_portSpecifies the port number to be used for sending queries to the DNS server.
socket_dns_query_timeoutThe timeout (in milliseconds) for each DNS query.
socket_dns_serversThe addresses of DNS servers to use for address resolution, separated by commas or semicolons.
socket_dns_total_timeoutThe timeout (in milliseconds) for the whole resolution process.
socket_incoming_speed_limitThe maximum number of bytes to read from the socket, per second.
socket_local_addressThe local network interface to bind the socket to.
socket_local_portThe local port number to bind the socket to.
socket_outgoing_speed_limitThe maximum number of bytes to write to the socket, per second.
socket_timeoutThe maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.
socket_use_i_pv6Enables or disables IP protocol version 6.
tls_auto_validate_certificatesSpecifies whether server-side TLS certificates should be validated automatically using internal validation rules.
tls_base_configurationSelects the base configuration for the TLS settings.
tls_ciphersuitesA list of ciphersuites separated with commas or semicolons.
tlsec_curvesDefines the elliptic curves to enable.
tls_force_resume_if_destination_changesWhether to force TLS session resumption when the destination address changes.
tls_pre_shared_identityDefines the identity used when the PSK (Pre-Shared Key) key-exchange mechanism is negotiated.
tls_pre_shared_keyContains the pre-shared for the PSK (Pre-Shared Key) key-exchange mechanism, encoded with base16.
tls_pre_shared_key_ciphersuiteDefines the ciphersuite used for PSK (Pre-Shared Key) negotiation.
tls_renegotiation_attack_prevention_modeSelects renegotiation attack prevention mechanism.
tls_revocation_checkSpecifies the kind(s) of revocation check to perform.
tlsssl_optionsVarious SSL (TLS) protocol options, set of cssloExpectShutdownMessage 0x001 Wait for the close-notify message when shutting down the connection cssloOpenSSLDTLSWorkaround 0x002 (DEPRECATED) Use a DTLS version workaround when talking to very old OpenSSL versions cssloDisableKexLengthAlignment 0x004 Do not align the client-side PMS by the RSA modulus size.
tlstls_modeSpecifies the TLS mode to use.
tls_use_extended_master_secretEnables Extended Master Secret Extension, as defined in RFC 7627.
tls_use_session_resumptionEnables or disables TLS session resumption capability.
tls_versionsTh SSL/TLS versions to enable by default.
trusted_cert_countThe number of records in the TrustedCert arrays.
trusted_cert_bytesReturns raw certificate data in DER format.
trusted_cert_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
usernameThe authentication username.

Method List


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

close_mailboxCloses the current mailbox.
configSets or retrieves a configuration setting.
connectEstablishes a connection to the IMAP server.
copy_messageCopies a message to another mailbox.
create_mailboxCreates a new mailbox.
delete_mailboxDeletes an existing mailbox.
disconnectCloses connection to the IMAP server.
examine_mailboxSelects the mailbox in read-only mode.
get_mailbox_statusRequests a mailbox status.
list_all_messagesQueries a list of messages available in CurrentMailbox on the server.
list_deleted_messagesQueries a list of deleted messages in the current mailbox on the server.
list_mailboxesQueries a list of mailboxes available on the server.
list_new_messagesQueries a list of new messages available in the current mailbox on the mail server.
list_recent_messagesQueries a list of recent messages available in the current mailbox on the server.
list_unseen_messagesQueries a list of unseen messages available in the current mailbox on the server.
mark_message_deletedSets a Deleted flag to the message.
mark_message_seenSets a Seen flag to the message.
pingSends a NOOP command to the IMAP server.
post_bytesUploads an e-mail message stored in a byte array.
post_fileUploads a message stored in a file to the current mailbox on the IMAP server.
post_messageUploads a pre-built message to the current mailbox on the IMAP server.
purge_messagesPermanently removes all deleted messages from the current mailbox.
receive_bytesDownloads a message to a byte array.
receive_fileDownloads a message to a file.
receive_messageDownloads a message.
refresh_mailboxRefreshes the state info of the current mailbox.
rename_mailboxRenames an existing mailbox.
select_mailboxSelects the specified mailbox.
update_messageAlters flags assotiated with a message in the current mailbox on the IMAP server.

Event List


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

on_before_authFires before the authentication starts.
on_certificate_validateFires when the server's TLS certificate has to be validated.
on_commandReports a command sent to the server.
on_command_dataReturns the data that accompanies the command.
on_command_replyReports the receipt of a reply to a command.
on_command_reply_dataReturns the data that accompanies a reply to a command.
on_errorProvides information about errors during SMTP operations.
on_mailbox_statusReports the mailbox status returned from the server.
on_notificationThis event notifies the application about an underlying control flow event.
on_progressReports the progress of the data transfer operation.

Configuration Settings


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

AuthenticationsSpecifies enabled authentication methods and their priorities.
IdleAutoSpecifies whether idle mode should be requested automatically.
IdleTimeoutSpecifies idle timeout in seconds.
IgnoreSystemTrustWhether trusted Windows Certificate Stores should be treated as trusted.
ListCriteriaSpecifies an advanced criteria for listing messages on the server.
MaxLineLengthSpecifies maximum expected line length.
MessageHeaderZZZ[i]A value of ZZZ header field for message i.
OtherHeadersSpecifies header fields to request when lists messages on the server.
TempPathPath for storing temporary files.
TolerateMinorChainIssuesWhether to tolerate minor chain issues.
UseMicrosoftCTLEnables or disables automatic use of Microsoft online certificate trust list.
UseSystemCertificatesEnables or disables the use of the system certificates.
CheckKeyIntegrityBeforeUseEnables or disable private key integrity check before use.
CookieCachingSpecifies whether a cookie cache should be used for HTTP(S) transports.
CookiesGets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only).
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
UseOwnDNSResolverSpecifies whether the client classes should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 Python Edition - Version 20.0 [Build 8154]