For example "SEARCH KEYWORD ]" was returning all mails instead of nothing.
const unsigned int *keyword_indexes;
unsigned int i, j, count;
+ if (search_kws->count == 0) {
+ /* invalid keyword - never matches */
+ return 0;
+ }
+
t_array_init(&keyword_indexes_arr, 128);
mail_index_lookup_keywords(ctx->view, ctx->mail_ctx.seq,
&keyword_indexes_arr);
/* set by mail_search_args_init(): */
struct {
struct mail_search_args *search_args;
+ /* Note that initialized keywords may be empty if the keyword
+ wasn't valid in this mailbox. */
struct mail_keywords *keywords;
struct imap_match_glob *mailbox_glob;
} initialized;