]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: Implement client vfuncs for transaction start and free.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 16 Sep 2018 19:47:10 +0000 (21:47 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Feb 2019 13:40:54 +0000 (15:40 +0200)
src/submission/submission-client.c
src/submission/submission-client.h

index 474f74223d97ed8894954c58751dda41d1e2f77a..92d10770a235563727c6661e429f43eea1cbfe01 100644 (file)
@@ -330,6 +330,13 @@ client_connection_trans_start(void *context,
        client->state.pool =
                pool_alloconly_create("submission client state", 1024);
 
+       client->v.trans_start(client, trans);
+}
+
+static void
+client_default_trans_start(struct client *client,
+                          struct smtp_server_transaction *trans)
+{
        submission_backends_trans_start(client, trans);
 }
 
@@ -338,6 +345,14 @@ client_connection_trans_free(void *context,
                             struct smtp_server_transaction *trans)
 {
        struct client *client = context;
+
+       client->v.trans_free(client, trans);
+}
+
+static void
+client_default_trans_free(struct client *client,
+                         struct smtp_server_transaction *trans)
+{
        struct submission_recipient **rcptp;
 
        array_foreach_modifiable(&client->rcpt_to, rcptp)
@@ -521,6 +536,9 @@ static const struct smtp_server_callbacks smtp_callbacks = {
 static const struct submission_client_vfuncs submission_client_vfuncs = {
        client_default_destroy,
 
+       .trans_start = client_default_trans_start,
+       .trans_free = client_default_trans_free,
+
        .cmd_helo = client_default_cmd_helo,
 
        .cmd_mail = client_default_cmd_mail,
index 8329d4700b73d70ff813f9e20385f740f9fced52..64e6cc730b4f00eab9aaca1f70c3981679b3ff8a 100644 (file)
@@ -21,6 +21,11 @@ struct submission_client_vfuncs {
        void (*destroy)(struct client *client, const char *prefix,
                        const char *reason);
 
+       void (*trans_start)(struct client *client,
+                           struct smtp_server_transaction *trans);
+       void (*trans_free)(struct client *client,
+                          struct smtp_server_transaction *trans);
+
        int (*cmd_helo)(struct client *client, struct smtp_server_cmd_ctx *cmd,
                        struct smtp_server_cmd_helo *data);