]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: commands: Expect connection setup errors from relaying commands.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 4 Oct 2018 19:39:58 +0000 (21:39 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 9 Oct 2018 06:41:17 +0000 (06:41 +0000)
Subsequent changes remove the guarantee that the connection is setup successfuly
(to gain EHLO capabilities) before commands are submitted. This means that the
callbacks from commands can thereafter return connection setup errors as well.

src/submission/submission-backend-relay.c

index f9e326f0862b6b647b22710be51650a748d85125..ace0519801d580c705e40f8a83f6940260d26eab 100644 (file)
@@ -43,7 +43,8 @@ backend_relay_handle_relay_reply(struct submission_backend_relay *backend,
        case SMTP_CLIENT_COMMAND_ERROR_HOST_LOOKUP_FAILED:
        case SMTP_CLIENT_COMMAND_ERROR_CONNECT_FAILED:
        case SMTP_CLIENT_COMMAND_ERROR_AUTH_FAILED:
-               i_unreached();
+               client_destroy(client,
+                              "4.4.0", "Failed to connect to relay server");
                return FALSE;
        case SMTP_CLIENT_COMMAND_ERROR_CONNECTION_CLOSED:
        case SMTP_CLIENT_COMMAND_ERROR_CONNECTION_LOST: