/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "mail-search.h"
#include "mail-namespace.h"
#include "mailbox-list.h"
#include "doveadm-mail.h"
#include "doveadm-mailbox-list-iter.h"
struct doveadm_mailbox_list_iter {
unsigned int pattern_idx;
bool only_selectable;
};
static bool
bool *have_guid, bool *have_wildcards)
{
case SEARCH_OR:
/* we don't currently try to optimize OR. */
break;
case SEARCH_SUB:
case SEARCH_INTHREAD:
return FALSE;
}
break;
case SEARCH_MAILBOX_GLOB:
*have_wildcards = TRUE;
/* fall through */
case SEARCH_MAILBOX:
return FALSE;
}
break;
case SEARCH_MAILBOX_GUID:
break;
default:
break;
}
}
return TRUE;
}
static struct doveadm_mailbox_list_iter *
struct mail_search_args *search_args,
enum mail_namespace_type ns_mask)
{
&have_guid, &have_wildcards);
if (have_guid) {
}
} else if (have_wildcards) {
} else {
/* just return the listed mailboxes without actually
iterating through. this also allows accessing mailboxes
without lookup ACL right */
return iter;
}
return iter;
}
struct doveadm_mailbox_list_iter *
struct mail_search_args *search_args,
{
}
struct doveadm_mailbox_list_iter *
struct mail_search_args *search_args,
{
return iter;
}
{
int ret;
ret = 0;
i_error("Listing mailboxes failed: %s",
}
return ret;
}
const struct mailbox_info *
{
const char *const *patterns;
unsigned int count;
return NULL;
}
MAILBOX_NONEXISTENT)) != 0) {
if (iter->only_selectable)
continue;
}
break;
}
return info;
}