From: Stephan Bosch Date: Fri, 23 Feb 2018 20:09:42 +0000 (+0100) Subject: lmtp: proxy: Do not forward 421 reply (server shutdown) from backend. X-Git-Tag: 2.3.1~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2de719176dfead7776aeeec07b4c0427f72789d;p=thirdparty%2Fdovecot%2Fcore.git lmtp: proxy: Do not forward 421 reply (server shutdown) from backend. This closes the LMTP connection implicitly. Instead, translate it into a 451 4.4.0 response, just like all the other connection-related failures. --- diff --git a/src/lmtp/lmtp-proxy.c b/src/lmtp/lmtp-proxy.c index 2d0c774b1e..d7a23becbe 100644 --- a/src/lmtp/lmtp-proxy.c +++ b/src/lmtp/lmtp-proxy.c @@ -230,7 +230,8 @@ lmtp_proxy_handle_reply(struct smtp_server_cmd_ctx *cmd, { *reply_r = *reply; - if (!smtp_reply_is_remote(reply)) { + if (!smtp_reply_is_remote(reply) || + reply->status == SMTP_CLIENT_COMMAND_ERROR_CONNECTION_CLOSED) { const char *detail = ""; switch (reply->status) { @@ -244,6 +245,7 @@ lmtp_proxy_handle_reply(struct smtp_server_cmd_ctx *cmd, detail = " (connect)"; break; case SMTP_CLIENT_COMMAND_ERROR_CONNECTION_LOST: + case SMTP_CLIENT_COMMAND_ERROR_CONNECTION_CLOSED: detail = " (connection lost)"; break; case SMTP_CLIENT_COMMAND_ERROR_BAD_REPLY: