From: Timo Sirainen Date: Fri, 21 Mar 2025 18:38:53 +0000 (+0200) Subject: global: Log errors if anvil query fails X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1877b2a9144e7bb6ad075e453b13e64d858e03fd;p=thirdparty%2Fdovecot%2Fcore.git global: Log errors if anvil query fails --- diff --git a/src/auth/auth-penalty.c b/src/auth/auth-penalty.c index 78b5e0a116..935d1b8142 100644 --- a/src/auth/auth-penalty.c +++ b/src/auth/auth-penalty.c @@ -71,6 +71,8 @@ auth_penalty_anvil_callback(const struct anvil_reply *reply, if (reply->error != NULL) { /* internal failure. */ + e_error(request->auth_request->event, + "Auth penalty lookup failed: %s", reply->error); if (!anvil_client_is_connected(request->client)) { /* we probably didn't have permissions to reconnect back to anvil. need to restart ourself. */ diff --git a/src/doveadm/doveadm-kick.c b/src/doveadm/doveadm-kick.c index ac927f76b5..1ec7ce9de2 100644 --- a/src/doveadm/doveadm-kick.c +++ b/src/doveadm/doveadm-kick.c @@ -32,7 +32,10 @@ kick_user_anvil_callback(const struct anvil_reply *reply, { unsigned int count; - if (reply->error == NULL) { + if (reply->error != NULL) { + e_error(ctx->event, "Failed to send kick to anvil: %s", + reply->error); + } else { if (str_to_uint(reply->reply, &count) < 0) e_error(ctx->event, "Unexpected reply from anvil: %s", reply->reply); diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c index 74904e3ef3..128740961f 100644 --- a/src/lmtp/lmtp-local.c +++ b/src/lmtp/lmtp-local.c @@ -270,7 +270,9 @@ lmtp_local_rcpt_anvil_cb(const struct anvil_reply *reply, llrcpt->anvil_query = NULL; if (reply->error != NULL) { - /* lookup failed */ + e_error(rcpt->event, + "lmtp_user_concurrency_limit lookup failed - skipping: %s", + reply->error); } else if (str_to_uint(reply->reply, ¶llel_count) < 0) { e_error(rcpt->event, "Invalid reply from anvil: %s", reply->reply); diff --git a/src/login-common/sasl-server.c b/src/login-common/sasl-server.c index 9c8cc192fd..08f198752e 100644 --- a/src/login-common/sasl-server.c +++ b/src/login-common/sasl-server.c @@ -250,8 +250,12 @@ anvil_lookup_callback(const struct anvil_reply *reply, client->anvil_request = NULL; conn_count = 0; - if (reply != NULL && reply->error == NULL && - str_to_uint(reply->reply, &conn_count) < 0) + if (reply == NULL) + ; + else if (reply->error != NULL) { + e_error(client->event, "mail_max_userip_connections lookup failed - skipping: %s", + reply->error); + } else if (str_to_uint(reply->reply, &conn_count) < 0) i_fatal("Received invalid reply from anvil: %s", reply->reply); /* reply=NULL if we didn't need to do anvil lookup,