]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: lmtp-proxy - Add session ID to backend connection error replies.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 13 Dec 2021 11:54:19 +0000 (12:54 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 10 Jan 2022 06:31:48 +0000 (06:31 +0000)
src/lmtp/lmtp-proxy.c

index 18f8458d7717d091f05b523fc582968dc719c0f6..3be042596dfe7a68034c65bfe81d948feee80ba9 100644 (file)
@@ -306,8 +306,9 @@ lmtp_proxy_handle_connection_error(struct lmtp_proxy_recipient *lprcpt,
 
        if (client->lmtp_set->lmtp_verbose_replies) {
                smtp_server_command_fail(rcpt->cmd->cmd, 451, "4.4.0",
-                                        "Proxy failed: %s",
-                                        smtp_reply_log(reply));
+                                        "Proxy failed: %s (session=%s)",
+                                        smtp_reply_log(reply),
+                                        lrcpt->session_id);
                return;
        }
 
@@ -315,28 +316,29 @@ lmtp_proxy_handle_connection_error(struct lmtp_proxy_recipient *lprcpt,
        case SMTP_CLIENT_COMMAND_ERROR_ABORTED:
                break;
        case SMTP_CLIENT_COMMAND_ERROR_HOST_LOOKUP_FAILED:
-               detail = " (DNS lookup)";
+               detail = "DNS lookup, ";
                break;
        case SMTP_CLIENT_COMMAND_ERROR_CONNECT_FAILED:
        case SMTP_CLIENT_COMMAND_ERROR_AUTH_FAILED:
-               detail = " (connect)";
+               detail = "connect, ";
                break;
        case SMTP_CLIENT_COMMAND_ERROR_CONNECTION_LOST:
        case SMTP_CLIENT_COMMAND_ERROR_CONNECTION_CLOSED:
-               detail = " (connection lost)";
+               detail = "connection lost, ";
                break;
        case SMTP_CLIENT_COMMAND_ERROR_BAD_REPLY:
-               detail = " (bad reply)";
+               detail = "bad reply, ";
                break;
        case SMTP_CLIENT_COMMAND_ERROR_TIMED_OUT:
-               detail = " (timed out)";
+               detail = "timed out, ";
                break;
        default:
                break;
        }
 
        smtp_server_command_fail(rcpt->cmd->cmd, 451, "4.4.0",
-                                "Proxy failed%s", detail);
+                                "Proxy failed (%ssession=%s)",
+                                detail, lrcpt->session_id);
 }
 
 static bool