client.c revision b02e7bac5b8b19795884229f64e6fbbd93a0d2de
/* Copyright (c) 2009-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "base64.h"
#include "str.h"
#include "llist.h"
#include "istream.h"
#include "ostream.h"
#include "hostpid.h"
#include "process-title.h"
#include "var-expand.h"
#include "settings-parser.h"
#include "master-service.h"
#include "master-service-ssl.h"
#include "master-service-settings.h"
#include "iostream-ssl.h"
#include "mail-namespace.h"
#include "mail-storage.h"
#include "mail-storage-service.h"
#include "raw-storage.h"
#include "main.h"
#include "lda-settings.h"
#include "lmtp-settings.h"
#include "lmtp-proxy.h"
#include "commands.h"
#include "client.h"
#include <unistd.h>
#define CLIENT_MAX_INPUT_SIZE 4096
unsigned int clients_count = 0;
{
return;
if (clients_count == 0) {
process_title_set("[idling]");
return;
}
if (clients_count > 1) {
return;
}
if (args[0] != '\0')
}
{
"Disconnected client for inactivity");
}
{
args = "";
} else {
args++;
}
return cmd_starttls(client);
return 0;
}
{
case -2:
/* buffer full */
"Disconnected: Input buffer full");
return -1;
case -1:
/* disconnected */
return -1;
case 0:
/* nothing new read */
return 0;
default:
/* something was read */
return 0;
}
}
{
const char *line;
int ret;
T_BEGIN {
} T_END;
if (ret < 0)
break;
}
}
{
if (client_input_read(client) < 0)
return;
}
{
void **sets;
}
{
struct mail_storage_service_input input;
const struct setting_parser_context *set_parser;
struct lmtp_settings *lmtp_set;
struct lda_settings *lda_set;
const char *error;
&set_parser, &error) < 0)
}
{
}
{
const char *addr;
if (addr[0] == '\0')
addr = "local";
return addr;
}
{
}
const struct master_service_connection *conn)
{
/* always use nonblocking I/O */
return client;
}
const char *reason)
{
}
{
const char *err;
return t_strdup_printf("TLS handshaking failed: %s",
err);
}
}
return "Connection closed";
return t_strdup_printf("Connection closed: %s",
}
const char *reason)
{
if (client->disconnected)
return;
else
}
{
struct mail_recipient *const *rcptp;
}
struct mailbox_transaction_context *raw_trans =
}
i_error("close(mail data fd) failed: %m");
}
}
{
T_BEGIN {
} T_END;
}
{
const char *const *net;
unsigned int bits;
return FALSE;
i_error("login_trusted_networks: "
"Invalid network '%s'", *net);
break;
}
return TRUE;
}
return FALSE;
}
void clients_destroy(void)
{
"Shutting down");
}
}