From 119307bc05987f88d500458e90b92e0a131bc36b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 7 Aug 2019 15:46:39 +0300 Subject: [PATCH] imap: GETMETADATA: Ignore MAIL_ERROR_NOTPOSSIBLE errors when using DEPTH parameter This most likely means that imap_metadata=no, but the client still wants to fetch recursively validated metadata entries. This should return in OK instead of NO reply. --- src/imap/cmd-getmetadata.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/imap/cmd-getmetadata.c b/src/imap/cmd-getmetadata.c index a6b97468a5..641057c389 100644 --- a/src/imap/cmd-getmetadata.c +++ b/src/imap/cmd-getmetadata.c @@ -175,6 +175,12 @@ cmd_getmetadata_handle_error(struct imap_getmetadata_context *ctx, /* don't treat this as an error */ return FALSE; } + if (error == MAIL_ERROR_NOTPOSSIBLE && ctx->depth > 0) { + /* Using DEPTH to iterate children with imap_metadata=no. + Don't return an error, since some of the entries could be + returned successfully. */ + return FALSE; + } cmd_getmetadata_handle_error_str(ctx, error_string, error); return TRUE; -- 2.47.3