unit Chilkat.Imap;

{
  Pascal wrapper for Chilkat Imap.
  Auto-generated by PascalWrapperGenerator -- do not edit manually.
}

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TImap wraps CkImap via the C bridge layer. }
  TImap = class(TChilkatBase)
  private
    FOnAbortCheck: TChilkatAbortCheckEvent;
    FOnPercentDone: TChilkatPercentDoneEvent;
    FOnProgressInfo: TChilkatProgressInfoEvent;
    function  GetLastErrorHtml: string;
    function  GetLastErrorText: string;
    function  GetLastErrorXml: string;
    function  GetVersion: string;
    function  GetDebugLogFilePath: string;
    procedure SetDebugLogFilePath(AValue: string);
    function  GetVerboseLogging: Boolean;
    procedure SetVerboseLogging(AValue: Boolean);
    function  GetLastMethodSuccess: Boolean;
    procedure SetLastMethodSuccess(AValue: Boolean);
    function  GetAbortCurrent: Boolean;
    procedure SetAbortCurrent(AValue: Boolean);
    function  GetAppendSeen: Boolean;
    procedure SetAppendSeen(AValue: Boolean);
    function  GetAppendUid: Integer;
    function  GetAuthMethod: string;
    procedure SetAuthMethod(AValue: string);
    function  GetAuthzId: string;
    procedure SetAuthzId(AValue: string);
    function  GetAutoDownloadAttachments: Boolean;
    procedure SetAutoDownloadAttachments(AValue: Boolean);
    function  GetAutoFix: Boolean;
    procedure SetAutoFix(AValue: Boolean);
    function  GetClientIpAddress: string;
    procedure SetClientIpAddress(AValue: string);
    function  GetConnectTimeout: Integer;
    procedure SetConnectTimeout(AValue: Integer);
    function  GetConnectedToHost: string;
    function  GetDomain: string;
    procedure SetDomain(AValue: string);
    function  GetHeartbeatMs: Integer;
    procedure SetHeartbeatMs(AValue: Integer);
    function  GetHttpProxyAuthMethod: string;
    procedure SetHttpProxyAuthMethod(AValue: string);
    function  GetHttpProxyDomain: string;
    procedure SetHttpProxyDomain(AValue: string);
    function  GetHttpProxyHostname: string;
    procedure SetHttpProxyHostname(AValue: string);
    function  GetHttpProxyPassword: string;
    procedure SetHttpProxyPassword(AValue: string);
    function  GetHttpProxyPort: Integer;
    procedure SetHttpProxyPort(AValue: Integer);
    function  GetHttpProxyUsername: string;
    procedure SetHttpProxyUsername(AValue: string);
    function  GetKeepSessionLog: Boolean;
    procedure SetKeepSessionLog(AValue: Boolean);
    function  GetLastAppendedMime: string;
    function  GetLastCommand: string;
    function  GetLastIntermediateResponse: string;
    function  GetLastResponse: string;
    function  GetLastResponseCode: string;
    function  GetLoggedInUser: string;
    function  GetNumMessages: Integer;
    function  GetPeekMode: Boolean;
    procedure SetPeekMode(AValue: Boolean);
    function  GetPercentDoneScale: Integer;
    procedure SetPercentDoneScale(AValue: Integer);
    function  GetPort: Integer;
    procedure SetPort(AValue: Integer);
    function  GetPreferIpv6: Boolean;
    procedure SetPreferIpv6(AValue: Boolean);
    function  GetReadTimeout: Integer;
    procedure SetReadTimeout(AValue: Integer);
    function  GetRequireSslCertVerify: Boolean;
    procedure SetRequireSslCertVerify(AValue: Boolean);
    function  GetSearchCharset: string;
    procedure SetSearchCharset(AValue: string);
    function  GetSelectedMailbox: string;
    function  GetSendBufferSize: Integer;
    procedure SetSendBufferSize(AValue: Integer);
    function  GetSeparatorChar: string;
    procedure SetSeparatorChar(AValue: string);
    function  GetSessionLog: string;
    function  GetSoRcvBuf: Integer;
    procedure SetSoRcvBuf(AValue: Integer);
    function  GetSoSndBuf: Integer;
    procedure SetSoSndBuf(AValue: Integer);
    function  GetSocksHostname: string;
    procedure SetSocksHostname(AValue: string);
    function  GetSocksPassword: string;
    procedure SetSocksPassword(AValue: string);
    function  GetSocksPort: Integer;
    procedure SetSocksPort(AValue: Integer);
    function  GetSocksUsername: string;
    procedure SetSocksUsername(AValue: string);
    function  GetSocksVersion: Integer;
    procedure SetSocksVersion(AValue: Integer);
    function  GetSsl: Boolean;
    procedure SetSsl(AValue: Boolean);
    function  GetSslAllowedCiphers: string;
    procedure SetSslAllowedCiphers(AValue: string);
    function  GetSslProtocol: string;
    procedure SetSslProtocol(AValue: string);
    function  GetSslServerCertVerified: Boolean;
    function  GetStartTls: Boolean;
    procedure SetStartTls(AValue: Boolean);
    function  GetTlsCipherSuite: string;
    function  GetTlsPinSet: string;
    procedure SetTlsPinSet(AValue: string);
    function  GetTlsVersion: string;
    function  GetUidNext: LongWord;
    function  GetUidValidity: LongWord;
    function  GetUncommonOptions: string;
    procedure SetUncommonOptions(AValue: string);
    function  GetHighestModSeq: string;
    function  GetSortCriteria: string;
    procedure SetSortCriteria(AValue: string);
    function  GetEnableSecrets: Boolean;
    procedure SetEnableSecrets(AValue: Boolean);
    procedure SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
    procedure SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
    procedure SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
  public
    constructor Create;
    destructor  Destroy; override;

    property LastErrorHtml: string read GetLastErrorHtml;
    property LastErrorText: string read GetLastErrorText;
    property LastErrorXml: string read GetLastErrorXml;
    property Version: string read GetVersion;
    property DebugLogFilePath: string read GetDebugLogFilePath write SetDebugLogFilePath;
    property VerboseLogging: Boolean read GetVerboseLogging write SetVerboseLogging;
    property LastMethodSuccess: Boolean read GetLastMethodSuccess write SetLastMethodSuccess;
    property AbortCurrent: Boolean read GetAbortCurrent write SetAbortCurrent;
    property AppendSeen: Boolean read GetAppendSeen write SetAppendSeen;
    property AppendUid: Integer read GetAppendUid;
    property AuthMethod: string read GetAuthMethod write SetAuthMethod;
    property AuthzId: string read GetAuthzId write SetAuthzId;
    property AutoDownloadAttachments: Boolean read GetAutoDownloadAttachments write SetAutoDownloadAttachments;
    property AutoFix: Boolean read GetAutoFix write SetAutoFix;
    property ClientIpAddress: string read GetClientIpAddress write SetClientIpAddress;
    property ConnectTimeout: Integer read GetConnectTimeout write SetConnectTimeout;
    property ConnectedToHost: string read GetConnectedToHost;
    property Domain: string read GetDomain write SetDomain;
    property HeartbeatMs: Integer read GetHeartbeatMs write SetHeartbeatMs;
    property HttpProxyAuthMethod: string read GetHttpProxyAuthMethod write SetHttpProxyAuthMethod;
    property HttpProxyDomain: string read GetHttpProxyDomain write SetHttpProxyDomain;
    property HttpProxyHostname: string read GetHttpProxyHostname write SetHttpProxyHostname;
    property HttpProxyPassword: string read GetHttpProxyPassword write SetHttpProxyPassword;
    property HttpProxyPort: Integer read GetHttpProxyPort write SetHttpProxyPort;
    property HttpProxyUsername: string read GetHttpProxyUsername write SetHttpProxyUsername;
    property KeepSessionLog: Boolean read GetKeepSessionLog write SetKeepSessionLog;
    property LastAppendedMime: string read GetLastAppendedMime;
    property LastCommand: string read GetLastCommand;
    property LastIntermediateResponse: string read GetLastIntermediateResponse;
    property LastResponse: string read GetLastResponse;
    property LastResponseCode: string read GetLastResponseCode;
    property LoggedInUser: string read GetLoggedInUser;
    property NumMessages: Integer read GetNumMessages;
    property PeekMode: Boolean read GetPeekMode write SetPeekMode;
    property PercentDoneScale: Integer read GetPercentDoneScale write SetPercentDoneScale;
    property Port: Integer read GetPort write SetPort;
    property PreferIpv6: Boolean read GetPreferIpv6 write SetPreferIpv6;
    property ReadTimeout: Integer read GetReadTimeout write SetReadTimeout;
    property RequireSslCertVerify: Boolean read GetRequireSslCertVerify write SetRequireSslCertVerify;
    property SearchCharset: string read GetSearchCharset write SetSearchCharset;
    property SelectedMailbox: string read GetSelectedMailbox;
    property SendBufferSize: Integer read GetSendBufferSize write SetSendBufferSize;
    property SeparatorChar: string read GetSeparatorChar write SetSeparatorChar;
    property SessionLog: string read GetSessionLog;
    property SoRcvBuf: Integer read GetSoRcvBuf write SetSoRcvBuf;
    property SoSndBuf: Integer read GetSoSndBuf write SetSoSndBuf;
    property SocksHostname: string read GetSocksHostname write SetSocksHostname;
    property SocksPassword: string read GetSocksPassword write SetSocksPassword;
    property SocksPort: Integer read GetSocksPort write SetSocksPort;
    property SocksUsername: string read GetSocksUsername write SetSocksUsername;
    property SocksVersion: Integer read GetSocksVersion write SetSocksVersion;
    property Ssl: Boolean read GetSsl write SetSsl;
    property SslAllowedCiphers: string read GetSslAllowedCiphers write SetSslAllowedCiphers;
    property SslProtocol: string read GetSslProtocol write SetSslProtocol;
    property SslServerCertVerified: Boolean read GetSslServerCertVerified;
    property StartTls: Boolean read GetStartTls write SetStartTls;
    property TlsCipherSuite: string read GetTlsCipherSuite;
    property TlsPinSet: string read GetTlsPinSet write SetTlsPinSet;
    property TlsVersion: string read GetTlsVersion;
    property UidNext: LongWord read GetUidNext;
    property UidValidity: LongWord read GetUidValidity;
    property UncommonOptions: string read GetUncommonOptions write SetUncommonOptions;
    property HighestModSeq: string read GetHighestModSeq;
    property SortCriteria: string read GetSortCriteria write SetSortCriteria;
    property EnableSecrets: Boolean read GetEnableSecrets write SetEnableSecrets;

    { Event callbacks.  Return True from OnAbortCheck / OnPercentDone
      to abort the running method.  Callbacks are invoked on the
      thread that called the Chilkat method.  The HeartbeatMs
      property controls the AbortCheck frequency. }
    property OnAbortCheck: TChilkatAbortCheckEvent read FOnAbortCheck write SetOnAbortCheck;
    property OnPercentDone: TChilkatPercentDoneEvent read FOnPercentDone write SetOnPercentDone;
    property OnProgressInfo: TChilkatProgressInfoEvent read FOnProgressInfo write SetOnProgressInfo;

    function  AddPfxSourceFile(const pfxFilePath: string; const pfxPassword: string): Boolean;
    function  AppendMail(const mailbox: string; email: TChilkatBase): Boolean;
    function  AppendMime(const mailbox: string; const mimeText: string): Boolean;
    function  AppendMimeWithDateStr(const mailbox: string; const mimeText: string; const internalDateStr: string): Boolean;
    function  AppendMimeWithFlags(const mailbox: string; const mimeText: string; seen: Boolean; flagged: Boolean; answered: Boolean; draft: Boolean): Boolean;
    function  Capability: string;
    function  CheckConnection: Boolean;
    procedure ClearSessionLog;
    function  CloseMailbox(const mailbox: string): Boolean;
    function  Connect(const domainName: string): Boolean;
    function  Copy(msgId: LongWord; bUid: Boolean; const copyToMailbox: string): Boolean;
    function  CopyMultiple(messageSet: TChilkatBase; const copyToMailbox: string): Boolean;
    function  CopySequence(startSeqNum: Integer; count: Integer; const copyToMailbox: string): Boolean;
    function  CreateMailbox(const mailbox: string): Boolean;
    function  DeleteMailbox(const mailbox: string): Boolean;
    function  Disconnect: Boolean;
    function  ExamineMailbox(const mailbox: string): Boolean;
    function  Expunge: Boolean;
    function  ExpungeAndClose: Boolean;
    function  FetchAttachment(emailObject: TChilkatBase; attachmentIndex: Integer; const saveToPath: string): Boolean;
    function  FetchAttachmentString(emailObject: TChilkatBase; attachmentIndex: Integer; const charset: string): string;
    function  FetchFlags(msgId: LongWord; bUid: Boolean): string;
    function  FetchSingleAsMime(msgId: LongWord; bUid: Boolean): string;
    function  FetchSingleHeaderAsMime(msgId: LongWord; bUID: Boolean): string;
    function  GetMailAttachFilename(email: TChilkatBase; attachIndex: Integer): string;
    function  GetMailAttachSize(email: TChilkatBase; attachIndex: Integer): Integer;
    function  GetMailFlag(email: TChilkatBase; const flagName: string): Integer;
    function  GetMailNumAttach(email: TChilkatBase): Integer;
    function  GetMailSize(email: TChilkatBase): Integer;
    function  GetMailboxStatus(const mailbox: string): string;
    function  GetQuota(const quotaRoot: string): string;
    function  GetQuotaRoot(const mailboxName: string): string;
    function  HasCapability(const name: string; const capabilityResponse: string): Boolean;
    function  IdleCheck(timeoutMs: Integer): string;
    function  IdleDone: Boolean;
    function  IdleStart: Boolean;
    function  IsConnected: Boolean;
    function  IsLoggedIn: Boolean;
    function  Login(const loginName: string; const password: string): Boolean;
    function  Logout: Boolean;
    function  Noop: Boolean;
    function  RefetchMailFlags(email: TChilkatBase): Boolean;
    function  RenameMailbox(const fromMailbox: string; const toMailbox: string): Boolean;
    function  SelectMailbox(const mailbox: string): Boolean;
    function  SendRawCommand(const cmd: string): string;
    function  SetDecryptCert(cert: TChilkatBase): Boolean;
    function  SetDecryptCert2(cert: TChilkatBase; key: TChilkatBase): Boolean;
    function  SetFlag(msgId: LongWord; bUid: Boolean; const flagName: string; value: Integer): Boolean;
    function  SetFlags(messageSet: TChilkatBase; const flagName: string; value: Integer): Boolean;
    function  SetMailFlag(email: TChilkatBase; const flagName: string; value: Integer): Boolean;
    function  SetQuota(const quotaRoot: string; const resource: string; quota: Integer): Boolean;
    function  SetSslClientCert(cert: TChilkatBase): Boolean;
    function  SetSslClientCertPem(const pemDataOrFilename: string; const pemPassword: string): Boolean;
    function  SetSslClientCertPfx(const pfxFilename: string; const pfxPassword: string): Boolean;
    function  SshAuthenticatePk(const sshLogin: string; privateKey: TChilkatBase): Boolean;
    function  SshAuthenticatePw(const sshLogin: string; const sshPassword: string): Boolean;
    function  SshCloseTunnel: Boolean;
    function  SshOpenTunnel(const sshHostname: string; sshPort: Integer): Boolean;
    function  StoreFlags(msgId: LongWord; bUid: Boolean; const flagNames: string; value: Integer): Boolean;
    function  Subscribe(const mailbox: string): Boolean;
    function  Unsubscribe(const mailbox: string): Boolean;
    function  UseCertVault(vault: TChilkatBase): Boolean;
    function  UseSsh(ssh: TChilkatBase): Boolean;
    function  UseSshTunnel(tunnel: TChilkatBase): Boolean;
    function  FetchSingleAsMimeSb(msgId: LongWord; bUid: Boolean; sbMime: TChilkatBase): Boolean;
    function  FetchAttachmentSb(email: TChilkatBase; attachmentIndex: Integer; const charset: string; sb: TChilkatBase): Boolean;
    function  FetchAttachmentBd(email: TChilkatBase; attachmentIndex: Integer; binData: TChilkatBase): Boolean;
    function  AppendMimeWithFlagsSb(const mailbox: string; sbMime: TChilkatBase; seen: Boolean; flagged: Boolean; answered: Boolean; draft: Boolean): Boolean;
    function  MoveMessages(messageSet: TChilkatBase; const destFolder: string): Boolean;
    function  LoginSecure(loginName: TChilkatBase; password: TChilkatBase): Boolean;
    function  FetchSingleBd(msgId: LongWord; bUid: Boolean; mimeData: TChilkatBase): Boolean;
    function  GetServerCert(cert: TChilkatBase): Boolean;
    function  FetchMsgSet(headersOnly: Boolean; msgSet: TChilkatBase; bundle: TChilkatBase): Boolean;
    function  FetchRange(headersOnly: Boolean; seqnum: Integer; count: Integer; bundle: TChilkatBase): Boolean;
    function  FetchEmail(headerOnly: Boolean; msgId: LongWord; bUid: Boolean; email: TChilkatBase): Boolean;
    function  MbxList(subscribed: Boolean; const reference: string; const mbxPattern: string; mboxes: TChilkatBase): Boolean;
    function  QueryMbx(const criteria: string; bUid: Boolean; msgSet: TChilkatBase): Boolean;
    function  FetchChunk2(seqnum: Integer; count: Integer; failedSet: TChilkatBase; fetchedSet: TChilkatBase; bundle: TChilkatBase): Boolean;
    function  QueryThread(const threadAlg: string; const searchCriteria: string; bUid: Boolean; json: TChilkatBase): Boolean;
    function  AddPfxSourceBd(bd: TChilkatBase; const password: string): Boolean;
    function  RawCommandBd(bdCmd: TChilkatBase; bdResp: TChilkatBase): Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkImap_Create  = function(): Pointer; cdecl;
  TCkImap_Dispose = procedure(handle: Pointer); cdecl;
  TCkBridgeAbortCheckCb   = function(userData: Pointer): Integer; cdecl;
  TCkBridgePercentDoneCb  = function(pctDone: Integer; userData: Pointer): Integer; cdecl;
  TCkBridgeProgressInfoCb = procedure(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
  TCkImap_SetAbortCheckCallback   = procedure(handle: Pointer; cb: TCkBridgeAbortCheckCb; userData: Pointer); cdecl;
  TCkImap_SetPercentDoneCallback  = procedure(handle: Pointer; cb: TCkBridgePercentDoneCb; userData: Pointer); cdecl;
  TCkImap_SetProgressInfoCallback = procedure(handle: Pointer; cb: TCkBridgeProgressInfoCb; userData: Pointer); cdecl;
  TCkImap_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_AbortCurrent = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_AbortCurrent = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_AppendSeen = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_AppendSeen = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_AppendUid = function(handle: Pointer): Integer; cdecl;
  TCkImap_get_AuthMethod = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_AuthMethod = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_AuthzId = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_AuthzId = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_AutoDownloadAttachments = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_AutoDownloadAttachments = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_AutoFix = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_AutoFix = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_ClientIpAddress = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_ClientIpAddress = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_ConnectTimeout = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_ConnectTimeout = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_ConnectedToHost = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_Domain = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_Domain = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_HeartbeatMs = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_HeartbeatMs = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_HttpProxyAuthMethod = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_HttpProxyAuthMethod = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_HttpProxyDomain = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_HttpProxyDomain = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_HttpProxyHostname = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_HttpProxyHostname = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_HttpProxyPassword = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_HttpProxyPassword = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_HttpProxyPort = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_HttpProxyPort = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_HttpProxyUsername = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_HttpProxyUsername = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_KeepSessionLog = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_KeepSessionLog = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_LastAppendedMime = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_LastCommand = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_LastIntermediateResponse = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_LastResponse = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_LastResponseCode = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_LoggedInUser = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_NumMessages = function(handle: Pointer): Integer; cdecl;
  TCkImap_get_PeekMode = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_PeekMode = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_PercentDoneScale = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_PercentDoneScale = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_Port = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_Port = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_PreferIpv6 = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_PreferIpv6 = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_ReadTimeout = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_ReadTimeout = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_RequireSslCertVerify = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_RequireSslCertVerify = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_SearchCharset = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_SearchCharset = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_SelectedMailbox = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_SendBufferSize = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_SendBufferSize = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_SeparatorChar = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_SeparatorChar = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_SessionLog = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_SoRcvBuf = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_SoRcvBuf = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_SoSndBuf = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_SoSndBuf = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_SocksHostname = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_SocksHostname = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_SocksPassword = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_SocksPassword = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_SocksPort = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_SocksPort = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_SocksUsername = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_SocksUsername = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_SocksVersion = function(handle: Pointer): Integer; cdecl;
  TCkImap_put_SocksVersion = procedure(handle: Pointer; value: Integer); cdecl;
  TCkImap_get_Ssl = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_Ssl = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_SslAllowedCiphers = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_SslAllowedCiphers = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_SslProtocol = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_SslProtocol = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_SslServerCertVerified = function(handle: Pointer): LongBool; cdecl;
  TCkImap_get_StartTls = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_StartTls = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_get_TlsCipherSuite = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_TlsPinSet = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_TlsPinSet = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_TlsVersion = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_UidNext = function(handle: Pointer): LongWord; cdecl;
  TCkImap_get_UidValidity = function(handle: Pointer): LongWord; cdecl;
  TCkImap_get_UncommonOptions = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_UncommonOptions = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_HighestModSeq = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_get_SortCriteria = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_put_SortCriteria = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkImap_get_EnableSecrets = function(handle: Pointer): LongBool; cdecl;
  TCkImap_put_EnableSecrets = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkImap_AddPfxSourceFile = function(handle: Pointer; pfxFilePath: PAnsiChar; pfxPassword: PAnsiChar): LongBool; cdecl;
  TCkImap_AppendMail = function(handle: Pointer; mailbox: PAnsiChar; email: Pointer): LongBool; cdecl;
  TCkImap_AppendMime = function(handle: Pointer; mailbox: PAnsiChar; mimeText: PAnsiChar): LongBool; cdecl;
  TCkImap_AppendMimeWithDateStr = function(handle: Pointer; mailbox: PAnsiChar; mimeText: PAnsiChar; internalDateStr: PAnsiChar): LongBool; cdecl;
  TCkImap_AppendMimeWithFlags = function(handle: Pointer; mailbox: PAnsiChar; mimeText: PAnsiChar; seen: LongBool; flagged: LongBool; answered: LongBool; draft: LongBool): LongBool; cdecl;
  TCkImap_Capability = function(handle: Pointer): PAnsiChar; cdecl;
  TCkImap_CheckConnection = function(handle: Pointer): LongBool; cdecl;
  TCkImap_ClearSessionLog = procedure(handle: Pointer); cdecl;
  TCkImap_CloseMailbox = function(handle: Pointer; mailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_Connect = function(handle: Pointer; domainName: PAnsiChar): LongBool; cdecl;
  TCkImap_Copy = function(handle: Pointer; msgId: LongWord; bUid: LongBool; copyToMailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_CopyMultiple = function(handle: Pointer; messageSet: Pointer; copyToMailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_CopySequence = function(handle: Pointer; startSeqNum: Integer; count: Integer; copyToMailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_CreateMailbox = function(handle: Pointer; mailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_DeleteMailbox = function(handle: Pointer; mailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_Disconnect = function(handle: Pointer): LongBool; cdecl;
  TCkImap_ExamineMailbox = function(handle: Pointer; mailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_Expunge = function(handle: Pointer): LongBool; cdecl;
  TCkImap_ExpungeAndClose = function(handle: Pointer): LongBool; cdecl;
  TCkImap_FetchAttachment = function(handle: Pointer; emailObject: Pointer; attachmentIndex: Integer; saveToPath: PAnsiChar): LongBool; cdecl;
  TCkImap_FetchAttachmentString = function(handle: Pointer; emailObject: Pointer; attachmentIndex: Integer; charset: PAnsiChar): PAnsiChar; cdecl;
  TCkImap_FetchFlags = function(handle: Pointer; msgId: LongWord; bUid: LongBool): PAnsiChar; cdecl;
  TCkImap_FetchSingleAsMime = function(handle: Pointer; msgId: LongWord; bUid: LongBool): PAnsiChar; cdecl;
  TCkImap_FetchSingleHeaderAsMime = function(handle: Pointer; msgId: LongWord; bUID: LongBool): PAnsiChar; cdecl;
  TCkImap_GetMailAttachFilename = function(handle: Pointer; email: Pointer; attachIndex: Integer): PAnsiChar; cdecl;
  TCkImap_GetMailAttachSize = function(handle: Pointer; email: Pointer; attachIndex: Integer): Integer; cdecl;
  TCkImap_GetMailFlag = function(handle: Pointer; email: Pointer; flagName: PAnsiChar): Integer; cdecl;
  TCkImap_GetMailNumAttach = function(handle: Pointer; email: Pointer): Integer; cdecl;
  TCkImap_GetMailSize = function(handle: Pointer; email: Pointer): Integer; cdecl;
  TCkImap_GetMailboxStatus = function(handle: Pointer; mailbox: PAnsiChar): PAnsiChar; cdecl;
  TCkImap_GetQuota = function(handle: Pointer; quotaRoot: PAnsiChar): PAnsiChar; cdecl;
  TCkImap_GetQuotaRoot = function(handle: Pointer; mailboxName: PAnsiChar): PAnsiChar; cdecl;
  TCkImap_HasCapability = function(handle: Pointer; name: PAnsiChar; capabilityResponse: PAnsiChar): LongBool; cdecl;
  TCkImap_IdleCheck = function(handle: Pointer; timeoutMs: Integer): PAnsiChar; cdecl;
  TCkImap_IdleDone = function(handle: Pointer): LongBool; cdecl;
  TCkImap_IdleStart = function(handle: Pointer): LongBool; cdecl;
  TCkImap_IsConnected = function(handle: Pointer): LongBool; cdecl;
  TCkImap_IsLoggedIn = function(handle: Pointer): LongBool; cdecl;
  TCkImap_Login = function(handle: Pointer; loginName: PAnsiChar; password: PAnsiChar): LongBool; cdecl;
  TCkImap_Logout = function(handle: Pointer): LongBool; cdecl;
  TCkImap_Noop = function(handle: Pointer): LongBool; cdecl;
  TCkImap_RefetchMailFlags = function(handle: Pointer; email: Pointer): LongBool; cdecl;
  TCkImap_RenameMailbox = function(handle: Pointer; fromMailbox: PAnsiChar; toMailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_SelectMailbox = function(handle: Pointer; mailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_SendRawCommand = function(handle: Pointer; cmd: PAnsiChar): PAnsiChar; cdecl;
  TCkImap_SetDecryptCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkImap_SetDecryptCert2 = function(handle: Pointer; cert: Pointer; key: Pointer): LongBool; cdecl;
  TCkImap_SetFlag = function(handle: Pointer; msgId: LongWord; bUid: LongBool; flagName: PAnsiChar; value: Integer): LongBool; cdecl;
  TCkImap_SetFlags = function(handle: Pointer; messageSet: Pointer; flagName: PAnsiChar; value: Integer): LongBool; cdecl;
  TCkImap_SetMailFlag = function(handle: Pointer; email: Pointer; flagName: PAnsiChar; value: Integer): LongBool; cdecl;
  TCkImap_SetQuota = function(handle: Pointer; quotaRoot: PAnsiChar; resource: PAnsiChar; quota: Integer): LongBool; cdecl;
  TCkImap_SetSslClientCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkImap_SetSslClientCertPem = function(handle: Pointer; pemDataOrFilename: PAnsiChar; pemPassword: PAnsiChar): LongBool; cdecl;
  TCkImap_SetSslClientCertPfx = function(handle: Pointer; pfxFilename: PAnsiChar; pfxPassword: PAnsiChar): LongBool; cdecl;
  TCkImap_SshAuthenticatePk = function(handle: Pointer; sshLogin: PAnsiChar; privateKey: Pointer): LongBool; cdecl;
  TCkImap_SshAuthenticatePw = function(handle: Pointer; sshLogin: PAnsiChar; sshPassword: PAnsiChar): LongBool; cdecl;
  TCkImap_SshCloseTunnel = function(handle: Pointer): LongBool; cdecl;
  TCkImap_SshOpenTunnel = function(handle: Pointer; sshHostname: PAnsiChar; sshPort: Integer): LongBool; cdecl;
  TCkImap_StoreFlags = function(handle: Pointer; msgId: LongWord; bUid: LongBool; flagNames: PAnsiChar; value: Integer): LongBool; cdecl;
  TCkImap_Subscribe = function(handle: Pointer; mailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_Unsubscribe = function(handle: Pointer; mailbox: PAnsiChar): LongBool; cdecl;
  TCkImap_UseCertVault = function(handle: Pointer; vault: Pointer): LongBool; cdecl;
  TCkImap_UseSsh = function(handle: Pointer; ssh: Pointer): LongBool; cdecl;
  TCkImap_UseSshTunnel = function(handle: Pointer; tunnel: Pointer): LongBool; cdecl;
  TCkImap_FetchSingleAsMimeSb = function(handle: Pointer; msgId: LongWord; bUid: LongBool; sbMime: Pointer): LongBool; cdecl;
  TCkImap_FetchAttachmentSb = function(handle: Pointer; email: Pointer; attachmentIndex: Integer; charset: PAnsiChar; sb: Pointer): LongBool; cdecl;
  TCkImap_FetchAttachmentBd = function(handle: Pointer; email: Pointer; attachmentIndex: Integer; binData: Pointer): LongBool; cdecl;
  TCkImap_AppendMimeWithFlagsSb = function(handle: Pointer; mailbox: PAnsiChar; sbMime: Pointer; seen: LongBool; flagged: LongBool; answered: LongBool; draft: LongBool): LongBool; cdecl;
  TCkImap_MoveMessages = function(handle: Pointer; messageSet: Pointer; destFolder: PAnsiChar): LongBool; cdecl;
  TCkImap_LoginSecure = function(handle: Pointer; loginName: Pointer; password: Pointer): LongBool; cdecl;
  TCkImap_FetchSingleBd = function(handle: Pointer; msgId: LongWord; bUid: LongBool; mimeData: Pointer): LongBool; cdecl;
  TCkImap_GetServerCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkImap_FetchMsgSet = function(handle: Pointer; headersOnly: LongBool; msgSet: Pointer; bundle: Pointer): LongBool; cdecl;
  TCkImap_FetchRange = function(handle: Pointer; headersOnly: LongBool; seqnum: Integer; count: Integer; bundle: Pointer): LongBool; cdecl;
  TCkImap_FetchEmail = function(handle: Pointer; headerOnly: LongBool; msgId: LongWord; bUid: LongBool; email: Pointer): LongBool; cdecl;
  TCkImap_MbxList = function(handle: Pointer; subscribed: LongBool; reference: PAnsiChar; mbxPattern: PAnsiChar; mboxes: Pointer): LongBool; cdecl;
  TCkImap_QueryMbx = function(handle: Pointer; criteria: PAnsiChar; bUid: LongBool; msgSet: Pointer): LongBool; cdecl;
  TCkImap_FetchChunk2 = function(handle: Pointer; seqnum: Integer; count: Integer; failedSet: Pointer; fetchedSet: Pointer; bundle: Pointer): LongBool; cdecl;
  TCkImap_QueryThread = function(handle: Pointer; threadAlg: PAnsiChar; searchCriteria: PAnsiChar; bUid: LongBool; json: Pointer): LongBool; cdecl;
  TCkImap_AddPfxSourceBd = function(handle: Pointer; bd: Pointer; password: PAnsiChar): LongBool; cdecl;
  TCkImap_RawCommandBd = function(handle: Pointer; bdCmd: Pointer; bdResp: Pointer): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkImap_Create:  TCkImap_Create  = nil;
  CkImap_Dispose: TCkImap_Dispose = nil;
  CkImap_SetAbortCheckCallback:   TCkImap_SetAbortCheckCallback   = nil;
  CkImap_SetPercentDoneCallback:  TCkImap_SetPercentDoneCallback  = nil;
  CkImap_SetProgressInfoCallback: TCkImap_SetProgressInfoCallback = nil;
  CkImap_get_LastErrorHtml: TCkImap_get_LastErrorHtml = nil;
  CkImap_get_LastErrorText: TCkImap_get_LastErrorText = nil;
  CkImap_get_LastErrorXml: TCkImap_get_LastErrorXml = nil;
  CkImap_get_Version: TCkImap_get_Version = nil;
  CkImap_get_DebugLogFilePath: TCkImap_get_DebugLogFilePath = nil;
  CkImap_put_DebugLogFilePath: TCkImap_put_DebugLogFilePath = nil;
  CkImap_get_VerboseLogging: TCkImap_get_VerboseLogging = nil;
  CkImap_put_VerboseLogging: TCkImap_put_VerboseLogging = nil;
  CkImap_get_LastMethodSuccess: TCkImap_get_LastMethodSuccess = nil;
  CkImap_put_LastMethodSuccess: TCkImap_put_LastMethodSuccess = nil;
  CkImap_get_AbortCurrent: TCkImap_get_AbortCurrent = nil;
  CkImap_put_AbortCurrent: TCkImap_put_AbortCurrent = nil;
  CkImap_get_AppendSeen: TCkImap_get_AppendSeen = nil;
  CkImap_put_AppendSeen: TCkImap_put_AppendSeen = nil;
  CkImap_get_AppendUid: TCkImap_get_AppendUid = nil;
  CkImap_get_AuthMethod: TCkImap_get_AuthMethod = nil;
  CkImap_put_AuthMethod: TCkImap_put_AuthMethod = nil;
  CkImap_get_AuthzId: TCkImap_get_AuthzId = nil;
  CkImap_put_AuthzId: TCkImap_put_AuthzId = nil;
  CkImap_get_AutoDownloadAttachments: TCkImap_get_AutoDownloadAttachments = nil;
  CkImap_put_AutoDownloadAttachments: TCkImap_put_AutoDownloadAttachments = nil;
  CkImap_get_AutoFix: TCkImap_get_AutoFix = nil;
  CkImap_put_AutoFix: TCkImap_put_AutoFix = nil;
  CkImap_get_ClientIpAddress: TCkImap_get_ClientIpAddress = nil;
  CkImap_put_ClientIpAddress: TCkImap_put_ClientIpAddress = nil;
  CkImap_get_ConnectTimeout: TCkImap_get_ConnectTimeout = nil;
  CkImap_put_ConnectTimeout: TCkImap_put_ConnectTimeout = nil;
  CkImap_get_ConnectedToHost: TCkImap_get_ConnectedToHost = nil;
  CkImap_get_Domain: TCkImap_get_Domain = nil;
  CkImap_put_Domain: TCkImap_put_Domain = nil;
  CkImap_get_HeartbeatMs: TCkImap_get_HeartbeatMs = nil;
  CkImap_put_HeartbeatMs: TCkImap_put_HeartbeatMs = nil;
  CkImap_get_HttpProxyAuthMethod: TCkImap_get_HttpProxyAuthMethod = nil;
  CkImap_put_HttpProxyAuthMethod: TCkImap_put_HttpProxyAuthMethod = nil;
  CkImap_get_HttpProxyDomain: TCkImap_get_HttpProxyDomain = nil;
  CkImap_put_HttpProxyDomain: TCkImap_put_HttpProxyDomain = nil;
  CkImap_get_HttpProxyHostname: TCkImap_get_HttpProxyHostname = nil;
  CkImap_put_HttpProxyHostname: TCkImap_put_HttpProxyHostname = nil;
  CkImap_get_HttpProxyPassword: TCkImap_get_HttpProxyPassword = nil;
  CkImap_put_HttpProxyPassword: TCkImap_put_HttpProxyPassword = nil;
  CkImap_get_HttpProxyPort: TCkImap_get_HttpProxyPort = nil;
  CkImap_put_HttpProxyPort: TCkImap_put_HttpProxyPort = nil;
  CkImap_get_HttpProxyUsername: TCkImap_get_HttpProxyUsername = nil;
  CkImap_put_HttpProxyUsername: TCkImap_put_HttpProxyUsername = nil;
  CkImap_get_KeepSessionLog: TCkImap_get_KeepSessionLog = nil;
  CkImap_put_KeepSessionLog: TCkImap_put_KeepSessionLog = nil;
  CkImap_get_LastAppendedMime: TCkImap_get_LastAppendedMime = nil;
  CkImap_get_LastCommand: TCkImap_get_LastCommand = nil;
  CkImap_get_LastIntermediateResponse: TCkImap_get_LastIntermediateResponse = nil;
  CkImap_get_LastResponse: TCkImap_get_LastResponse = nil;
  CkImap_get_LastResponseCode: TCkImap_get_LastResponseCode = nil;
  CkImap_get_LoggedInUser: TCkImap_get_LoggedInUser = nil;
  CkImap_get_NumMessages: TCkImap_get_NumMessages = nil;
  CkImap_get_PeekMode: TCkImap_get_PeekMode = nil;
  CkImap_put_PeekMode: TCkImap_put_PeekMode = nil;
  CkImap_get_PercentDoneScale: TCkImap_get_PercentDoneScale = nil;
  CkImap_put_PercentDoneScale: TCkImap_put_PercentDoneScale = nil;
  CkImap_get_Port: TCkImap_get_Port = nil;
  CkImap_put_Port: TCkImap_put_Port = nil;
  CkImap_get_PreferIpv6: TCkImap_get_PreferIpv6 = nil;
  CkImap_put_PreferIpv6: TCkImap_put_PreferIpv6 = nil;
  CkImap_get_ReadTimeout: TCkImap_get_ReadTimeout = nil;
  CkImap_put_ReadTimeout: TCkImap_put_ReadTimeout = nil;
  CkImap_get_RequireSslCertVerify: TCkImap_get_RequireSslCertVerify = nil;
  CkImap_put_RequireSslCertVerify: TCkImap_put_RequireSslCertVerify = nil;
  CkImap_get_SearchCharset: TCkImap_get_SearchCharset = nil;
  CkImap_put_SearchCharset: TCkImap_put_SearchCharset = nil;
  CkImap_get_SelectedMailbox: TCkImap_get_SelectedMailbox = nil;
  CkImap_get_SendBufferSize: TCkImap_get_SendBufferSize = nil;
  CkImap_put_SendBufferSize: TCkImap_put_SendBufferSize = nil;
  CkImap_get_SeparatorChar: TCkImap_get_SeparatorChar = nil;
  CkImap_put_SeparatorChar: TCkImap_put_SeparatorChar = nil;
  CkImap_get_SessionLog: TCkImap_get_SessionLog = nil;
  CkImap_get_SoRcvBuf: TCkImap_get_SoRcvBuf = nil;
  CkImap_put_SoRcvBuf: TCkImap_put_SoRcvBuf = nil;
  CkImap_get_SoSndBuf: TCkImap_get_SoSndBuf = nil;
  CkImap_put_SoSndBuf: TCkImap_put_SoSndBuf = nil;
  CkImap_get_SocksHostname: TCkImap_get_SocksHostname = nil;
  CkImap_put_SocksHostname: TCkImap_put_SocksHostname = nil;
  CkImap_get_SocksPassword: TCkImap_get_SocksPassword = nil;
  CkImap_put_SocksPassword: TCkImap_put_SocksPassword = nil;
  CkImap_get_SocksPort: TCkImap_get_SocksPort = nil;
  CkImap_put_SocksPort: TCkImap_put_SocksPort = nil;
  CkImap_get_SocksUsername: TCkImap_get_SocksUsername = nil;
  CkImap_put_SocksUsername: TCkImap_put_SocksUsername = nil;
  CkImap_get_SocksVersion: TCkImap_get_SocksVersion = nil;
  CkImap_put_SocksVersion: TCkImap_put_SocksVersion = nil;
  CkImap_get_Ssl: TCkImap_get_Ssl = nil;
  CkImap_put_Ssl: TCkImap_put_Ssl = nil;
  CkImap_get_SslAllowedCiphers: TCkImap_get_SslAllowedCiphers = nil;
  CkImap_put_SslAllowedCiphers: TCkImap_put_SslAllowedCiphers = nil;
  CkImap_get_SslProtocol: TCkImap_get_SslProtocol = nil;
  CkImap_put_SslProtocol: TCkImap_put_SslProtocol = nil;
  CkImap_get_SslServerCertVerified: TCkImap_get_SslServerCertVerified = nil;
  CkImap_get_StartTls: TCkImap_get_StartTls = nil;
  CkImap_put_StartTls: TCkImap_put_StartTls = nil;
  CkImap_get_TlsCipherSuite: TCkImap_get_TlsCipherSuite = nil;
  CkImap_get_TlsPinSet: TCkImap_get_TlsPinSet = nil;
  CkImap_put_TlsPinSet: TCkImap_put_TlsPinSet = nil;
  CkImap_get_TlsVersion: TCkImap_get_TlsVersion = nil;
  CkImap_get_UidNext: TCkImap_get_UidNext = nil;
  CkImap_get_UidValidity: TCkImap_get_UidValidity = nil;
  CkImap_get_UncommonOptions: TCkImap_get_UncommonOptions = nil;
  CkImap_put_UncommonOptions: TCkImap_put_UncommonOptions = nil;
  CkImap_get_HighestModSeq: TCkImap_get_HighestModSeq = nil;
  CkImap_get_SortCriteria: TCkImap_get_SortCriteria = nil;
  CkImap_put_SortCriteria: TCkImap_put_SortCriteria = nil;
  CkImap_get_EnableSecrets: TCkImap_get_EnableSecrets = nil;
  CkImap_put_EnableSecrets: TCkImap_put_EnableSecrets = nil;
  CkImap_AddPfxSourceFile: TCkImap_AddPfxSourceFile = nil;
  CkImap_AppendMail: TCkImap_AppendMail = nil;
  CkImap_AppendMime: TCkImap_AppendMime = nil;
  CkImap_AppendMimeWithDateStr: TCkImap_AppendMimeWithDateStr = nil;
  CkImap_AppendMimeWithFlags: TCkImap_AppendMimeWithFlags = nil;
  CkImap_Capability: TCkImap_Capability = nil;
  CkImap_CheckConnection: TCkImap_CheckConnection = nil;
  CkImap_ClearSessionLog: TCkImap_ClearSessionLog = nil;
  CkImap_CloseMailbox: TCkImap_CloseMailbox = nil;
  CkImap_Connect: TCkImap_Connect = nil;
  CkImap_Copy: TCkImap_Copy = nil;
  CkImap_CopyMultiple: TCkImap_CopyMultiple = nil;
  CkImap_CopySequence: TCkImap_CopySequence = nil;
  CkImap_CreateMailbox: TCkImap_CreateMailbox = nil;
  CkImap_DeleteMailbox: TCkImap_DeleteMailbox = nil;
  CkImap_Disconnect: TCkImap_Disconnect = nil;
  CkImap_ExamineMailbox: TCkImap_ExamineMailbox = nil;
  CkImap_Expunge: TCkImap_Expunge = nil;
  CkImap_ExpungeAndClose: TCkImap_ExpungeAndClose = nil;
  CkImap_FetchAttachment: TCkImap_FetchAttachment = nil;
  CkImap_FetchAttachmentString: TCkImap_FetchAttachmentString = nil;
  CkImap_FetchFlags: TCkImap_FetchFlags = nil;
  CkImap_FetchSingleAsMime: TCkImap_FetchSingleAsMime = nil;
  CkImap_FetchSingleHeaderAsMime: TCkImap_FetchSingleHeaderAsMime = nil;
  CkImap_GetMailAttachFilename: TCkImap_GetMailAttachFilename = nil;
  CkImap_GetMailAttachSize: TCkImap_GetMailAttachSize = nil;
  CkImap_GetMailFlag: TCkImap_GetMailFlag = nil;
  CkImap_GetMailNumAttach: TCkImap_GetMailNumAttach = nil;
  CkImap_GetMailSize: TCkImap_GetMailSize = nil;
  CkImap_GetMailboxStatus: TCkImap_GetMailboxStatus = nil;
  CkImap_GetQuota: TCkImap_GetQuota = nil;
  CkImap_GetQuotaRoot: TCkImap_GetQuotaRoot = nil;
  CkImap_HasCapability: TCkImap_HasCapability = nil;
  CkImap_IdleCheck: TCkImap_IdleCheck = nil;
  CkImap_IdleDone: TCkImap_IdleDone = nil;
  CkImap_IdleStart: TCkImap_IdleStart = nil;
  CkImap_IsConnected: TCkImap_IsConnected = nil;
  CkImap_IsLoggedIn: TCkImap_IsLoggedIn = nil;
  CkImap_Login: TCkImap_Login = nil;
  CkImap_Logout: TCkImap_Logout = nil;
  CkImap_Noop: TCkImap_Noop = nil;
  CkImap_RefetchMailFlags: TCkImap_RefetchMailFlags = nil;
  CkImap_RenameMailbox: TCkImap_RenameMailbox = nil;
  CkImap_SelectMailbox: TCkImap_SelectMailbox = nil;
  CkImap_SendRawCommand: TCkImap_SendRawCommand = nil;
  CkImap_SetDecryptCert: TCkImap_SetDecryptCert = nil;
  CkImap_SetDecryptCert2: TCkImap_SetDecryptCert2 = nil;
  CkImap_SetFlag: TCkImap_SetFlag = nil;
  CkImap_SetFlags: TCkImap_SetFlags = nil;
  CkImap_SetMailFlag: TCkImap_SetMailFlag = nil;
  CkImap_SetQuota: TCkImap_SetQuota = nil;
  CkImap_SetSslClientCert: TCkImap_SetSslClientCert = nil;
  CkImap_SetSslClientCertPem: TCkImap_SetSslClientCertPem = nil;
  CkImap_SetSslClientCertPfx: TCkImap_SetSslClientCertPfx = nil;
  CkImap_SshAuthenticatePk: TCkImap_SshAuthenticatePk = nil;
  CkImap_SshAuthenticatePw: TCkImap_SshAuthenticatePw = nil;
  CkImap_SshCloseTunnel: TCkImap_SshCloseTunnel = nil;
  CkImap_SshOpenTunnel: TCkImap_SshOpenTunnel = nil;
  CkImap_StoreFlags: TCkImap_StoreFlags = nil;
  CkImap_Subscribe: TCkImap_Subscribe = nil;
  CkImap_Unsubscribe: TCkImap_Unsubscribe = nil;
  CkImap_UseCertVault: TCkImap_UseCertVault = nil;
  CkImap_UseSsh: TCkImap_UseSsh = nil;
  CkImap_UseSshTunnel: TCkImap_UseSshTunnel = nil;
  CkImap_FetchSingleAsMimeSb: TCkImap_FetchSingleAsMimeSb = nil;
  CkImap_FetchAttachmentSb: TCkImap_FetchAttachmentSb = nil;
  CkImap_FetchAttachmentBd: TCkImap_FetchAttachmentBd = nil;
  CkImap_AppendMimeWithFlagsSb: TCkImap_AppendMimeWithFlagsSb = nil;
  CkImap_MoveMessages: TCkImap_MoveMessages = nil;
  CkImap_LoginSecure: TCkImap_LoginSecure = nil;
  CkImap_FetchSingleBd: TCkImap_FetchSingleBd = nil;
  CkImap_GetServerCert: TCkImap_GetServerCert = nil;
  CkImap_FetchMsgSet: TCkImap_FetchMsgSet = nil;
  CkImap_FetchRange: TCkImap_FetchRange = nil;
  CkImap_FetchEmail: TCkImap_FetchEmail = nil;
  CkImap_MbxList: TCkImap_MbxList = nil;
  CkImap_QueryMbx: TCkImap_QueryMbx = nil;
  CkImap_FetchChunk2: TCkImap_FetchChunk2 = nil;
  CkImap_QueryThread: TCkImap_QueryThread = nil;
  CkImap_AddPfxSourceBd: TCkImap_AddPfxSourceBd = nil;
  CkImap_RawCommandBd: TCkImap_RawCommandBd = nil;

constructor TImap.Create;
begin
  inherited Create;
  FHandle := CkImap_Create();
end;

destructor TImap.Destroy;
begin
  if FHandle <> nil then
    CkImap_Dispose(FHandle);
  FHandle := nil;
  inherited;
end;

{ ---- Event callback thunks ---- }
{ Standalone cdecl functions registered with the C bridge.  The bridge
  passes back the userData pointer, which carries the Pascal object
  instance.  A non-zero return value aborts the running method. }

function TImap_AbortCheckThunk(userData: Pointer): Integer; cdecl;
var
  obj: TImap;
begin
  Result := 0;
  obj := TImap(userData);
  if Assigned(obj) and Assigned(obj.FOnAbortCheck) then
    if obj.FOnAbortCheck(obj) then Result := 1;
end;

function TImap_PercentDoneThunk(pctDone: Integer; userData: Pointer): Integer; cdecl;
var
  obj: TImap;
begin
  Result := 0;
  obj := TImap(userData);
  if Assigned(obj) and Assigned(obj.FOnPercentDone) then
    if obj.FOnPercentDone(obj, pctDone) then Result := 1;
end;

procedure TImap_ProgressInfoThunk(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
var
  obj: TImap;
begin
  obj := TImap(userData);
  if Assigned(obj) and Assigned(obj.FOnProgressInfo) then
    obj.FOnProgressInfo(obj, CkToStr(name), CkToStr(value));
end;

procedure TImap.SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
begin
  FOnAbortCheck := AValue;
  if Assigned(AValue) then
    CkImap_SetAbortCheckCallback(FHandle, @TImap_AbortCheckThunk, Self)
  else
    CkImap_SetAbortCheckCallback(FHandle, nil, nil);
end;

procedure TImap.SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
begin
  FOnPercentDone := AValue;
  if Assigned(AValue) then
    CkImap_SetPercentDoneCallback(FHandle, @TImap_PercentDoneThunk, Self)
  else
    CkImap_SetPercentDoneCallback(FHandle, nil, nil);
end;

procedure TImap.SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
begin
  FOnProgressInfo := AValue;
  if Assigned(AValue) then
    CkImap_SetProgressInfoCallback(FHandle, @TImap_ProgressInfoThunk, Self)
  else
    CkImap_SetProgressInfoCallback(FHandle, nil, nil);
end;

function TImap.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkImap_get_LastErrorHtml(FHandle));
end;

function TImap.GetLastErrorText: string;
begin
  Result := CkToStr(CkImap_get_LastErrorText(FHandle));
end;

function TImap.GetLastErrorXml: string;
begin
  Result := CkToStr(CkImap_get_LastErrorXml(FHandle));
end;

function TImap.GetVersion: string;
begin
  Result := CkToStr(CkImap_get_Version(FHandle));
end;

function TImap.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkImap_get_DebugLogFilePath(FHandle));
end;

procedure TImap.SetDebugLogFilePath(AValue: string);
begin
  CkImap_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkImap_get_VerboseLogging(FHandle));
end;

procedure TImap.SetVerboseLogging(AValue: Boolean);
begin
  CkImap_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TImap.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkImap_get_LastMethodSuccess(FHandle));
end;

procedure TImap.SetLastMethodSuccess(AValue: Boolean);
begin
  CkImap_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TImap.GetAbortCurrent: Boolean;
begin
  Result := Boolean(CkImap_get_AbortCurrent(FHandle));
end;

procedure TImap.SetAbortCurrent(AValue: Boolean);
begin
  CkImap_put_AbortCurrent(FHandle, LongBool(AValue));
end;

function TImap.GetAppendSeen: Boolean;
begin
  Result := Boolean(CkImap_get_AppendSeen(FHandle));
end;

procedure TImap.SetAppendSeen(AValue: Boolean);
begin
  CkImap_put_AppendSeen(FHandle, LongBool(AValue));
end;

function TImap.GetAppendUid: Integer;
begin
  Result := CkImap_get_AppendUid(FHandle);
end;

function TImap.GetAuthMethod: string;
begin
  Result := CkToStr(CkImap_get_AuthMethod(FHandle));
end;

procedure TImap.SetAuthMethod(AValue: string);
begin
  CkImap_put_AuthMethod(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetAuthzId: string;
begin
  Result := CkToStr(CkImap_get_AuthzId(FHandle));
end;

procedure TImap.SetAuthzId(AValue: string);
begin
  CkImap_put_AuthzId(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetAutoDownloadAttachments: Boolean;
begin
  Result := Boolean(CkImap_get_AutoDownloadAttachments(FHandle));
end;

procedure TImap.SetAutoDownloadAttachments(AValue: Boolean);
begin
  CkImap_put_AutoDownloadAttachments(FHandle, LongBool(AValue));
end;

function TImap.GetAutoFix: Boolean;
begin
  Result := Boolean(CkImap_get_AutoFix(FHandle));
end;

procedure TImap.SetAutoFix(AValue: Boolean);
begin
  CkImap_put_AutoFix(FHandle, LongBool(AValue));
end;

function TImap.GetClientIpAddress: string;
begin
  Result := CkToStr(CkImap_get_ClientIpAddress(FHandle));
end;

procedure TImap.SetClientIpAddress(AValue: string);
begin
  CkImap_put_ClientIpAddress(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetConnectTimeout: Integer;
begin
  Result := CkImap_get_ConnectTimeout(FHandle);
end;

procedure TImap.SetConnectTimeout(AValue: Integer);
begin
  CkImap_put_ConnectTimeout(FHandle, AValue);
end;

function TImap.GetConnectedToHost: string;
begin
  Result := CkToStr(CkImap_get_ConnectedToHost(FHandle));
end;

function TImap.GetDomain: string;
begin
  Result := CkToStr(CkImap_get_Domain(FHandle));
end;

procedure TImap.SetDomain(AValue: string);
begin
  CkImap_put_Domain(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetHeartbeatMs: Integer;
begin
  Result := CkImap_get_HeartbeatMs(FHandle);
end;

procedure TImap.SetHeartbeatMs(AValue: Integer);
begin
  CkImap_put_HeartbeatMs(FHandle, AValue);
end;

function TImap.GetHttpProxyAuthMethod: string;
begin
  Result := CkToStr(CkImap_get_HttpProxyAuthMethod(FHandle));
end;

procedure TImap.SetHttpProxyAuthMethod(AValue: string);
begin
  CkImap_put_HttpProxyAuthMethod(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetHttpProxyDomain: string;
begin
  Result := CkToStr(CkImap_get_HttpProxyDomain(FHandle));
end;

procedure TImap.SetHttpProxyDomain(AValue: string);
begin
  CkImap_put_HttpProxyDomain(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetHttpProxyHostname: string;
begin
  Result := CkToStr(CkImap_get_HttpProxyHostname(FHandle));
end;

procedure TImap.SetHttpProxyHostname(AValue: string);
begin
  CkImap_put_HttpProxyHostname(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetHttpProxyPassword: string;
begin
  Result := CkToStr(CkImap_get_HttpProxyPassword(FHandle));
end;

procedure TImap.SetHttpProxyPassword(AValue: string);
begin
  CkImap_put_HttpProxyPassword(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetHttpProxyPort: Integer;
begin
  Result := CkImap_get_HttpProxyPort(FHandle);
end;

procedure TImap.SetHttpProxyPort(AValue: Integer);
begin
  CkImap_put_HttpProxyPort(FHandle, AValue);
end;

function TImap.GetHttpProxyUsername: string;
begin
  Result := CkToStr(CkImap_get_HttpProxyUsername(FHandle));
end;

procedure TImap.SetHttpProxyUsername(AValue: string);
begin
  CkImap_put_HttpProxyUsername(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetKeepSessionLog: Boolean;
begin
  Result := Boolean(CkImap_get_KeepSessionLog(FHandle));
end;

procedure TImap.SetKeepSessionLog(AValue: Boolean);
begin
  CkImap_put_KeepSessionLog(FHandle, LongBool(AValue));
end;

function TImap.GetLastAppendedMime: string;
begin
  Result := CkToStr(CkImap_get_LastAppendedMime(FHandle));
end;

function TImap.GetLastCommand: string;
begin
  Result := CkToStr(CkImap_get_LastCommand(FHandle));
end;

function TImap.GetLastIntermediateResponse: string;
begin
  Result := CkToStr(CkImap_get_LastIntermediateResponse(FHandle));
end;

function TImap.GetLastResponse: string;
begin
  Result := CkToStr(CkImap_get_LastResponse(FHandle));
end;

function TImap.GetLastResponseCode: string;
begin
  Result := CkToStr(CkImap_get_LastResponseCode(FHandle));
end;

function TImap.GetLoggedInUser: string;
begin
  Result := CkToStr(CkImap_get_LoggedInUser(FHandle));
end;

function TImap.GetNumMessages: Integer;
begin
  Result := CkImap_get_NumMessages(FHandle);
end;

function TImap.GetPeekMode: Boolean;
begin
  Result := Boolean(CkImap_get_PeekMode(FHandle));
end;

procedure TImap.SetPeekMode(AValue: Boolean);
begin
  CkImap_put_PeekMode(FHandle, LongBool(AValue));
end;

function TImap.GetPercentDoneScale: Integer;
begin
  Result := CkImap_get_PercentDoneScale(FHandle);
end;

procedure TImap.SetPercentDoneScale(AValue: Integer);
begin
  CkImap_put_PercentDoneScale(FHandle, AValue);
end;

function TImap.GetPort: Integer;
begin
  Result := CkImap_get_Port(FHandle);
end;

procedure TImap.SetPort(AValue: Integer);
begin
  CkImap_put_Port(FHandle, AValue);
end;

function TImap.GetPreferIpv6: Boolean;
begin
  Result := Boolean(CkImap_get_PreferIpv6(FHandle));
end;

procedure TImap.SetPreferIpv6(AValue: Boolean);
begin
  CkImap_put_PreferIpv6(FHandle, LongBool(AValue));
end;

function TImap.GetReadTimeout: Integer;
begin
  Result := CkImap_get_ReadTimeout(FHandle);
end;

procedure TImap.SetReadTimeout(AValue: Integer);
begin
  CkImap_put_ReadTimeout(FHandle, AValue);
end;

function TImap.GetRequireSslCertVerify: Boolean;
begin
  Result := Boolean(CkImap_get_RequireSslCertVerify(FHandle));
end;

procedure TImap.SetRequireSslCertVerify(AValue: Boolean);
begin
  CkImap_put_RequireSslCertVerify(FHandle, LongBool(AValue));
end;

function TImap.GetSearchCharset: string;
begin
  Result := CkToStr(CkImap_get_SearchCharset(FHandle));
end;

procedure TImap.SetSearchCharset(AValue: string);
begin
  CkImap_put_SearchCharset(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetSelectedMailbox: string;
begin
  Result := CkToStr(CkImap_get_SelectedMailbox(FHandle));
end;

function TImap.GetSendBufferSize: Integer;
begin
  Result := CkImap_get_SendBufferSize(FHandle);
end;

procedure TImap.SetSendBufferSize(AValue: Integer);
begin
  CkImap_put_SendBufferSize(FHandle, AValue);
end;

function TImap.GetSeparatorChar: string;
begin
  Result := CkToStr(CkImap_get_SeparatorChar(FHandle));
end;

procedure TImap.SetSeparatorChar(AValue: string);
begin
  CkImap_put_SeparatorChar(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetSessionLog: string;
begin
  Result := CkToStr(CkImap_get_SessionLog(FHandle));
end;

function TImap.GetSoRcvBuf: Integer;
begin
  Result := CkImap_get_SoRcvBuf(FHandle);
end;

procedure TImap.SetSoRcvBuf(AValue: Integer);
begin
  CkImap_put_SoRcvBuf(FHandle, AValue);
end;

function TImap.GetSoSndBuf: Integer;
begin
  Result := CkImap_get_SoSndBuf(FHandle);
end;

procedure TImap.SetSoSndBuf(AValue: Integer);
begin
  CkImap_put_SoSndBuf(FHandle, AValue);
end;

function TImap.GetSocksHostname: string;
begin
  Result := CkToStr(CkImap_get_SocksHostname(FHandle));
end;

procedure TImap.SetSocksHostname(AValue: string);
begin
  CkImap_put_SocksHostname(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetSocksPassword: string;
begin
  Result := CkToStr(CkImap_get_SocksPassword(FHandle));
end;

procedure TImap.SetSocksPassword(AValue: string);
begin
  CkImap_put_SocksPassword(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetSocksPort: Integer;
begin
  Result := CkImap_get_SocksPort(FHandle);
end;

procedure TImap.SetSocksPort(AValue: Integer);
begin
  CkImap_put_SocksPort(FHandle, AValue);
end;

function TImap.GetSocksUsername: string;
begin
  Result := CkToStr(CkImap_get_SocksUsername(FHandle));
end;

procedure TImap.SetSocksUsername(AValue: string);
begin
  CkImap_put_SocksUsername(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetSocksVersion: Integer;
begin
  Result := CkImap_get_SocksVersion(FHandle);
end;

procedure TImap.SetSocksVersion(AValue: Integer);
begin
  CkImap_put_SocksVersion(FHandle, AValue);
end;

function TImap.GetSsl: Boolean;
begin
  Result := Boolean(CkImap_get_Ssl(FHandle));
end;

procedure TImap.SetSsl(AValue: Boolean);
begin
  CkImap_put_Ssl(FHandle, LongBool(AValue));
end;

function TImap.GetSslAllowedCiphers: string;
begin
  Result := CkToStr(CkImap_get_SslAllowedCiphers(FHandle));
end;

procedure TImap.SetSslAllowedCiphers(AValue: string);
begin
  CkImap_put_SslAllowedCiphers(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetSslProtocol: string;
begin
  Result := CkToStr(CkImap_get_SslProtocol(FHandle));
end;

procedure TImap.SetSslProtocol(AValue: string);
begin
  CkImap_put_SslProtocol(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetSslServerCertVerified: Boolean;
begin
  Result := Boolean(CkImap_get_SslServerCertVerified(FHandle));
end;

function TImap.GetStartTls: Boolean;
begin
  Result := Boolean(CkImap_get_StartTls(FHandle));
end;

procedure TImap.SetStartTls(AValue: Boolean);
begin
  CkImap_put_StartTls(FHandle, LongBool(AValue));
end;

function TImap.GetTlsCipherSuite: string;
begin
  Result := CkToStr(CkImap_get_TlsCipherSuite(FHandle));
end;

function TImap.GetTlsPinSet: string;
begin
  Result := CkToStr(CkImap_get_TlsPinSet(FHandle));
end;

procedure TImap.SetTlsPinSet(AValue: string);
begin
  CkImap_put_TlsPinSet(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetTlsVersion: string;
begin
  Result := CkToStr(CkImap_get_TlsVersion(FHandle));
end;

function TImap.GetUidNext: LongWord;
begin
  Result := CkImap_get_UidNext(FHandle);
end;

function TImap.GetUidValidity: LongWord;
begin
  Result := CkImap_get_UidValidity(FHandle);
end;

function TImap.GetUncommonOptions: string;
begin
  Result := CkToStr(CkImap_get_UncommonOptions(FHandle));
end;

procedure TImap.SetUncommonOptions(AValue: string);
begin
  CkImap_put_UncommonOptions(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetHighestModSeq: string;
begin
  Result := CkToStr(CkImap_get_HighestModSeq(FHandle));
end;

function TImap.GetSortCriteria: string;
begin
  Result := CkToStr(CkImap_get_SortCriteria(FHandle));
end;

procedure TImap.SetSortCriteria(AValue: string);
begin
  CkImap_put_SortCriteria(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TImap.GetEnableSecrets: Boolean;
begin
  Result := Boolean(CkImap_get_EnableSecrets(FHandle));
end;

procedure TImap.SetEnableSecrets(AValue: Boolean);
begin
  CkImap_put_EnableSecrets(FHandle, LongBool(AValue));
end;

function TImap.AddPfxSourceFile(const pfxFilePath: string; const pfxPassword: string): Boolean;
begin
  Result := Boolean(CkImap_AddPfxSourceFile(FHandle, PAnsiChar(StrToCk(pfxFilePath)), PAnsiChar(StrToCk(pfxPassword))));
end;

function TImap.AppendMail(const mailbox: string; email: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_AppendMail(FHandle, PAnsiChar(StrToCk(mailbox)), email.Handle));
end;

function TImap.AppendMime(const mailbox: string; const mimeText: string): Boolean;
begin
  Result := Boolean(CkImap_AppendMime(FHandle, PAnsiChar(StrToCk(mailbox)), PAnsiChar(StrToCk(mimeText))));
end;

function TImap.AppendMimeWithDateStr(const mailbox: string; const mimeText: string; const internalDateStr: string): Boolean;
begin
  Result := Boolean(CkImap_AppendMimeWithDateStr(FHandle, PAnsiChar(StrToCk(mailbox)), PAnsiChar(StrToCk(mimeText)), PAnsiChar(StrToCk(internalDateStr))));
end;

function TImap.AppendMimeWithFlags(const mailbox: string; const mimeText: string; seen: Boolean; flagged: Boolean; answered: Boolean; draft: Boolean): Boolean;
begin
  Result := Boolean(CkImap_AppendMimeWithFlags(FHandle, PAnsiChar(StrToCk(mailbox)), PAnsiChar(StrToCk(mimeText)), LongBool(seen), LongBool(flagged), LongBool(answered), LongBool(draft)));
end;

function TImap.Capability: string;
begin
  Result := CkToStr(CkImap_Capability(FHandle));
end;

function TImap.CheckConnection: Boolean;
begin
  Result := Boolean(CkImap_CheckConnection(FHandle));
end;

procedure TImap.ClearSessionLog;
begin
  CkImap_ClearSessionLog(FHandle);
end;

function TImap.CloseMailbox(const mailbox: string): Boolean;
begin
  Result := Boolean(CkImap_CloseMailbox(FHandle, PAnsiChar(StrToCk(mailbox))));
end;

function TImap.Connect(const domainName: string): Boolean;
begin
  Result := Boolean(CkImap_Connect(FHandle, PAnsiChar(StrToCk(domainName))));
end;

function TImap.Copy(msgId: LongWord; bUid: Boolean; const copyToMailbox: string): Boolean;
begin
  Result := Boolean(CkImap_Copy(FHandle, msgId, LongBool(bUid), PAnsiChar(StrToCk(copyToMailbox))));
end;

function TImap.CopyMultiple(messageSet: TChilkatBase; const copyToMailbox: string): Boolean;
begin
  Result := Boolean(CkImap_CopyMultiple(FHandle, messageSet.Handle, PAnsiChar(StrToCk(copyToMailbox))));
end;

function TImap.CopySequence(startSeqNum: Integer; count: Integer; const copyToMailbox: string): Boolean;
begin
  Result := Boolean(CkImap_CopySequence(FHandle, startSeqNum, count, PAnsiChar(StrToCk(copyToMailbox))));
end;

function TImap.CreateMailbox(const mailbox: string): Boolean;
begin
  Result := Boolean(CkImap_CreateMailbox(FHandle, PAnsiChar(StrToCk(mailbox))));
end;

function TImap.DeleteMailbox(const mailbox: string): Boolean;
begin
  Result := Boolean(CkImap_DeleteMailbox(FHandle, PAnsiChar(StrToCk(mailbox))));
end;

function TImap.Disconnect: Boolean;
begin
  Result := Boolean(CkImap_Disconnect(FHandle));
end;

function TImap.ExamineMailbox(const mailbox: string): Boolean;
begin
  Result := Boolean(CkImap_ExamineMailbox(FHandle, PAnsiChar(StrToCk(mailbox))));
end;

function TImap.Expunge: Boolean;
begin
  Result := Boolean(CkImap_Expunge(FHandle));
end;

function TImap.ExpungeAndClose: Boolean;
begin
  Result := Boolean(CkImap_ExpungeAndClose(FHandle));
end;

function TImap.FetchAttachment(emailObject: TChilkatBase; attachmentIndex: Integer; const saveToPath: string): Boolean;
begin
  Result := Boolean(CkImap_FetchAttachment(FHandle, emailObject.Handle, attachmentIndex, PAnsiChar(StrToCk(saveToPath))));
end;

function TImap.FetchAttachmentString(emailObject: TChilkatBase; attachmentIndex: Integer; const charset: string): string;
begin
  Result := CkToStr(CkImap_FetchAttachmentString(FHandle, emailObject.Handle, attachmentIndex, PAnsiChar(StrToCk(charset))));
end;

function TImap.FetchFlags(msgId: LongWord; bUid: Boolean): string;
begin
  Result := CkToStr(CkImap_FetchFlags(FHandle, msgId, LongBool(bUid)));
end;

function TImap.FetchSingleAsMime(msgId: LongWord; bUid: Boolean): string;
begin
  Result := CkToStr(CkImap_FetchSingleAsMime(FHandle, msgId, LongBool(bUid)));
end;

function TImap.FetchSingleHeaderAsMime(msgId: LongWord; bUID: Boolean): string;
begin
  Result := CkToStr(CkImap_FetchSingleHeaderAsMime(FHandle, msgId, LongBool(bUID)));
end;

function TImap.GetMailAttachFilename(email: TChilkatBase; attachIndex: Integer): string;
begin
  Result := CkToStr(CkImap_GetMailAttachFilename(FHandle, email.Handle, attachIndex));
end;

function TImap.GetMailAttachSize(email: TChilkatBase; attachIndex: Integer): Integer;
begin
  Result := CkImap_GetMailAttachSize(FHandle, email.Handle, attachIndex);
end;

function TImap.GetMailFlag(email: TChilkatBase; const flagName: string): Integer;
begin
  Result := CkImap_GetMailFlag(FHandle, email.Handle, PAnsiChar(StrToCk(flagName)));
end;

function TImap.GetMailNumAttach(email: TChilkatBase): Integer;
begin
  Result := CkImap_GetMailNumAttach(FHandle, email.Handle);
end;

function TImap.GetMailSize(email: TChilkatBase): Integer;
begin
  Result := CkImap_GetMailSize(FHandle, email.Handle);
end;

function TImap.GetMailboxStatus(const mailbox: string): string;
begin
  Result := CkToStr(CkImap_GetMailboxStatus(FHandle, PAnsiChar(StrToCk(mailbox))));
end;

function TImap.GetQuota(const quotaRoot: string): string;
begin
  Result := CkToStr(CkImap_GetQuota(FHandle, PAnsiChar(StrToCk(quotaRoot))));
end;

function TImap.GetQuotaRoot(const mailboxName: string): string;
begin
  Result := CkToStr(CkImap_GetQuotaRoot(FHandle, PAnsiChar(StrToCk(mailboxName))));
end;

function TImap.HasCapability(const name: string; const capabilityResponse: string): Boolean;
begin
  Result := Boolean(CkImap_HasCapability(FHandle, PAnsiChar(StrToCk(name)), PAnsiChar(StrToCk(capabilityResponse))));
end;

function TImap.IdleCheck(timeoutMs: Integer): string;
begin
  Result := CkToStr(CkImap_IdleCheck(FHandle, timeoutMs));
end;

function TImap.IdleDone: Boolean;
begin
  Result := Boolean(CkImap_IdleDone(FHandle));
end;

function TImap.IdleStart: Boolean;
begin
  Result := Boolean(CkImap_IdleStart(FHandle));
end;

function TImap.IsConnected: Boolean;
begin
  Result := Boolean(CkImap_IsConnected(FHandle));
end;

function TImap.IsLoggedIn: Boolean;
begin
  Result := Boolean(CkImap_IsLoggedIn(FHandle));
end;

function TImap.Login(const loginName: string; const password: string): Boolean;
begin
  Result := Boolean(CkImap_Login(FHandle, PAnsiChar(StrToCk(loginName)), PAnsiChar(StrToCk(password))));
end;

function TImap.Logout: Boolean;
begin
  Result := Boolean(CkImap_Logout(FHandle));
end;

function TImap.Noop: Boolean;
begin
  Result := Boolean(CkImap_Noop(FHandle));
end;

function TImap.RefetchMailFlags(email: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_RefetchMailFlags(FHandle, email.Handle));
end;

function TImap.RenameMailbox(const fromMailbox: string; const toMailbox: string): Boolean;
begin
  Result := Boolean(CkImap_RenameMailbox(FHandle, PAnsiChar(StrToCk(fromMailbox)), PAnsiChar(StrToCk(toMailbox))));
end;

function TImap.SelectMailbox(const mailbox: string): Boolean;
begin
  Result := Boolean(CkImap_SelectMailbox(FHandle, PAnsiChar(StrToCk(mailbox))));
end;

function TImap.SendRawCommand(const cmd: string): string;
begin
  Result := CkToStr(CkImap_SendRawCommand(FHandle, PAnsiChar(StrToCk(cmd))));
end;

function TImap.SetDecryptCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_SetDecryptCert(FHandle, cert.Handle));
end;

function TImap.SetDecryptCert2(cert: TChilkatBase; key: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_SetDecryptCert2(FHandle, cert.Handle, key.Handle));
end;

function TImap.SetFlag(msgId: LongWord; bUid: Boolean; const flagName: string; value: Integer): Boolean;
begin
  Result := Boolean(CkImap_SetFlag(FHandle, msgId, LongBool(bUid), PAnsiChar(StrToCk(flagName)), value));
end;

function TImap.SetFlags(messageSet: TChilkatBase; const flagName: string; value: Integer): Boolean;
begin
  Result := Boolean(CkImap_SetFlags(FHandle, messageSet.Handle, PAnsiChar(StrToCk(flagName)), value));
end;

function TImap.SetMailFlag(email: TChilkatBase; const flagName: string; value: Integer): Boolean;
begin
  Result := Boolean(CkImap_SetMailFlag(FHandle, email.Handle, PAnsiChar(StrToCk(flagName)), value));
end;

function TImap.SetQuota(const quotaRoot: string; const resource: string; quota: Integer): Boolean;
begin
  Result := Boolean(CkImap_SetQuota(FHandle, PAnsiChar(StrToCk(quotaRoot)), PAnsiChar(StrToCk(resource)), quota));
end;

function TImap.SetSslClientCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_SetSslClientCert(FHandle, cert.Handle));
end;

function TImap.SetSslClientCertPem(const pemDataOrFilename: string; const pemPassword: string): Boolean;
begin
  Result := Boolean(CkImap_SetSslClientCertPem(FHandle, PAnsiChar(StrToCk(pemDataOrFilename)), PAnsiChar(StrToCk(pemPassword))));
end;

function TImap.SetSslClientCertPfx(const pfxFilename: string; const pfxPassword: string): Boolean;
begin
  Result := Boolean(CkImap_SetSslClientCertPfx(FHandle, PAnsiChar(StrToCk(pfxFilename)), PAnsiChar(StrToCk(pfxPassword))));
end;

function TImap.SshAuthenticatePk(const sshLogin: string; privateKey: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_SshAuthenticatePk(FHandle, PAnsiChar(StrToCk(sshLogin)), privateKey.Handle));
end;

function TImap.SshAuthenticatePw(const sshLogin: string; const sshPassword: string): Boolean;
begin
  Result := Boolean(CkImap_SshAuthenticatePw(FHandle, PAnsiChar(StrToCk(sshLogin)), PAnsiChar(StrToCk(sshPassword))));
end;

function TImap.SshCloseTunnel: Boolean;
begin
  Result := Boolean(CkImap_SshCloseTunnel(FHandle));
end;

function TImap.SshOpenTunnel(const sshHostname: string; sshPort: Integer): Boolean;
begin
  Result := Boolean(CkImap_SshOpenTunnel(FHandle, PAnsiChar(StrToCk(sshHostname)), sshPort));
end;

function TImap.StoreFlags(msgId: LongWord; bUid: Boolean; const flagNames: string; value: Integer): Boolean;
begin
  Result := Boolean(CkImap_StoreFlags(FHandle, msgId, LongBool(bUid), PAnsiChar(StrToCk(flagNames)), value));
end;

function TImap.Subscribe(const mailbox: string): Boolean;
begin
  Result := Boolean(CkImap_Subscribe(FHandle, PAnsiChar(StrToCk(mailbox))));
end;

function TImap.Unsubscribe(const mailbox: string): Boolean;
begin
  Result := Boolean(CkImap_Unsubscribe(FHandle, PAnsiChar(StrToCk(mailbox))));
end;

function TImap.UseCertVault(vault: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_UseCertVault(FHandle, vault.Handle));
end;

function TImap.UseSsh(ssh: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_UseSsh(FHandle, ssh.Handle));
end;

function TImap.UseSshTunnel(tunnel: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_UseSshTunnel(FHandle, tunnel.Handle));
end;

function TImap.FetchSingleAsMimeSb(msgId: LongWord; bUid: Boolean; sbMime: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_FetchSingleAsMimeSb(FHandle, msgId, LongBool(bUid), sbMime.Handle));
end;

function TImap.FetchAttachmentSb(email: TChilkatBase; attachmentIndex: Integer; const charset: string; sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_FetchAttachmentSb(FHandle, email.Handle, attachmentIndex, PAnsiChar(StrToCk(charset)), sb.Handle));
end;

function TImap.FetchAttachmentBd(email: TChilkatBase; attachmentIndex: Integer; binData: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_FetchAttachmentBd(FHandle, email.Handle, attachmentIndex, binData.Handle));
end;

function TImap.AppendMimeWithFlagsSb(const mailbox: string; sbMime: TChilkatBase; seen: Boolean; flagged: Boolean; answered: Boolean; draft: Boolean): Boolean;
begin
  Result := Boolean(CkImap_AppendMimeWithFlagsSb(FHandle, PAnsiChar(StrToCk(mailbox)), sbMime.Handle, LongBool(seen), LongBool(flagged), LongBool(answered), LongBool(draft)));
end;

function TImap.MoveMessages(messageSet: TChilkatBase; const destFolder: string): Boolean;
begin
  Result := Boolean(CkImap_MoveMessages(FHandle, messageSet.Handle, PAnsiChar(StrToCk(destFolder))));
end;

function TImap.LoginSecure(loginName: TChilkatBase; password: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_LoginSecure(FHandle, loginName.Handle, password.Handle));
end;

function TImap.FetchSingleBd(msgId: LongWord; bUid: Boolean; mimeData: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_FetchSingleBd(FHandle, msgId, LongBool(bUid), mimeData.Handle));
end;

function TImap.GetServerCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_GetServerCert(FHandle, cert.Handle));
end;

function TImap.FetchMsgSet(headersOnly: Boolean; msgSet: TChilkatBase; bundle: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_FetchMsgSet(FHandle, LongBool(headersOnly), msgSet.Handle, bundle.Handle));
end;

function TImap.FetchRange(headersOnly: Boolean; seqnum: Integer; count: Integer; bundle: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_FetchRange(FHandle, LongBool(headersOnly), seqnum, count, bundle.Handle));
end;

function TImap.FetchEmail(headerOnly: Boolean; msgId: LongWord; bUid: Boolean; email: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_FetchEmail(FHandle, LongBool(headerOnly), msgId, LongBool(bUid), email.Handle));
end;

function TImap.MbxList(subscribed: Boolean; const reference: string; const mbxPattern: string; mboxes: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_MbxList(FHandle, LongBool(subscribed), PAnsiChar(StrToCk(reference)), PAnsiChar(StrToCk(mbxPattern)), mboxes.Handle));
end;

function TImap.QueryMbx(const criteria: string; bUid: Boolean; msgSet: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_QueryMbx(FHandle, PAnsiChar(StrToCk(criteria)), LongBool(bUid), msgSet.Handle));
end;

function TImap.FetchChunk2(seqnum: Integer; count: Integer; failedSet: TChilkatBase; fetchedSet: TChilkatBase; bundle: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_FetchChunk2(FHandle, seqnum, count, failedSet.Handle, fetchedSet.Handle, bundle.Handle));
end;

function TImap.QueryThread(const threadAlg: string; const searchCriteria: string; bUid: Boolean; json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_QueryThread(FHandle, PAnsiChar(StrToCk(threadAlg)), PAnsiChar(StrToCk(searchCriteria)), LongBool(bUid), json.Handle));
end;

function TImap.AddPfxSourceBd(bd: TChilkatBase; const password: string): Boolean;
begin
  Result := Boolean(CkImap_AddPfxSourceBd(FHandle, bd.Handle, PAnsiChar(StrToCk(password))));
end;

function TImap.RawCommandBd(bdCmd: TChilkatBase; bdResp: TChilkatBase): Boolean;
begin
  Result := Boolean(CkImap_RawCommandBd(FHandle, bdCmd.Handle, bdResp.Handle));
end;

initialization
  Chilkat_GetProcedureAddress(CkImap_Create,  'CkImap_Create');
  Chilkat_GetProcedureAddress(CkImap_Dispose, 'CkImap_Dispose');
  Chilkat_GetProcedureAddress(CkImap_SetAbortCheckCallback, 'CkImap_SetAbortCheckCallback');
  Chilkat_GetProcedureAddress(CkImap_SetPercentDoneCallback, 'CkImap_SetPercentDoneCallback');
  Chilkat_GetProcedureAddress(CkImap_SetProgressInfoCallback, 'CkImap_SetProgressInfoCallback');
  Chilkat_GetProcedureAddress(CkImap_get_LastErrorHtml, 'CkImap_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkImap_get_LastErrorText, 'CkImap_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkImap_get_LastErrorXml, 'CkImap_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkImap_get_Version, 'CkImap_get_Version');
  Chilkat_GetProcedureAddress(CkImap_get_DebugLogFilePath, 'CkImap_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkImap_put_DebugLogFilePath, 'CkImap_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkImap_get_VerboseLogging, 'CkImap_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkImap_put_VerboseLogging, 'CkImap_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkImap_get_LastMethodSuccess, 'CkImap_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkImap_put_LastMethodSuccess, 'CkImap_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkImap_get_AbortCurrent, 'CkImap_get_AbortCurrent');
  Chilkat_GetProcedureAddress(CkImap_put_AbortCurrent, 'CkImap_put_AbortCurrent');
  Chilkat_GetProcedureAddress(CkImap_get_AppendSeen, 'CkImap_get_AppendSeen');
  Chilkat_GetProcedureAddress(CkImap_put_AppendSeen, 'CkImap_put_AppendSeen');
  Chilkat_GetProcedureAddress(CkImap_get_AppendUid, 'CkImap_get_AppendUid');
  Chilkat_GetProcedureAddress(CkImap_get_AuthMethod, 'CkImap_get_AuthMethod');
  Chilkat_GetProcedureAddress(CkImap_put_AuthMethod, 'CkImap_put_AuthMethod');
  Chilkat_GetProcedureAddress(CkImap_get_AuthzId, 'CkImap_get_AuthzId');
  Chilkat_GetProcedureAddress(CkImap_put_AuthzId, 'CkImap_put_AuthzId');
  Chilkat_GetProcedureAddress(CkImap_get_AutoDownloadAttachments, 'CkImap_get_AutoDownloadAttachments');
  Chilkat_GetProcedureAddress(CkImap_put_AutoDownloadAttachments, 'CkImap_put_AutoDownloadAttachments');
  Chilkat_GetProcedureAddress(CkImap_get_AutoFix, 'CkImap_get_AutoFix');
  Chilkat_GetProcedureAddress(CkImap_put_AutoFix, 'CkImap_put_AutoFix');
  Chilkat_GetProcedureAddress(CkImap_get_ClientIpAddress, 'CkImap_get_ClientIpAddress');
  Chilkat_GetProcedureAddress(CkImap_put_ClientIpAddress, 'CkImap_put_ClientIpAddress');
  Chilkat_GetProcedureAddress(CkImap_get_ConnectTimeout, 'CkImap_get_ConnectTimeout');
  Chilkat_GetProcedureAddress(CkImap_put_ConnectTimeout, 'CkImap_put_ConnectTimeout');
  Chilkat_GetProcedureAddress(CkImap_get_ConnectedToHost, 'CkImap_get_ConnectedToHost');
  Chilkat_GetProcedureAddress(CkImap_get_Domain, 'CkImap_get_Domain');
  Chilkat_GetProcedureAddress(CkImap_put_Domain, 'CkImap_put_Domain');
  Chilkat_GetProcedureAddress(CkImap_get_HeartbeatMs, 'CkImap_get_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkImap_put_HeartbeatMs, 'CkImap_put_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkImap_get_HttpProxyAuthMethod, 'CkImap_get_HttpProxyAuthMethod');
  Chilkat_GetProcedureAddress(CkImap_put_HttpProxyAuthMethod, 'CkImap_put_HttpProxyAuthMethod');
  Chilkat_GetProcedureAddress(CkImap_get_HttpProxyDomain, 'CkImap_get_HttpProxyDomain');
  Chilkat_GetProcedureAddress(CkImap_put_HttpProxyDomain, 'CkImap_put_HttpProxyDomain');
  Chilkat_GetProcedureAddress(CkImap_get_HttpProxyHostname, 'CkImap_get_HttpProxyHostname');
  Chilkat_GetProcedureAddress(CkImap_put_HttpProxyHostname, 'CkImap_put_HttpProxyHostname');
  Chilkat_GetProcedureAddress(CkImap_get_HttpProxyPassword, 'CkImap_get_HttpProxyPassword');
  Chilkat_GetProcedureAddress(CkImap_put_HttpProxyPassword, 'CkImap_put_HttpProxyPassword');
  Chilkat_GetProcedureAddress(CkImap_get_HttpProxyPort, 'CkImap_get_HttpProxyPort');
  Chilkat_GetProcedureAddress(CkImap_put_HttpProxyPort, 'CkImap_put_HttpProxyPort');
  Chilkat_GetProcedureAddress(CkImap_get_HttpProxyUsername, 'CkImap_get_HttpProxyUsername');
  Chilkat_GetProcedureAddress(CkImap_put_HttpProxyUsername, 'CkImap_put_HttpProxyUsername');
  Chilkat_GetProcedureAddress(CkImap_get_KeepSessionLog, 'CkImap_get_KeepSessionLog');
  Chilkat_GetProcedureAddress(CkImap_put_KeepSessionLog, 'CkImap_put_KeepSessionLog');
  Chilkat_GetProcedureAddress(CkImap_get_LastAppendedMime, 'CkImap_get_LastAppendedMime');
  Chilkat_GetProcedureAddress(CkImap_get_LastCommand, 'CkImap_get_LastCommand');
  Chilkat_GetProcedureAddress(CkImap_get_LastIntermediateResponse, 'CkImap_get_LastIntermediateResponse');
  Chilkat_GetProcedureAddress(CkImap_get_LastResponse, 'CkImap_get_LastResponse');
  Chilkat_GetProcedureAddress(CkImap_get_LastResponseCode, 'CkImap_get_LastResponseCode');
  Chilkat_GetProcedureAddress(CkImap_get_LoggedInUser, 'CkImap_get_LoggedInUser');
  Chilkat_GetProcedureAddress(CkImap_get_NumMessages, 'CkImap_get_NumMessages');
  Chilkat_GetProcedureAddress(CkImap_get_PeekMode, 'CkImap_get_PeekMode');
  Chilkat_GetProcedureAddress(CkImap_put_PeekMode, 'CkImap_put_PeekMode');
  Chilkat_GetProcedureAddress(CkImap_get_PercentDoneScale, 'CkImap_get_PercentDoneScale');
  Chilkat_GetProcedureAddress(CkImap_put_PercentDoneScale, 'CkImap_put_PercentDoneScale');
  Chilkat_GetProcedureAddress(CkImap_get_Port, 'CkImap_get_Port');
  Chilkat_GetProcedureAddress(CkImap_put_Port, 'CkImap_put_Port');
  Chilkat_GetProcedureAddress(CkImap_get_PreferIpv6, 'CkImap_get_PreferIpv6');
  Chilkat_GetProcedureAddress(CkImap_put_PreferIpv6, 'CkImap_put_PreferIpv6');
  Chilkat_GetProcedureAddress(CkImap_get_ReadTimeout, 'CkImap_get_ReadTimeout');
  Chilkat_GetProcedureAddress(CkImap_put_ReadTimeout, 'CkImap_put_ReadTimeout');
  Chilkat_GetProcedureAddress(CkImap_get_RequireSslCertVerify, 'CkImap_get_RequireSslCertVerify');
  Chilkat_GetProcedureAddress(CkImap_put_RequireSslCertVerify, 'CkImap_put_RequireSslCertVerify');
  Chilkat_GetProcedureAddress(CkImap_get_SearchCharset, 'CkImap_get_SearchCharset');
  Chilkat_GetProcedureAddress(CkImap_put_SearchCharset, 'CkImap_put_SearchCharset');
  Chilkat_GetProcedureAddress(CkImap_get_SelectedMailbox, 'CkImap_get_SelectedMailbox');
  Chilkat_GetProcedureAddress(CkImap_get_SendBufferSize, 'CkImap_get_SendBufferSize');
  Chilkat_GetProcedureAddress(CkImap_put_SendBufferSize, 'CkImap_put_SendBufferSize');
  Chilkat_GetProcedureAddress(CkImap_get_SeparatorChar, 'CkImap_get_SeparatorChar');
  Chilkat_GetProcedureAddress(CkImap_put_SeparatorChar, 'CkImap_put_SeparatorChar');
  Chilkat_GetProcedureAddress(CkImap_get_SessionLog, 'CkImap_get_SessionLog');
  Chilkat_GetProcedureAddress(CkImap_get_SoRcvBuf, 'CkImap_get_SoRcvBuf');
  Chilkat_GetProcedureAddress(CkImap_put_SoRcvBuf, 'CkImap_put_SoRcvBuf');
  Chilkat_GetProcedureAddress(CkImap_get_SoSndBuf, 'CkImap_get_SoSndBuf');
  Chilkat_GetProcedureAddress(CkImap_put_SoSndBuf, 'CkImap_put_SoSndBuf');
  Chilkat_GetProcedureAddress(CkImap_get_SocksHostname, 'CkImap_get_SocksHostname');
  Chilkat_GetProcedureAddress(CkImap_put_SocksHostname, 'CkImap_put_SocksHostname');
  Chilkat_GetProcedureAddress(CkImap_get_SocksPassword, 'CkImap_get_SocksPassword');
  Chilkat_GetProcedureAddress(CkImap_put_SocksPassword, 'CkImap_put_SocksPassword');
  Chilkat_GetProcedureAddress(CkImap_get_SocksPort, 'CkImap_get_SocksPort');
  Chilkat_GetProcedureAddress(CkImap_put_SocksPort, 'CkImap_put_SocksPort');
  Chilkat_GetProcedureAddress(CkImap_get_SocksUsername, 'CkImap_get_SocksUsername');
  Chilkat_GetProcedureAddress(CkImap_put_SocksUsername, 'CkImap_put_SocksUsername');
  Chilkat_GetProcedureAddress(CkImap_get_SocksVersion, 'CkImap_get_SocksVersion');
  Chilkat_GetProcedureAddress(CkImap_put_SocksVersion, 'CkImap_put_SocksVersion');
  Chilkat_GetProcedureAddress(CkImap_get_Ssl, 'CkImap_get_Ssl');
  Chilkat_GetProcedureAddress(CkImap_put_Ssl, 'CkImap_put_Ssl');
  Chilkat_GetProcedureAddress(CkImap_get_SslAllowedCiphers, 'CkImap_get_SslAllowedCiphers');
  Chilkat_GetProcedureAddress(CkImap_put_SslAllowedCiphers, 'CkImap_put_SslAllowedCiphers');
  Chilkat_GetProcedureAddress(CkImap_get_SslProtocol, 'CkImap_get_SslProtocol');
  Chilkat_GetProcedureAddress(CkImap_put_SslProtocol, 'CkImap_put_SslProtocol');
  Chilkat_GetProcedureAddress(CkImap_get_SslServerCertVerified, 'CkImap_get_SslServerCertVerified');
  Chilkat_GetProcedureAddress(CkImap_get_StartTls, 'CkImap_get_StartTls');
  Chilkat_GetProcedureAddress(CkImap_put_StartTls, 'CkImap_put_StartTls');
  Chilkat_GetProcedureAddress(CkImap_get_TlsCipherSuite, 'CkImap_get_TlsCipherSuite');
  Chilkat_GetProcedureAddress(CkImap_get_TlsPinSet, 'CkImap_get_TlsPinSet');
  Chilkat_GetProcedureAddress(CkImap_put_TlsPinSet, 'CkImap_put_TlsPinSet');
  Chilkat_GetProcedureAddress(CkImap_get_TlsVersion, 'CkImap_get_TlsVersion');
  Chilkat_GetProcedureAddress(CkImap_get_UidNext, 'CkImap_get_UidNext');
  Chilkat_GetProcedureAddress(CkImap_get_UidValidity, 'CkImap_get_UidValidity');
  Chilkat_GetProcedureAddress(CkImap_get_UncommonOptions, 'CkImap_get_UncommonOptions');
  Chilkat_GetProcedureAddress(CkImap_put_UncommonOptions, 'CkImap_put_UncommonOptions');
  Chilkat_GetProcedureAddress(CkImap_get_HighestModSeq, 'CkImap_get_HighestModSeq');
  Chilkat_GetProcedureAddress(CkImap_get_SortCriteria, 'CkImap_get_SortCriteria');
  Chilkat_GetProcedureAddress(CkImap_put_SortCriteria, 'CkImap_put_SortCriteria');
  Chilkat_GetProcedureAddress(CkImap_get_EnableSecrets, 'CkImap_get_EnableSecrets');
  Chilkat_GetProcedureAddress(CkImap_put_EnableSecrets, 'CkImap_put_EnableSecrets');
  Chilkat_GetProcedureAddress(CkImap_AddPfxSourceFile, 'CkImap_AddPfxSourceFile');
  Chilkat_GetProcedureAddress(CkImap_AppendMail, 'CkImap_AppendMail');
  Chilkat_GetProcedureAddress(CkImap_AppendMime, 'CkImap_AppendMime');
  Chilkat_GetProcedureAddress(CkImap_AppendMimeWithDateStr, 'CkImap_AppendMimeWithDateStr');
  Chilkat_GetProcedureAddress(CkImap_AppendMimeWithFlags, 'CkImap_AppendMimeWithFlags');
  Chilkat_GetProcedureAddress(CkImap_Capability, 'CkImap_Capability');
  Chilkat_GetProcedureAddress(CkImap_CheckConnection, 'CkImap_CheckConnection');
  Chilkat_GetProcedureAddress(CkImap_ClearSessionLog, 'CkImap_ClearSessionLog');
  Chilkat_GetProcedureAddress(CkImap_CloseMailbox, 'CkImap_CloseMailbox');
  Chilkat_GetProcedureAddress(CkImap_Connect, 'CkImap_Connect');
  Chilkat_GetProcedureAddress(CkImap_Copy, 'CkImap_Copy');
  Chilkat_GetProcedureAddress(CkImap_CopyMultiple, 'CkImap_CopyMultiple');
  Chilkat_GetProcedureAddress(CkImap_CopySequence, 'CkImap_CopySequence');
  Chilkat_GetProcedureAddress(CkImap_CreateMailbox, 'CkImap_CreateMailbox');
  Chilkat_GetProcedureAddress(CkImap_DeleteMailbox, 'CkImap_DeleteMailbox');
  Chilkat_GetProcedureAddress(CkImap_Disconnect, 'CkImap_Disconnect');
  Chilkat_GetProcedureAddress(CkImap_ExamineMailbox, 'CkImap_ExamineMailbox');
  Chilkat_GetProcedureAddress(CkImap_Expunge, 'CkImap_Expunge');
  Chilkat_GetProcedureAddress(CkImap_ExpungeAndClose, 'CkImap_ExpungeAndClose');
  Chilkat_GetProcedureAddress(CkImap_FetchAttachment, 'CkImap_FetchAttachment');
  Chilkat_GetProcedureAddress(CkImap_FetchAttachmentString, 'CkImap_FetchAttachmentString');
  Chilkat_GetProcedureAddress(CkImap_FetchFlags, 'CkImap_FetchFlags');
  Chilkat_GetProcedureAddress(CkImap_FetchSingleAsMime, 'CkImap_FetchSingleAsMime');
  Chilkat_GetProcedureAddress(CkImap_FetchSingleHeaderAsMime, 'CkImap_FetchSingleHeaderAsMime');
  Chilkat_GetProcedureAddress(CkImap_GetMailAttachFilename, 'CkImap_GetMailAttachFilename');
  Chilkat_GetProcedureAddress(CkImap_GetMailAttachSize, 'CkImap_GetMailAttachSize');
  Chilkat_GetProcedureAddress(CkImap_GetMailFlag, 'CkImap_GetMailFlag');
  Chilkat_GetProcedureAddress(CkImap_GetMailNumAttach, 'CkImap_GetMailNumAttach');
  Chilkat_GetProcedureAddress(CkImap_GetMailSize, 'CkImap_GetMailSize');
  Chilkat_GetProcedureAddress(CkImap_GetMailboxStatus, 'CkImap_GetMailboxStatus');
  Chilkat_GetProcedureAddress(CkImap_GetQuota, 'CkImap_GetQuota');
  Chilkat_GetProcedureAddress(CkImap_GetQuotaRoot, 'CkImap_GetQuotaRoot');
  Chilkat_GetProcedureAddress(CkImap_HasCapability, 'CkImap_HasCapability');
  Chilkat_GetProcedureAddress(CkImap_IdleCheck, 'CkImap_IdleCheck');
  Chilkat_GetProcedureAddress(CkImap_IdleDone, 'CkImap_IdleDone');
  Chilkat_GetProcedureAddress(CkImap_IdleStart, 'CkImap_IdleStart');
  Chilkat_GetProcedureAddress(CkImap_IsConnected, 'CkImap_IsConnected');
  Chilkat_GetProcedureAddress(CkImap_IsLoggedIn, 'CkImap_IsLoggedIn');
  Chilkat_GetProcedureAddress(CkImap_Login, 'CkImap_Login');
  Chilkat_GetProcedureAddress(CkImap_Logout, 'CkImap_Logout');
  Chilkat_GetProcedureAddress(CkImap_Noop, 'CkImap_Noop');
  Chilkat_GetProcedureAddress(CkImap_RefetchMailFlags, 'CkImap_RefetchMailFlags');
  Chilkat_GetProcedureAddress(CkImap_RenameMailbox, 'CkImap_RenameMailbox');
  Chilkat_GetProcedureAddress(CkImap_SelectMailbox, 'CkImap_SelectMailbox');
  Chilkat_GetProcedureAddress(CkImap_SendRawCommand, 'CkImap_SendRawCommand');
  Chilkat_GetProcedureAddress(CkImap_SetDecryptCert, 'CkImap_SetDecryptCert');
  Chilkat_GetProcedureAddress(CkImap_SetDecryptCert2, 'CkImap_SetDecryptCert2');
  Chilkat_GetProcedureAddress(CkImap_SetFlag, 'CkImap_SetFlag');
  Chilkat_GetProcedureAddress(CkImap_SetFlags, 'CkImap_SetFlags');
  Chilkat_GetProcedureAddress(CkImap_SetMailFlag, 'CkImap_SetMailFlag');
  Chilkat_GetProcedureAddress(CkImap_SetQuota, 'CkImap_SetQuota');
  Chilkat_GetProcedureAddress(CkImap_SetSslClientCert, 'CkImap_SetSslClientCert');
  Chilkat_GetProcedureAddress(CkImap_SetSslClientCertPem, 'CkImap_SetSslClientCertPem');
  Chilkat_GetProcedureAddress(CkImap_SetSslClientCertPfx, 'CkImap_SetSslClientCertPfx');
  Chilkat_GetProcedureAddress(CkImap_SshAuthenticatePk, 'CkImap_SshAuthenticatePk');
  Chilkat_GetProcedureAddress(CkImap_SshAuthenticatePw, 'CkImap_SshAuthenticatePw');
  Chilkat_GetProcedureAddress(CkImap_SshCloseTunnel, 'CkImap_SshCloseTunnel');
  Chilkat_GetProcedureAddress(CkImap_SshOpenTunnel, 'CkImap_SshOpenTunnel');
  Chilkat_GetProcedureAddress(CkImap_StoreFlags, 'CkImap_StoreFlags');
  Chilkat_GetProcedureAddress(CkImap_Subscribe, 'CkImap_Subscribe');
  Chilkat_GetProcedureAddress(CkImap_Unsubscribe, 'CkImap_Unsubscribe');
  Chilkat_GetProcedureAddress(CkImap_UseCertVault, 'CkImap_UseCertVault');
  Chilkat_GetProcedureAddress(CkImap_UseSsh, 'CkImap_UseSsh');
  Chilkat_GetProcedureAddress(CkImap_UseSshTunnel, 'CkImap_UseSshTunnel');
  Chilkat_GetProcedureAddress(CkImap_FetchSingleAsMimeSb, 'CkImap_FetchSingleAsMimeSb');
  Chilkat_GetProcedureAddress(CkImap_FetchAttachmentSb, 'CkImap_FetchAttachmentSb');
  Chilkat_GetProcedureAddress(CkImap_FetchAttachmentBd, 'CkImap_FetchAttachmentBd');
  Chilkat_GetProcedureAddress(CkImap_AppendMimeWithFlagsSb, 'CkImap_AppendMimeWithFlagsSb');
  Chilkat_GetProcedureAddress(CkImap_MoveMessages, 'CkImap_MoveMessages');
  Chilkat_GetProcedureAddress(CkImap_LoginSecure, 'CkImap_LoginSecure');
  Chilkat_GetProcedureAddress(CkImap_FetchSingleBd, 'CkImap_FetchSingleBd');
  Chilkat_GetProcedureAddress(CkImap_GetServerCert, 'CkImap_GetServerCert');
  Chilkat_GetProcedureAddress(CkImap_FetchMsgSet, 'CkImap_FetchMsgSet');
  Chilkat_GetProcedureAddress(CkImap_FetchRange, 'CkImap_FetchRange');
  Chilkat_GetProcedureAddress(CkImap_FetchEmail, 'CkImap_FetchEmail');
  Chilkat_GetProcedureAddress(CkImap_MbxList, 'CkImap_MbxList');
  Chilkat_GetProcedureAddress(CkImap_QueryMbx, 'CkImap_QueryMbx');
  Chilkat_GetProcedureAddress(CkImap_FetchChunk2, 'CkImap_FetchChunk2');
  Chilkat_GetProcedureAddress(CkImap_QueryThread, 'CkImap_QueryThread');
  Chilkat_GetProcedureAddress(CkImap_AddPfxSourceBd, 'CkImap_AddPfxSourceBd');
  Chilkat_GetProcedureAddress(CkImap_RawCommandBd, 'CkImap_RawCommandBd');

end.
