DLLIST_PREPEND(&clients, client);
clients_count++;
- smtp_server_connection_start(client->conn);
i_info("Connect from %s", client_remote_id(client));
+
+ if (hook_client_created != NULL)
+ hook_client_created(&client);
+
+ smtp_server_connection_start(client->conn);
+
refresh_proctitle();
return client;
}
#include "client.h"
#include "lmtp-settings.h"
+typedef void lmtp_client_created_func_t(struct client **client);
+
+extern lmtp_client_created_func_t *hook_client_created;
+
extern char *dns_client_socket_path, *base_dir;
extern struct mail_storage_service_ctx *storage_service;
extern struct anvil_client *anvil;
extern struct smtp_server *lmtp_server;
+/* Sets the hook_client_created and returns the previous hook,
+ which the new_hook should call if it's non-NULL. */
+lmtp_client_created_func_t *
+lmtp_client_created_hook_set(lmtp_client_created_func_t *new_hook);
+
void lmtp_anvil_init(void);
#endif
#define IS_STANDALONE() \
(getenv(MASTER_IS_PARENT_ENV) == NULL)
+struct smtp_server *lmtp_server = NULL;
+
char *dns_client_socket_path, *base_dir;
struct mail_storage_service_ctx *storage_service;
struct anvil_client *anvil;
-struct smtp_server *lmtp_server;
+lmtp_client_created_func_t *hook_client_created = NULL;
+
+lmtp_client_created_func_t *
+lmtp_client_created_hook_set(lmtp_client_created_func_t *new_hook)
+{
+ lmtp_client_created_func_t *old_hook = hook_client_created;
+
+ hook_client_created = new_hook;
+ return old_hook;
+}
void lmtp_anvil_init(void)
{