mail-namespace.c revision 95ff0ac50a3383d1c60e0453ac10c4c8b6af8e82
/* Copyright (C) 2005-2007 Timo Sirainen */
#include "lib.h"
#include "file-lock.h"
#include "mail-storage.h"
#include "mail-namespace.h"
#include <stdlib.h>
{
} else {
}
}
static struct mail_namespace *
enum file_lock_method lock_method)
{
struct mail_namespace *ns;
else {
return NULL;
}
prefix = "";
if ((flags & MAIL_STORAGE_FLAG_DEBUG) != 0) {
i_info("Namespace: type=%s, prefix=%s, sep=%s, "
"inbox=%s, hidden=%s, subscriptions=%s",
}
i_error("Failed to create storage for '%s' with data: %s",
return NULL;
}
return ns;
}
{
unsigned int private_ns_count = 0;
i_error("namespace configuration error: "
"There can be only one namespace with "
"inbox=yes");
return FALSE;
}
}
private_ns = ns;
}
}
if (private_ns_count == 1) {
/* just one private namespace. we'll assume it's
the INBOX namespace. */
} else {
i_error("namespace configuration error: "
"inbox=yes namespace missing");
return FALSE;
}
}
return TRUE;
}
struct mail_namespace **namespaces_r)
{
enum mail_storage_flags flags;
enum file_lock_method lock_method;
unsigned int i;
/* first try NAMESPACE_* environments */
for (i = 1; ; i++) {
t_push();
t_pop();
break;
t_push();
t_pop();
return -1;
}
if (namespaces != NULL) {
if (!namespaces_check(namespaces))
return -1;
return 0;
}
/* fallback to MAIL */
/* support also maildir-specific environment */
}
else {
const char *home;
i_error("MAIL environment missing and "
"autodetection failed (home %s)", home);
}
return -1;
}
*namespaces_r = ns;
return 0;
}
{
struct mail_namespace *ns;
return ns;
}
{
*_namespaces = NULL;
while (namespaces != NULL) {
}
}
{
char *ret, *p;
return name;
for (p = ret; *p != '\0'; p++) {
}
return ret;
}
static struct mail_namespace *
bool show_hidden)
{
bool inbox;
/* find the INBOX namespace */
*mailbox = "INBOX";
return ns;
}
return best;
}
}
}
if (best_len > 0)
}
return best;
}
struct mail_namespace *
{
}
struct mail_namespace *
const char **mailbox)
{
}
const char **mailbox)
{
/* FIXME: a bit kludgy.. */
}
struct mail_namespace *
const char *prefix)
{
struct mail_namespace *ns;
return ns;
}
return NULL;
}