/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "seq-range-array.h"
#include "str.h"
#include "imap-commands.h"
#include "imap-search-args.h"
#include "imap-util.h"
struct imap_store_context {
bool silent;
};
static bool
{
if (*type == '+') {
type++;
} else if (*type == '-') {
type++;
} else {
}
return FALSE;
return FALSE;
return TRUE;
}
static bool
{
"Invalid STORE modifiers.");
return FALSE;
}
"STORE UNCHANGEDSINCE can't be used with non-permanent modseqs");
return FALSE;
}
"Invalid modseq");
return FALSE;
}
} else {
"Unknown STORE modifier");
return FALSE;
}
}
return TRUE;
}
static bool
{
const char *type;
return FALSE;
args++;
}
return FALSE;
}
args++;
return FALSE;
} else {
return FALSE;
}
/* invalid keywords */
return FALSE;
}
}
return TRUE;
}
{
struct mailbox_transaction_context *t;
enum mailbox_transaction_flags flags = 0;
int ret;
bool update_deletes;
unsigned int deleted_count;
return FALSE;
if (!client_verify_open_mailbox(cmd))
return TRUE;
return TRUE;
}
if (ret <= 0)
return ret < 0;
return TRUE;
}
if (client->mailbox_examined) {
reply = "NO CONDSTORE failed: Mailbox is read-only.";
else
reply = "OK Store ignored with read-only mailbox.";
0, reply);
}
/* update modseqs so we can check them early */
}
/* STORE UNCHANGEDSINCE is being used */
&modified_set);
}
deleted_count = 0;
/* check early so there's less work for transaction
commit if something has to be cancelled */
continue;
}
}
if (update_deletes) {
}
}
}
if (ret < 0)
else
ret = mailbox_transaction_commit(&t);
if (ret < 0) {
return TRUE;
}
if (array_count(&modified_set) == 0)
tagged_reply = "OK Store completed.";
else {
&uids);
modified_set = uids;
}
}
/* With UID STORE we have to return UID for the flags as well.
Unfortunately we don't have the ability to separate those
flag changes that were caused by UID STORE and those that
came externally, so we'll just send the UID for all flag
changes that we see. */
MAILBOX_FEATURE_CONDSTORE) != 0))
}