/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "array.h"
#include "buffer.h"
#include "str.h"
#include "str-sanitize.h"
#include "imap-resp-code.h"
#include "imap-parser.h"
#include "imap-sync.h"
#include "imap-utf7.h"
#include "imap-util.h"
#include "mail-storage.h"
#include "mail-namespace.h"
#include "imap-commands-util.h"
struct mail_namespace *
{
*error_r = "NO Mailbox name is not valid mUTF-7";
return NULL;
}
ns->prefix_len == 0) {
/* this matched only the autocreated prefix="" namespace.
give a nice human-readable error message */
"NO Client tried to access nonexistent namespace. "
"(Mailbox name should probably be prefixed with: %s)",
return NULL;
}
WORKAROUND_TB_EXTRA_MAILBOX_SEP) != 0 &&
/* drop the extra trailing hierarchy separator */
}
return ns;
}
struct mail_namespace *
{
const char *error;
return ns;
}
{
return TRUE;
else {
return FALSE;
}
}
{
mailbox_free(&box);
}
{
const char *error_string;
return -1;
return 0;
}
if (mailbox_open(box) < 0) {
if (error == MAIL_ERROR_NOTFOUND) {
"NO [TRYCREATE] %s", error_string));
} else {
}
mailbox_free(&box);
return -1;
}
mailbox_free(&box);
return -1;
}
}
return 0;
}
{
}
const char *
{
switch (error) {
case MAIL_ERROR_NONE:
break;
case MAIL_ERROR_TEMP:
case MAIL_ERROR_LOOKUP_ABORTED: /* BUG: shouldn't be visible here */
break;
case MAIL_ERROR_UNAVAILABLE:
break;
case MAIL_ERROR_NOTPOSSIBLE:
case MAIL_ERROR_PARAMS:
break;
case MAIL_ERROR_PERM:
break;
case MAIL_ERROR_NOQUOTA:
break;
case MAIL_ERROR_NOTFOUND:
break;
case MAIL_ERROR_EXISTS:
break;
case MAIL_ERROR_EXPUNGED:
break;
case MAIL_ERROR_INUSE:
break;
case MAIL_ERROR_CONVERSION:
case MAIL_ERROR_INVALIDDATA:
break;
case MAIL_ERROR_LIMIT:
break;
}
else
}
struct mailbox_list *list)
{
const char *error_string;
error));
}
{
/* we can't do forced CLOSE, so have to disconnect */
"IMAP session state is inconsistent, please relogin.");
}
}
{
}
struct mail_storage *storage)
{
const char *error_string;
error));
}
struct mail_storage *storage)
{
const char *error_string;
}
enum mail_flags *flags_r,
const char *const **keywords_r)
{
const char *atom;
*flags_r = 0;
*keywords_r = NULL;
while (!IMAP_ARG_IS_EOL(args)) {
"Flags list contains non-atoms.");
return FALSE;
}
if (*atom == '\\') {
/* system flag */
else {
return FALSE;
}
} else {
/* keyword validity checks are done by lib-storage */
}
args++;
}
if (array_count(&keywords) == 0)
*keywords_r = NULL;
else {
}
return TRUE;
}
{
const char *const *keywords;
/* no changes to keywords and we're not selecting a mailbox */
return;
}
&status);
if (!status.permanent_keywords)
str_truncate(str, 0);
if (status.allow_new_keywords) {
}
else
}
{
}
const char *const *
{
const unsigned int *kw_indexes;
const char *const *all_names;
unsigned int all_count;
/* convert indexes to names */
}
}
{
}
{
;
else {
}
}
}
{
else
}