main.c revision 84f80d9231b6ddc80ebfae425fd3674620fdf746
/* Copyright (C) 2002-2003 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "lib-signals.h"
#include "restrict-access.h"
#include "fd-close-on-exec.h"
#include "process-title.h"
#include "randgen.h"
#include "module-dir.h"
#include "mail-storage.h"
#include <stdlib.h>
#include <syslog.h>
#define IS_STANDALONE() \
struct client_workaround_list {
const char *name;
enum client_workarounds num;
};
struct client_workaround_list client_workaround_list[] = {
{ "outlook-no-nuls", WORKAROUND_OUTLOOK_NO_NULS },
{ NULL, 0 }
};
enum client_workarounds client_workarounds = 0;
{
}
static void parse_workarounds(void)
{
struct client_workaround_list *list;
return;
break;
}
}
}
}
static void open_logfile(void)
{
const char *user;
return;
}
/* quite a long user name, cut it */
}
else {
/* log to file or stderr */
}
}
static void drop_privileges(void)
{
/* Log file or syslog opening probably requires roots */
open_logfile();
chrooting. */
random_init();
}
static int main_init(void)
{
struct mail_storage *storage;
const char *mail;
i_fatal("USER environment missing");
clients_init();
/* support also maildir-specific environment */
}
/* failed */
else {
const char *home;
i_fatal("MAIL environment missing and "
"autodetection failed (home %s)", home);
}
}
if (hook_mail_storage_created != NULL)
}
static void main_deinit(void)
{
/* warn about being killed because of some signal, except SIGINT (^C)
which is too common at least while testing :) */
closelog();
}
{
#ifdef DEBUG
#endif
/* NOTE: we start rooted, so keep the code minimal until
restrict_access_by_env() is called */
lib_init();
if (main_init())
main_deinit();
lib_deinit();
return 0;
}