imap-metadata.c revision 02c75e04c6ff80726bb59e3ea34a7995ad1f6f7c
/* Copyright (c) 2013 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "imap-metadata.h"
const char *name)
{
unsigned int i;
bool ok;
if (name[0] != '/') {
"Entry name must begin with '/'");
return FALSE;
}
for (i = 0; name[i] != '\0'; i++) {
switch (name[i]) {
case '/':
"Entry name can't contain consecutive '/'");
return FALSE;
}
"Entry name can't end with '/'");
return FALSE;
}
break;
case '*':
"Entry name can't contain '*'");
return FALSE;
case '%':
"Entry name can't contain '%'");
return FALSE;
default:
if (name[i] <= 0x19) {
"Entry name can't contain control chars");
return FALSE;
}
break;
}
}
T_BEGIN {
} T_END;
if (!ok) {
"Entry name must begin with /private or /shared");
return FALSE;
}
return TRUE;
}
enum mail_attribute_type *type_r,
const char **key_r)
{
strlen(IMAP_METADATA_PRIVATE_PREFIX)) == 0) {
} else {
strlen(IMAP_METADATA_SHARED_PREFIX)) == 0);
}
if ((*key_r)[0] == '\0') {
/* /private or /shared prefix has no value itself */
} else {
*key_r += 1;
}
if (key_prefix != NULL)
}