main.c revision 8e10afae513da26698642aa9314b89006eaa4d3a
2ronwalf#include "lib-signals.h"
2ronwalf#include "env-util.h"
2ronwalf#include "fd-close-on-exec.h"
2ronwalf#include "write-full.h"
2ronwalf#include "restrict-process-size.h"
2ronwalf#include "auth-process.h"
2ronwalf#include "capabilities.h"
2ronwalf#include "dict-process.h"
2ronwalf#include "login-process.h"
2ronwalf#include "mail-process.h"
2ronwalf#include "syslog-util.h"
2ronwalf#include "listener.h"
2ronwalf#include "ssl-init.h"
24daenzerorama#include <stdlib.h>
24daenzerorama#include <unistd.h>
const char *env_tz;
#ifdef DEBUG
bool gdb;
int facility;
static void settings_reload(void)
if (!IS_INETD())
return TRUE;
return TRUE;
return FALSE;
return TRUE;
return TRUE;
return FALSE;
static void open_null_fd(void)
static void open_fds(void)
if (!IS_INETD())
const char *pid;
int fd;
if (log_error) {
log_init();
ssl_init();
static void main_deinit(void)
ssl_deinit();
log_deinit();
closelog();
if (pid < 0)
if (pid != 0)
_exit(0);
if (setsid() < 0)
static void print_help(void)
static void print_build_options(void)
#ifdef IOLOOP_EPOLL
#ifdef IOLOOP_KQUEUE
#ifdef IOLOOP_POLL
#ifdef IOLOOP_SELECT
#ifdef IOLOOP_NOTIFY_DNOTIFY
#ifdef IOLOOP_NOTIFY_INOTIFY
#ifdef IOLOOP_NOTIFY_KQUEUE
#ifdef HAVE_IPV6
#ifdef HAVE_GNUTLS
#ifdef HAVE_OPENSSL
#ifdef BUILD_MYSQL
#ifdef BUILD_PGSQL
#ifdef BUILD_SQLITE
#ifdef PASSDB_BSDAUTH
#ifdef PASSDB_CHECKPASSWORD
#ifdef PASSDB_LDAP
#ifdef PASSDB_PAM
#ifdef PASSDB_PASSWD
#ifdef PASSDB_PASSWD_FILE
#ifdef PASSDB_SHADOW
#ifdef PASSDB_SIA
#ifdef PASSDB_SQL
#ifdef PASSDB_VPOPMAIL
#ifdef USERDB_CHECKPASSWORD
#ifdef USERDB_LDAP
#ifdef USERDB_PASSWD
#ifdef USERDB_PREFETCH
#ifdef USERDB_PASSWD_FILE
#ifdef USERDB_SQL
#ifdef USERDB_STATIC
#ifdef USERDB_VPOPMAIL
#ifdef DEBUG
lib_init();
print_help();
open_null_fd();
if (dump_config) {
t_push();
t_pop();
if (dump_config) {
if (ask_key_pass) {
const char *prompt;
t_push();
sizeof(ssl_manual_key_password));
t_pop();
env_clean();
if (!log_error)
open_fds();
if (!foreground)
main_deinit();
lib_deinit();