/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "seq-range-array.h"
#include "time-util.h"
#include "imap-commands.h"
#include "mail-search-build.h"
#include "imap-search-args.h"
#include "imap-seqset.h"
#include "imap-fetch.h"
#include "imap-sync.h"
struct imap_select_context {
};
{
/* change all n:m ranges to n,m and store the results */
for (i = 0; i < uid_count; i++) {
return -1;
if (diff > 0) {
n += diff - 1;
return -1;
}
}
return -1;
return 0;
}
static bool
const char **error_r)
{
const char *str;
*error_r = "Invalid QRESYNC known-sequence-set";
return FALSE;
}
args++;
*error_r = "Invalid QRESYNC known-uid-set";
return FALSE;
}
args++;
*error_r = "Invalid QRESYNC sets";
return FALSE;
}
if (!IMAP_ARG_IS_EOL(args)) {
*error_r = "Too many parameters to QRESYNC known set";
return FALSE;
}
return TRUE;
}
static bool
{
const char *str;
unsigned int count;
MAILBOX_FEATURE_QRESYNC) == 0) {
*error_r = "QRESYNC not enabled";
return FALSE;
}
*error_r = "QRESYNC parameters missing";
return FALSE;
}
*error_r = "Invalid QRESYNC parameters";
return FALSE;
}
args += 2;
*error_r = "Invalid QRESYNC known-uids";
return FALSE;
}
args++;
} else {
}
return FALSE;
args++;
}
if (!IMAP_ARG_IS_EOL(args)) {
*error_r = "Invalid QRESYNC parameters";
return FALSE;
}
return TRUE;
}
static bool
{
const char *name;
while (!IMAP_ARG_IS_EOL(args)) {
*error_r = "SELECT options contain non-atoms.";
return FALSE;
}
args++;
return FALSE;
args++;
} else {
*error_r = "Unknown FETCH modifier";
return FALSE;
}
}
return TRUE;
}
{
}
{
const char *resp_code;
if (ret < 0) {
} else {
"READ-ONLY" : "READ-WRITE";
"OK [%s] %s completed", resp_code,
}
}
{
int ret;
/* unfinished */
return FALSE;
}
if (ret < 0)
return TRUE;
}
{
int ret;
search_args, &qresync_args) < 0) {
return -1;
}
/* unfinished */
return 0;
}
}
static int
{
int ret = 0;
if (readonly)
else
return -1;
}
if (client->enabled_features != 0)
if (ret < 0 ||
return -1;
}
if (status.first_unseen_seq != 0) {
t_strdup_printf("* OK [UNSEEN %u] First unseen.",
}
t_strdup_printf("* OK [UIDVALIDITY %u] UIDs valid",
t_strdup_printf("* OK [UIDNEXT %u] Predicted next UID",
if (status.nonpermanent_modseqs) {
"* OK [NOMODSEQ] No permanent modsequences");
} else if (!status.no_modseq_tracking) {
}
return -1;
}
} else {
ret = 1;
}
return ret;
}
{
return;
/* CLOSED response is required by QRESYNC */
}
{
int ret;
/* <mailbox> [(optional parameters)] */
return FALSE;
return FALSE;
}
/* send * OK [CLOSED] before the tagged reply */
return TRUE;
}
/* send * OK [CLOSED] before the tagged reply */
return TRUE;
}
}
/* Enable while no mailbox is opened to avoid sending
HIGHESTMODSEQ for previously opened mailbox */
}
if (ret == 0)
return FALSE;
return TRUE;
}
{
}