]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: proxy: Do not forward 421 reply (server shutdown) from backend.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 23 Feb 2018 20:09:42 +0000 (21:09 +0100)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 12 Mar 2018 08:59:11 +0000 (10:59 +0200)
This closes the LMTP connection implicitly. Instead, translate it into a 451
4.4.0 response, just like all the other connection-related failures.

src/lmtp/lmtp-proxy.c

index 2d0c774b1e83166091fd676479e912bc0cb3b3ef..d7a23becbe9b35ca488a066c556a2e9d7c3174da 100644 (file)
@@ -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: