/* Copyright (c) 2006-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "hex-binary.h"
#include "mail-index.h"
#include "mail-namespace.h"
#include "mail-storage-private.h"
#include "mailbox-list-iter.h"
#include "mail-search.h"
#include "fts-api-private.h"
{
if (!array_is_created(&backends))
}
{
unsigned int i, count;
for (i = 0; i < count; i++) {
break;
}
}
if (i == count)
if (count == 1)
}
static const struct fts_backend *
{
unsigned int i, count;
if (array_is_created(&backends)) {
for (i = 0; i < count; i++) {
return be[i];
}
}
return NULL;
}
{
*error_r = "Unknown backend";
return -1;
}
return -1;
}
return 0;
}
{
}
{
/* virtual mailboxes themselves don't have any indexes,
so catch this call here */
*last_uid_r = 0;
else
return 0;
}
}
{
}
struct fts_backend_update_context *
{
return ctx;
}
{
}
}
{
int ret;
return ret;
}
{
/* make sure we don't reference the backend box anymore */
}
}
{
}
const struct fts_backend_build_key *key)
{
return FALSE;
return TRUE;
}
{
if (ctx->build_key_open) {
}
}
{
}
{
}
{
int ret = 0;
(MAILBOX_NONEXISTENT | MAILBOX_NOSELECT)) != 0)
continue;
if (mailbox_open(box) == 0) {
if (fts_index_set_last_uid(box, 0) < 0)
ret = -1;
}
mailbox_free(&box);
}
if (mailbox_list_iter_deinit(&iter) < 0)
ret = -1;
return ret;
}
{
bool virtual_storage;
mailbox_free(&box);
if (virtual_storage) {
/* just reset the last-uids for a virtual storage. */
return fts_backend_reset_last_uids(backend);
}
}
{
}
static void
{
unsigned int i, count;
and no lists have none */
/* create unwanted sequences list from both sources */
/* drop unwanted uids */
/* add uids that are in dest_definite and src_maybe lists */
for (i = 0; i < count; i++) {
}
}
}
{
T_BEGIN {
} T_END;
/* keep only what exists in both lists. the rest is in
maybies or not wanted */
}
const struct mail_search_arg *args)
{
case SEARCH_OR:
case SEARCH_SUB:
case SEARCH_INTHREAD:
return TRUE;
break;
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
case SEARCH_BODY:
case SEARCH_TEXT:
return TRUE;
break;
default:
break;
}
}
return FALSE;
}
const struct mail_search_arg *args)
{
}
const struct fts_score_map *m2)
{
return -1;
return 1;
return 0;
}
struct mail_search_arg *args,
enum fts_lookup_flags flags,
struct fts_result *result)
{
return -1;
}
return 0;
}
struct mail_search_arg *args,
enum fts_lookup_flags flags,
struct fts_multi_result *result)
{
unsigned int i;
return -1;
struct fts_result, 1);
}
return 0;
}
flags, box_result) < 0)
return -1;
}
return 0;
}
{
}
{
sizeof(struct fts_index_header),
0, 0);
}
{
const void *data;
bool ret;
} else {
}
return ret;
}
const struct fts_index_header *hdr)
{
return mail_index_transaction_commit(&trans);
}
{
}
{
const char *vname;
int ret;
vname = "INBOX";
else {
len--;
}
ret = -1;
} else {
}
mailbox_free(&box);
return ret;
}
static const char *indexed_headers[] = {
"From", "To", "Cc", "Bcc", "Subject"
};
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(indexed_headers); i++) {
return TRUE;
}
return FALSE;
}
{
/* FIXME: should email address headers be detected as different
languages? That mainly contains people's names.. */
/*if (message_header_is_address(hdr_name))
return TRUE;*/
/* Subject definitely contains language-specific data that can be
detected. Comment and Keywords headers also could contain, although
just about nobody uses those headers.
For now we assume that other headers contain non-language specific
data that we don't want to filter in special ways. For example
it is good to be able to search for Message-IDs. */
}
{
return -1;
return 0;
}