main.c revision 4f7987384f306ea93b0258623a4cdd69601f2d0e
/* 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 "process-title.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() \
#define IMAP_DIE_IDLE_SECS 10
static bool verbose_proctitle = FALSE;
static struct mail_storage_service_ctx *storage_service;
void imap_refresh_proctitle(void)
{
#define IMAP_PROCTITLE_PREFERRED_LEN 80
struct client_command_context *cmd;
if (!verbose_proctitle)
return;
switch (imap_client_count) {
case 0:
break;
case 1:
}
continue;
break;
}
break;
default:
break;
}
}
{
return;
}
static void imap_die(void)
{
unsigned int stop_msecs;
if (last_io <= stop_timestamp)
else {
}
}
}
{
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->verbose_proctitle)
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;
}