diff --git a/src/imap-urlauth/imap-urlauth-client.c b/src/imap-urlauth/imap-urlauth-client.c index 513b35c4bb..e46ca69c2b 100644 --- a/src/imap-urlauth/imap-urlauth-client.c +++ b/src/imap-urlauth/imap-urlauth-client.c @@ -38,6 +38,10 @@ #define IS_STANDALONE() \ (getenv(MASTER_IS_PARENT_ENV) == NULL) +struct event_category event_category_urlauth = { + .name = "imap-urlauth", +}; + struct client *imap_urlauth_clients; unsigned int imap_urlauth_client_count; @@ -62,6 +66,11 @@ int client_create(const char *service, const char *username, client->fd_ctrl = -1; client->set = set; + client->event = event_create(NULL); + if (set->mail_debug) + event_set_forced_debug(client->event, TRUE); + event_add_category(client->event, &event_category_urlauth); + if (client_worker_connect(client) < 0) { i_free(client); return -1; @@ -340,6 +349,8 @@ void client_destroy(struct client *client, const char *reason) fd_close_maybe_stdio(&client->fd_in, &client->fd_out); + event_unref(&client->event); + i_free(client->username); i_free(client->service); array_free(&client->access_apps); diff --git a/src/imap-urlauth/imap-urlauth-client.h b/src/imap-urlauth/imap-urlauth-client.h index 408c3bc90f..ada8407c74 100644 --- a/src/imap-urlauth/imap-urlauth-client.h +++ b/src/imap-urlauth/imap-urlauth-client.h @@ -18,6 +18,7 @@ struct client { struct ostream *output, *ctrl_output; struct istream *ctrl_input; struct timeout *to_idle; + struct event *event; char *username, *service; ARRAY_TYPE(const_string) access_apps;