/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "imap-arg.h"
#include "mail-storage-private.h"
static struct mail_keywords *
const char *const keywords[])
{
T_BEGIN {
ARRAY(const char *) valid_keywords;
const char *error;
}
} T_END;
return kw;
}
static bool
const char **error_r)
{
unsigned int i;
return FALSE;
}
return TRUE;
}
struct mail_keywords **keywords_r)
{
return -1;
}
return 0;
}
struct mail_keywords *
const char *const keywords[])
{
const char *error;
else {
/* found invalid keywords, do this the slow way */
}
}
struct mail_keywords *
{
}
{
}
{
}
const char **error_r)
{
unsigned int i, idx;
/* if it already exists, skip validity checks */
return TRUE;
if (*keyword == '\0') {
*error_r = "Empty keywords not allowed";
return FALSE;
}
if (box->disallow_new_keywords) {
*error_r = "Can't create new keywords";
return FALSE;
}
/* these are IMAP-specific restrictions, but for now IMAP is all we
care about */
for (i = 0; keyword[i] != '\0'; i++) {
if (!IS_ATOM_CHAR(keyword[i])) {
if ((unsigned char)keyword[i] < 0x80)
*error_r = "Invalid characters in keyword";
else
*error_r = "8bit characters in keyword";
return FALSE;
}
}
*error_r = "Keyword length too long";
return FALSE;
}
return TRUE;
}