From: Marco Bettini Date: Mon, 27 Oct 2025 15:43:01 +0000 (+0000) Subject: imap: Add STATUS (DELETED) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b8768193183fffc0bb81b10d797fc1146716758;p=thirdparty%2Fdovecot%2Fcore.git imap: Add STATUS (DELETED) --- diff --git a/src/imap/imap-status.c b/src/imap/imap-status.c index 2cced0fa1d..c5b44a56d6 100644 --- a/src/imap/imap-status.c +++ b/src/imap/imap-status.c @@ -34,6 +34,8 @@ int imap_status_parse_items(struct client_command_context *cmd, ((client_enabled_mailbox_features(cmd->client) & MAILBOX_FEATURE_IMAP4REV2) == 0)) flags |= IMAP_STATUS_ITEM_RECENT; + else if (strcmp(item, "DELETED") == 0) + flags |= IMAP_STATUS_ITEM_DELETED; else if (strcmp(item, "UIDNEXT") == 0) flags |= IMAP_STATUS_ITEM_UIDNEXT; else if (strcmp(item, "UIDVALIDITY") == 0) @@ -71,6 +73,8 @@ int imap_status_get_result(struct client *client, struct mailbox *box, status |= STATUS_MESSAGES; if (HAS_ALL_BITS(items->flags, IMAP_STATUS_ITEM_RECENT)) status |= STATUS_RECENT; + if (HAS_ALL_BITS(items->flags, IMAP_STATUS_ITEM_DELETED)) + status |= STATUS_DELETED; if (HAS_ALL_BITS(items->flags, IMAP_STATUS_ITEM_UIDNEXT)) status |= STATUS_UIDNEXT; if (HAS_ALL_BITS(items->flags, IMAP_STATUS_ITEM_UIDVALIDITY)) @@ -143,6 +147,8 @@ int imap_status_send(struct client *client, const char *mailbox_mutf7, if ((client_enabled_mailbox_features(client) & MAILBOX_FEATURE_IMAP4REV2) == 0 && HAS_ALL_BITS(items->flags, IMAP_STATUS_ITEM_RECENT)) str_printfa(str, "RECENT %u ", status->recent); + if (HAS_ALL_BITS(items->flags, IMAP_STATUS_ITEM_DELETED)) + str_printfa(str, "DELETED %u ", status->deleted); if (HAS_ALL_BITS(items->flags, IMAP_STATUS_ITEM_UIDNEXT)) str_printfa(str, "UIDNEXT %u ", status->uidnext); if (HAS_ALL_BITS(items->flags, IMAP_STATUS_ITEM_UIDVALIDITY)) diff --git a/src/imap/imap-status.h b/src/imap/imap-status.h index 58bd58179f..844c2b7aa7 100644 --- a/src/imap/imap-status.h +++ b/src/imap/imap-status.h @@ -9,6 +9,7 @@ enum imap_status_item_flags { IMAP_STATUS_ITEM_UNSEEN = BIT(4), IMAP_STATUS_ITEM_HIGHESTMODSEQ = BIT(5), IMAP_STATUS_ITEM_SIZE = BIT(6), + IMAP_STATUS_ITEM_DELETED = BIT(7), IMAP_STATUS_ITEM_X_SIZE = BIT(16), /* to be deprecated */ IMAP_STATUS_ITEM_X_GUID = BIT(17),