From: Stephan Bosch Date: Mon, 13 Dec 2021 11:54:19 +0000 (+0100) Subject: lmtp: lmtp-proxy - Add session ID to backend connection error replies. X-Git-Tag: 2.3.18~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0437877714d1fa33d758b95b04a1ec430761381;p=thirdparty%2Fdovecot%2Fcore.git lmtp: lmtp-proxy - Add session ID to backend connection error replies. --- diff --git a/src/lmtp/lmtp-proxy.c b/src/lmtp/lmtp-proxy.c index 18f8458d77..3be042596d 100644 --- a/src/lmtp/lmtp-proxy.c +++ b/src/lmtp/lmtp-proxy.c @@ -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