cmd-fetch.c revision 24107b28ccf1750b56b401559b34e507db83da80
/* Copyright (c) 2002-2012 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"
#include <stdlib.h>
static const char *all_macro[] = {
};
static const char *fast_macro[] = {
};
static const char *full_macro[] = {
};
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,
{
const char *str;
"Invalid CHANGEDSINCE modseq.");
return FALSE;
}
*args += 1;
return TRUE;
}
MAILBOX_FEATURE_QRESYNC) == 0) {
return FALSE;
}
return TRUE;
}
return FALSE;
}
static bool
struct client_command_context *cmd,
{
const char *name;
while (!IMAP_ARG_IS_EOL(args)) {
"FETCH modifiers contain non-atoms.");
return FALSE;
}
args++;
return FALSE;
}
if (ctx->send_vanished &&
"VANISHED used without CHANGEDSINCE");
return FALSE;
}
return TRUE;
}
struct client_command_context *cmd)
{
static const char *ok_message = "OK Fetch completed.";
const char *tagged_reply = ok_message;
if (ctx->skipped_expunged_msgs) {
"Some messages were already expunged.";
}
if (imap_fetch_deinit(ctx) < 0)
const char *errstr;
return TRUE;
}
/* We never want to reply NO to FETCH requests,
BYE is preferrable (see imap-ml for reasons). */
return TRUE;
}
}
{
/* unfinished */
return FALSE;
}
}
{
struct imap_fetch_context *ctx;
struct mail_search_args *search_args;
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;
return TRUE;
}
return TRUE;
}
if (imap_fetch_begin(ctx) == 0) {
/* unfinished */
return FALSE;
}
}
}