]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: GETMETADATA: Ignore MAIL_ERROR_NOTPOSSIBLE errors when using DEPTH parameter
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 7 Aug 2019 12:46:39 +0000 (15:46 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 10 Sep 2019 07:02:15 +0000 (10:02 +0300)
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

index a6b97468a5edc80a62bd20c05742921a7cd12e39..641057c389f36582159c885f0a22a4f8101faaa8 100644 (file)
@@ -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;