]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: client_destroy() - Decouple reply reason from log reason
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 21 Feb 2024 21:23:26 +0000 (23:23 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Sun, 25 Feb 2024 17:28:04 +0000 (17:28 +0000)
src/submission/submission-backend.c
src/submission/submission-client.c
src/submission/submission-client.h

index 11edf3ef80e74c1fa1ee711d4321c7a8be8904b9..b9a22203d881eac68f5a0b2212d4c790123eb046 100644 (file)
@@ -139,7 +139,7 @@ void submission_backend_fail(struct submission_backend *backend,
 
        if (backend == client->backend_default) {
                /* default backend: fail the whole client */
-               client_destroy(&client, enh_code, reason);
+               client_destroy(&client, enh_code, reason, reason);
                return;
        }
 
index d3c7891e41c9720d0a9e22d2d74163824b69dad6..9d4461507be2e077cddfc368d1eef9f640de2a14 100644 (file)
@@ -289,15 +289,16 @@ static void client_state_reset(struct client *client)
 }
 
 void client_destroy(struct client **_client, const char *prefix,
-                   const char *reason)
+                   const char *reply_reason, const char *log_reason)
 {
        struct client *client = *_client;
        struct smtp_server_connection *conn = client->conn;
 
        *_client = NULL;
 
-       smtp_server_connection_terminate(
-               &conn, (prefix == NULL ? "4.0.0" : prefix), reason);
+       smtp_server_connection_terminate_full(
+               &conn, (prefix == NULL ? "4.0.0" : prefix),
+               reply_reason, log_reason);
 }
 
 static void
@@ -509,7 +510,8 @@ void client_add_extra_capability(struct client *client, const char *capability,
 void client_kick(struct client *client)
 {
        mail_storage_service_io_activate_user(client->user->service_user);
-       client_destroy(&client, "4.3.2", MASTER_SERVICE_SHUTTING_DOWN_MSG);
+       client_destroy(&client, "4.3.2", MASTER_SERVICE_SHUTTING_DOWN_MSG,
+                      MASTER_SERVICE_SHUTTING_DOWN_MSG);
 }
 
 void clients_destroy_all(void)
index a4f4ff5fb011ba26b1d2f47eb86c3a8659c08edc..abaf301f7c3b1d021f12e14e2c7a36ddde7dda43 100644 (file)
@@ -138,8 +138,8 @@ client_create(int fd_in, int fd_out, struct event *event,
              const struct smtp_proxy_data *proxy_data,
              const unsigned char *pdata, unsigned int pdata_len,
              bool no_greeting);
-void client_destroy(struct client **client, const char *prefix,
-                   const char *reason) ATTR_NULL(2, 3);
+void client_destroy(struct client **_client, const char *prefix,
+                   const char *reply_reason, const char *log_reason);
 void client_kick(struct client *client);
 
 typedef void (*client_input_callback_t)(struct client *context);