main.c revision 812883e7758a86f615b9508ef10df1339123da83
/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "str.h"
#include "base64.h"
#include "restrict-access.h"
#include "fd-close-on-exec.h"
#include "process-title.h"
#include "master-service.h"
#include "mail-user.h"
#include "mail-storage-service.h"
#include "commands.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define IS_STANDALONE() \
struct client_workaround_list {
const char *name;
enum client_workarounds num;
};
static struct client_workaround_list client_workaround_list[] = {
{ "delay-newmail", WORKAROUND_DELAY_NEWMAIL },
{ "outlook-idle", 0 }, /* only for backwards compatibility */
{ "netscape-eoh", WORKAROUND_NETSCAPE_EOH },
{ "tb-extra-mailbox-sep", WORKAROUND_TB_EXTRA_MAILBOX_SEP },
{ NULL, 0 }
};
struct master_service *service;
{
/* the log fd is closed, don't die when trying to log later */
}
static enum client_workarounds
{
enum client_workarounds client_workarounds = 0;
struct client_workaround_list *list;
const char *const *str;
break;
}
}
}
return client_workarounds;
}
bool dump_capability)
{
/* If master dies, the log fd gets closed and we'll quit */
}
clients_init();
if (dump_capability) {
exit(0);
}
/* IMAPLOGINTAG environment is compatible with mailfront */
"* PREAUTH [CAPABILITY ",
} else {
tag, " OK [CAPABILITY ",
}
i_panic("Couldn't add client input to stream");
(void)client_handle_input(client);
}
} T_END;
}
static void main_deinit(void)
{
}
{
const struct setting_parser_info *set_roots[] = {
};
enum master_service_flags service_flags = 0;
const struct imap_settings *set;
const char *user;
bool dump_capability;
int c;
#ifdef DEBUG
#endif
if (IS_STANDALONE() && getuid() == 0 &&
printf("* BAD [ALERT] imap binary must not be started from "
"inetd, use imap-login instead.\n");
return 1;
}
if (IS_STANDALONE())
else
if (dump_capability) {
}
i_fatal("Unknown argument: %c", c);
}
if (IS_STANDALONE())
i_fatal("USER environment missing");
}
/* fake that we're running, so we know if client was destroyed
while initializing */
main_deinit();
return 0;
}