Compress command for IMAP after the authentication.

This commit is contained in:
Burak Kaan Köse
2024-11-30 11:48:05 +01:00
parent 36b8de470a
commit 2bc5be2105

View File

@@ -79,15 +79,11 @@ namespace Wino.Core.Integration
try try
{ {
bool isReconnected = await EnsureConnectedAsync(client); bool isReconnected = await EnsureConnectedAsync(client);
bool mustDoPostAuthIdentification = false; bool mustDoPostAuthIdentification = false;
if ((isCreatedNew || isReconnected) && client.IsConnected) if ((isCreatedNew || isReconnected) && client.IsConnected)
{ {
// Activate supported pre-auth capabilities.
if (client.Capabilities.HasFlag(ImapCapabilities.Compress))
await client.CompressAsync();
// Identify if the server supports ID extension. // Identify if the server supports ID extension.
// Some servers require it pre-authentication, some post-authentication. // Some servers require it pre-authentication, some post-authentication.
// We'll observe the response here and do it after authentication if needed. // We'll observe the response here and do it after authentication if needed.
@@ -118,6 +114,9 @@ namespace Wino.Core.Integration
// Activate post-auth capabilities. // Activate post-auth capabilities.
if (client.Capabilities.HasFlag(ImapCapabilities.QuickResync)) if (client.Capabilities.HasFlag(ImapCapabilities.QuickResync))
await client.EnableQuickResyncAsync(); await client.EnableQuickResyncAsync();
if (client.Capabilities.HasFlag(ImapCapabilities.Compress))
await client.CompressAsync();
} }
} }
catch (Exception ex) catch (Exception ex)