cmd-subscribe.c revision d450553148026d83f1c672d15b27c451edd726dc
/* Copyright (c) 2002-2010 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "imap-commands.h"
#include "mail-namespace.h"
const char *name)
{
NAMESPACE_FLAG_LIST_CHILDREN)) == 0)
continue;
continue;
/* if prefix has multiple hierarchies, allow subscribing to
any of the hierarchies */
return TRUE;
}
return FALSE;
}
static bool
{
struct mail_namespace *ns;
const char *storage_name;
mailbox)) {
/* subscribing to a listable namespace prefix, allow it. */
return TRUE;
}
/* see if the mailbox exists */
return FALSE;
&name_status) < 0) {
return FALSE;
}
if (name_status == MAILBOX_NAME_NONEXISTENT) {
return FALSE;
}
return TRUE;
}
{
bool unsubscribed_mailbox2;
/* <mailbox> */
return FALSE;
return TRUE;
return TRUE;
}
/* now find a namespace where the subscription can be added to */
&subs_name);
return TRUE;
}
/* subscription is being written to a different namespace
than where the mailbox exists. */
/* drop the common prefix */
}
WORKAROUND_TB_EXTRA_MAILBOX_SEP) != 0 &&
*subs_name != '\0' &&
/* verify the validity without the trailing '/' */
}
if (subscribe) {
return TRUE;
}
/* try to unsubscribe both "box" and "box/" */
FALSE) == 0)
}
} else {
"OK Subscribe completed." :
"OK Unsubscribe completed.");
}
return TRUE;
}
{
}