main.c revision 376a41ab9e1b035737653fa6813c8c9e674caf20
/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
#include "imap-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 "master-interface.h"
#include "master-service.h"
#include "master-login.h"
#include "mail-user.h"
#include "mail-storage-service.h"
#include "imap-commands.h"
#include "imap-fetch.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define IS_STANDALONE() \
static struct mail_storage_service_ctx *storage_service;
{
const char *tag;
unsigned int data_pos;
bool send_untagged_capability = FALSE;
switch (*tag) {
case '0':
tag++;
break;
case '1':
tag++;
break;
}
i_panic("Couldn't add client input to stream");
} else {
/* IMAPLOGINTAG environment is compatible with mailfront */
}
"* PREAUTH [CAPABILITY ",
} else if (send_untagged_capability) {
/* client doesn't seem to understand tagged capabilities. send
untagged instead and hope that it works. */
} else {
tag, " OK [CAPABILITY ",
}
(void)client_handle_input(client);
}
static int
const char **error_r)
{
struct mail_storage_service_user *user;
const struct imap_settings *set;
return -1;
if (set->shutdown_clients)
T_BEGIN {
} T_END;
return 0;
}
static void main_stdio_run(void)
{
struct mail_storage_service_input input;
i_fatal("USER environment missing");
}
static void
const char *username, const char *const *extra_fields)
{
struct mail_storage_service_input input;
const char *error;
i_error("login client: Username missing from auth reply");
return;
}
}
}
{
if (master_login == NULL) {
/* running standalone, we shouldn't even get here */
} else {
}
}
{
static const struct setting_parser_info *set_roots[] = {
};
enum master_service_flags service_flags = 0;
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 (master_getopt(master_service) > 0)
return FATAL_DEFAULT;
/* plugins may want to add commands, so this needs to be called early */
/* fake that we're running, so we know if client was destroyed
while handling its initial input */
if (IS_STANDALONE()) {
T_BEGIN {
} T_END;
} else {
}
if (master_login != NULL)
return 0;
}