]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Log errors if anvil query fails
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 21 Mar 2025 18:38:53 +0000 (20:38 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 28 Mar 2025 09:55:03 +0000 (09:55 +0000)
src/auth/auth-penalty.c
src/doveadm/doveadm-kick.c
src/lmtp/lmtp-local.c
src/login-common/sasl-server.c

index 78b5e0a1162aaedf0892504bafd66caa4238da14..935d1b8142b62eed2406ce7b4c9867ea0c4d5b45 100644 (file)
@@ -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. */
index ac927f76b5f7d3d759347188d5e27af67261c05b..1ec7ce9de2f58f8a26610c60c73250843d9dcb8a 100644 (file)
@@ -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);
index 74904e3ef32ad3b35f6ee2563bf0b75127fa9ad9..128740961fb30bb45d67c552d0878a2601105542 100644 (file)
@@ -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, &parallel_count) < 0) {
                e_error(rcpt->event, "Invalid reply from anvil: %s",
                        reply->reply);
index 9c8cc192fd5bb007d80d9e9afa862f9f63ba792c..08f198752e9b225673fef48c8cbf840fab6cd568 100644 (file)
@@ -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,