Click or drag to resize

ImapClientIdentifyAsync Method

Asynchronously identify the client implementation to the server and obtain the server implementation details.

Namespace:  MailKit.Net.Imap
Assembly:  MailKit (in MailKit.dll) Version: 3.0.0
public Task<ImapImplementation> IdentifyAsync(
	ImapImplementation clientImplementation,
	CancellationToken cancellationToken = default


Type: MailKit.Net.ImapImapImplementation
The client implementation.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: TaskImapImplementation
The implementation details of the server if available; otherwise, null.


IImapClientIdentifyAsync(ImapImplementation, CancellationToken)
ObjectDisposedException The ImapClient has been disposed.
ServiceNotConnectedException The ImapClient is not connected.
NotSupportedException The IMAP server does not support the ID extension.
OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.
ImapCommandException The server replied to the ID command with a NO or BAD response.
ImapProtocolException An IMAP protocol error occurred.

Passes along the client implementation details to the server while also obtaining implementation details from the server.

If the clientImplementation is null or no properties have been set, no identifying information will be sent to the server.

Security note Security Note

Security Implications

This command has the danger of violating the privacy of users if misused. Clients should notify users that they send the ID command.

It is highly desirable that implementations provide a method of disabling ID support, perhaps by not calling this method at all, or by passing null as the clientImplementation argument.

Implementors must exercise extreme care in adding properties to the clientImplementation. Some properties, such as a processor ID number, Ethernet address, or other unique (or mostly unique) identifier would allow tracking of users in ways that violate user privacy expectations and may also make it easier for attackers to exploit security holes in the client.

See Also