Class ImapClientOptions
Configuration for ImapClient. Mutable during construction; set all properties before calling Connect().
Inherited Members
Namespace: DRIT.Mail.Rfc.Imap
Assembly: DRIT.Mail.dll
Syntax
public sealed class ImapClientOptions
Constructors
View SourceImapClientOptions(string, int)
Initializes a new instance of the ImapClientOptions class.
Declaration
public ImapClientOptions(string host, int port)
Parameters
| Type | Name | Description |
|---|---|---|
| string | host | The IMAP server hostname. |
| int | port | The IMAP server port (143, 993). |
Properties
View SourceAutoAuthenticate
Gets or sets a value indicating whether Connect() should automatically authenticate after connecting. Default is true.
Declaration
public bool AutoAuthenticate { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
AutoConnect
Gets or sets a value indicating whether ImapClient should automatically connect if not already connected. Default is true.
Declaration
public bool AutoConnect { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
CertificateValidationCallback
Gets or sets a custom SSL certificate validation callback, or null to use the platform default chain validation.
Declaration
public RemoteCertificateValidationCallback? CertificateValidationCallback { get; set; }
Property Value
| Type | Description |
|---|---|
| RemoteCertificateValidationCallback |
Credentials
Gets or sets the credentials for IMAP authentication, or null to skip authentication.
Declaration
public SaslCredentials? Credentials { get; set; }
Property Value
| Type | Description |
|---|---|
| SaslCredentials |
Host
Gets the IMAP server hostname.
Declaration
public string Host { get; }
Property Value
| Type | Description |
|---|---|
| string |
IdleKeepaliveInterval
Gets or sets the interval at which IDLE is re-issued to keep the
connection alive (RFC 2177). Default is 3 minutes. Used by
ImapIdleSession in a future phase.
Declaration
public TimeSpan IdleKeepaliveInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
IdleReissueLimit
Gets or sets the maximum number of times IDLE is re-issued before
giving up. Used by ImapIdleSession in a future phase.
Declaration
public int IdleReissueLimit { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
OAuth2Token
Gets or sets the OAuth 2.0 access token for XOAUTH2 authentication, or null to use password-based credentials. When set, this takes precedence over Credentials for mechanism selection.
Declaration
public SaslOAuth2Token? OAuth2Token { get; set; }
Property Value
| Type | Description |
|---|---|
| SaslOAuth2Token |
Port
Gets the IMAP server port.
Declaration
public int Port { get; }
Property Value
| Type | Description |
|---|---|
| int |
PreferredAuth
Gets or sets the preferred authentication mechanism. Default is Auto.
Declaration
public SaslAuthenticationMechanism PreferredAuth { get; set; }
Property Value
| Type | Description |
|---|---|
| SaslAuthenticationMechanism |
RequireEncryption
Gets or sets a value indicating whether authentication is refused over an unencrypted connection. Default is false.
Declaration
public bool RequireEncryption { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
SslMode
Gets or sets the TLS mode. Default is Auto.
Declaration
public ImapSslMode SslMode { get; set; }
Property Value
| Type | Description |
|---|---|
| ImapSslMode |
Timeout
Gets or sets the timeout for connect, read, and write operations. Default is 30 seconds.
Declaration
public TimeSpan Timeout { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |