#define CLIENT_IDLE_TIMEOUT_MSECS (1000*60*5)
+static const struct smtp_server_callbacks lmtp_callbacks;
+static const struct lmtp_client_vfuncs lmtp_client_vfuncs;
+
static struct client *clients = NULL;
static unsigned int clients_count = 0;
static bool verbose_proctitle = FALSE;
-static const struct smtp_server_callbacks lmtp_callbacks;
-
static const char *client_remote_id(struct client *client)
{
const char *addr;
pool = pool_alloconly_create("lmtp client", 2048);
client = p_new(pool, struct client, 1);
client->pool = pool;
+ client->v = lmtp_client_vfuncs;
client->remote_ip = conn->remote_ip;
client->remote_port = conn->remote_port;
client->local_ip = conn->local_ip;
void client_destroy(struct client *client, const char *enh_code,
const char *reason)
+{
+ client->v.destroy(client, enh_code, reason);
+}
+
+static void
+client_default_destroy(struct client *client, const char *enh_code,
+ const char *reason)
{
if (client->destroyed)
return;
.conn_is_trusted = client_connection_is_trusted
};
+
+static const struct lmtp_client_vfuncs lmtp_client_vfuncs = {
+ .destroy = client_default_destroy,
+};
#define CLIENT_MAIL_DATA_MAX_INMEMORY_SIZE (1024*128)
+struct client;
+
struct client_state {
const char *name;
unsigned int session_id_seq;
const char *added_headers_proxy;
};
+struct lmtp_client_vfuncs {
+ void (*destroy)(struct client *client, const char *enh_code,
+ const char *reason);
+};
+
struct client {
struct client *prev, *next;
pool_t pool;
+ struct lmtp_client_vfuncs v;
+
const struct setting_parser_info *user_set_info;
const struct lda_settings *unexpanded_lda_set;
const struct lmtp_settings *lmtp_set;