void (*input)(struct client *client);
bool (*sasl_filter_mech)(struct client *client,
struct auth_mech_desc *mech);
+ bool (*sasl_check_login)(struct client *client);
void (*auth_send_challenge)(struct client *client, const char *data);
void (*auth_parse_response)(struct client *client);
void (*auth_result)(struct client *client,
anvil_client_query(anvil, query, anvil_lookup_callback, req);
}
+static bool
+sasl_server_check_login(struct client *client)
+{
+ if (client->v.sasl_check_login != NULL &&
+ !client->v.sasl_check_login(client))
+ return FALSE;
+ return TRUE;
+}
+
static void
authenticate_callback(struct auth_client_request *request,
enum auth_request_status status, const char *data_base64,
client->authenticating = FALSE;
call_client_callback(client, SASL_SERVER_REPLY_SUCCESS,
NULL, args);
+ } else if (!sasl_server_check_login(client)) {
+ i_assert(!client->authenticating);
} else {
anvil_check_too_many_connections(client, request);
}