namespace.c revision ebaf8808cb1e9ab2571ab553793beae1e56e2db4
/* Copyright (C) 2003 Timo Sirainen */
#include "common.h"
#include "commands.h"
#include "namespace.h"
#include <stdlib.h>
static struct namespace *
const char *user)
{
int inbox;
else
prefix = "";
i_fatal("Failed to create storage for '%s' with data: %s",
}
if (hook_mail_storage_created != NULL)
return ns;
}
{
unsigned int i;
/* first try NAMESPACE_* environments */
for (i = 1; ; i++) {
t_push();
t_pop();
break;
t_push();
t_pop();
}
if (namespaces != NULL)
return namespaces;
/* fallback to MAIL */
/* support also maildir-specific environment */
}
else {
const char *home;
i_fatal("MAIL environment missing and "
"autodetection failed (home %s)", home);
}
}
if (hook_mail_storage_created != NULL)
return ns;
}
{
while (namespaces != NULL) {
}
}
struct namespace *
{
int inbox;
/* find the INBOX namespace */
while (namespaces != NULL) {
if (namespaces->inbox)
return namespaces;
best = namespaces;
}
return best;
}
while (namespaces != NULL) {
best = namespaces;
}
}
return best;
}