/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "ostream.h"
#include "imap-resp-code.h"
#include "imap-commands.h"
#include "imap-fetch.h"
#include "imap-search-args.h"
#include "mail-search.h"
static const char *all_macro[] = {
};
static const char *fast_macro[] = {
};
static const char *full_macro[] = {
};
static bool
struct client_command_context *cmd,
{
if (!imap_fetch_init_handler(&init_ctx)) {
return FALSE;
}
return TRUE;
}
static bool
struct client_command_context *cmd,
{
return FALSE;
}
arg++;
/* handle macros first */
macro = fast_macro;
macro = full_macro;
else {
return FALSE;
}
return FALSE;
macro++;
}
}
*next_arg_r = arg;
} else {
if (IMAP_ARG_IS_EOL(arg)) {
"FETCH list is empty.");
return FALSE;
}
arg++;
return FALSE;
}
if (!IMAP_ARG_IS_EOL(arg)) {
"FETCH list contains non-atoms.");
return FALSE;
}
}
return TRUE;
}
static bool
struct client_command_context *cmd,
struct mail_search_args *search_args,
bool *send_vanished)
{
const char *str;
"FETCH CHANGEDSINCE can't be used with non-permanent modseqs");
return FALSE;
}
"Invalid CHANGEDSINCE modseq.");
return FALSE;
}
*args += 1;
return TRUE;
}
MAILBOX_FEATURE_QRESYNC) == 0) {
return FALSE;
}
*send_vanished = TRUE;
return TRUE;
}
return FALSE;
}
static bool
struct client_command_context *cmd,
struct mail_search_args *search_args,
{
const char *name;
*send_vanished_r = FALSE;
while (!IMAP_ARG_IS_EOL(args)) {
"FETCH modifiers contain non-atoms.");
return FALSE;
}
args++;
&args, send_vanished_r))
return FALSE;
}
if (*send_vanished_r &&
"VANISHED used without CHANGEDSINCE");
return FALSE;
}
return TRUE;
}
{
return TRUE;
}
{
return FALSE;
&ctx->fetch_failed_uids);
}
{
return;
}
&ctx->fetch_failed_uids);
}
struct client_command_context *cmd)
{
"Some messages were already expunged.";
}
if (imap_fetch_end(ctx) < 0) {
const char *errstr;
/* If we're canceling we need to finish this command
or we'll assert crash. But normally we want to
return FALSE so that the disconnect message logs
about this fetch command and that these latest
output bytes are included in it (which wouldn't
happen if we called client_disconnect() here
directly). */
}
else {
}
if (error == MAIL_ERROR_CONVERSION) {
/* BINARY found unsupported Content-Transfer-Encoding */
} else if (error == MAIL_ERROR_INVALIDDATA) {
/* Content was invalid */
/* By default we never want to reply NO to FETCH
requests, because many IMAP clients become confused
about what they should on NO. A disconnection causes
less confusion. */
return TRUE;
} else {
/* Use a tagged NO to FETCH failure, but only if client
hasn't repeated the FETCH to the same email (so that
we avoid infinitely retries from client.) */
}
}
(seen_flags_changed ? 0 : MAILBOX_SYNC_FLAG_FAST) |
}
{
/* unfinished */
return FALSE;
}
}
{
const char *messageset;
int ret;
return FALSE;
if (!client_verify_open_mailbox(cmd))
return TRUE;
/* <messageset> <field(s)> [(modifiers)] */
return TRUE;
}
/* UID FETCH VANISHED needs the uidset, so convert it to
sequence set later */
if (ret <= 0)
return ret < 0;
&send_vanished))) {
return TRUE;
}
if (send_vanished) {
search_args, &qresync_args) < 0) {
}
}
/* unfinished */
return FALSE;
}
}