From: Timo Sirainen Date: Wed, 7 Aug 2019 12:46:39 +0000 (+0300) Subject: imap: GETMETADATA: Ignore MAIL_ERROR_NOTPOSSIBLE errors when using DEPTH parameter X-Git-Tag: 2.3.9~334 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=119307bc05987f88d500458e90b92e0a131bc36b;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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;