main.c revision 65497fd5c3efa66319a1486addb272413403653a
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "lib-signals.h"
#include "rawlog.h"
#include "restrict-access.h"
#include "fd-close-on-exec.h"
#include "process-title.h"
#include <stdlib.h>
#include <syslog.h>
#define IS_STANDALONE() \
{
}
static void open_logfile(void)
{
const char *user;
/* 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();
}
static void main_init(void)
{
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 (IS_STANDALONE()) {
} else {
" OK Logged in.", 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();
main_init();
main_deinit();
lib_deinit();
return 0;
}