mail-namespace.c revision c58906589cafc32df4c04ffbef933baadd3f2276
/* 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;
}
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) {
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)
{
}
struct mail_namespace *
const char *prefix)
{
struct mail_namespace *ns;
return ns;
}
return NULL;
}