Internally those replies just mess up things.
/* non-extended LIST - return children flags always */
ctx->list_flags |= MAILBOX_LIST_ITER_RETURN_CHILDREN;
}
+ ctx->list_flags |= MAILBOX_LIST_ITER_SHOW_EXISTING_PARENT;
if (!IMAP_ARG_IS_EOL(args)) {
client_send_command_error(cmd, "Extra arguments.");
delayed_send = TRUE;
}
+ if ((ctx->ctx.flags & MAILBOX_LIST_ITER_SHOW_EXISTING_PARENT) == 0) {
+ /* LIST "" foo/% - we don't want to see foo/ returned */
+ delayed_send = FALSE;
+ match2 = IMAP_MATCH_CHILDREN;
+ }
+
if (scan_subdir) {
real_path = t_strconcat(ctx->dir->real_path, "/", fname, NULL);
ret = list_opendir(ctx, real_path, vpath, &dirp);
enum mailbox_list_iter_flags {
/* Ignore index file and ACLs (used by ACL plugin internally) */
MAILBOX_LIST_ITER_RAW_LIST = 0x000001,
+ /* When listing "foo/%" and "foo" is an existing mailbox
+ (maybe \noselect), have LIST also return "foo/" in the replies.
+ This is needed by IMAP, but messes up internal code. */
+ MAILBOX_LIST_ITER_SHOW_EXISTING_PARENT = 0x000002,
/* Don't list INBOX unless it actually exists */
MAILBOX_LIST_ITER_NO_AUTO_INBOX = 0x000004,