]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: Move relay part of NOOP command to submission-backend-relay.c.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 15 Jul 2018 17:06:34 +0000 (19:06 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 9 Oct 2018 06:41:17 +0000 (06:41 +0000)
src/submission/Makefile.am
src/submission/cmd-noop.c [deleted file]
src/submission/submission-backend-relay.c
src/submission/submission-backend-relay.h
src/submission/submission-commands.h

index b531a62c96bc9a06df70d3a772f93e7ae092d90d..3121552b8de1c80cba25dff5ccd8e8c64af7643c 100644 (file)
@@ -34,7 +34,6 @@ submission_DEPENDENCIES = \
        $(LIBDOVECOT_DEPS)
 
 cmds = \
-       cmd-noop.c \
        cmd-quit.c
 
 submission_SOURCES = \
diff --git a/src/submission/cmd-noop.c b/src/submission/cmd-noop.c
deleted file mode 100644 (file)
index 393d5e9..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
-
-#include "submission-common.h"
-#include "smtp-client.h"
-#include "smtp-client-connection.h"
-
-#include "submission-commands.h"
-
-/*
- * NOOP command
- */
-
-struct cmd_noop_context {
-       struct client *client;
-       struct smtp_server_cmd_ctx *cmd;
-       struct smtp_client_command *cmd_proxied;
-};
-
-static void cmd_noop_proxy_cb(const struct smtp_reply *proxy_reply,
-                             struct cmd_noop_context *noop_cmd)
-{
-       struct smtp_server_cmd_ctx *cmd = noop_cmd->cmd;
-       struct client *client = noop_cmd->client;
-       struct smtp_reply reply;
-
-       if (!client_command_handle_proxy_reply(client, proxy_reply, &reply))
-               return;
-
-       if ((proxy_reply->status / 100) == 2) {
-               smtp_server_reply(cmd, 250, "2.0.0", "OK");
-       } else {
-               smtp_server_reply_forward(cmd, &reply);
-       }
-}
-
-int cmd_noop_relay(struct client *client, struct smtp_server_cmd_ctx *cmd)
-{
-       struct cmd_noop_context *noop_cmd;
-
-       noop_cmd = p_new(cmd->pool, struct cmd_noop_context, 1);
-       noop_cmd->client = client;
-       noop_cmd->cmd = cmd;
-
-       noop_cmd->cmd_proxied = smtp_client_command_noop_submit
-               (client->proxy_conn, 0, cmd_noop_proxy_cb, noop_cmd);
-       return 0;
-}
index 960e6b579d0782b02d86cf9d2d32d65329e0fe95..88b7e9a0f29f34e26278407c5a7d902f6d20e501 100644 (file)
@@ -537,3 +537,42 @@ int cmd_vrfy_relay(struct client *client, struct smtp_server_cmd_ctx *cmd,
        return 0;
 }
 
+/*
+ * NOOP command
+ */
+
+struct cmd_noop_context {
+       struct client *client;
+       struct smtp_server_cmd_ctx *cmd;
+       struct smtp_client_command *cmd_proxied;
+};
+
+static void cmd_noop_proxy_cb(const struct smtp_reply *proxy_reply,
+                             struct cmd_noop_context *noop_cmd)
+{
+       struct smtp_server_cmd_ctx *cmd = noop_cmd->cmd;
+       struct client *client = noop_cmd->client;
+       struct smtp_reply reply;
+
+       if (!client_command_handle_proxy_reply(client, proxy_reply, &reply))
+               return;
+
+       if ((proxy_reply->status / 100) == 2) {
+               smtp_server_reply(cmd, 250, "2.0.0", "OK");
+       } else {
+               smtp_server_reply_forward(cmd, &reply);
+       }
+}
+
+int cmd_noop_relay(struct client *client, struct smtp_server_cmd_ctx *cmd)
+{
+       struct cmd_noop_context *noop_cmd;
+
+       noop_cmd = p_new(cmd->pool, struct cmd_noop_context, 1);
+       noop_cmd->client = client;
+       noop_cmd->cmd = cmd;
+
+       noop_cmd->cmd_proxied = smtp_client_command_noop_submit
+               (client->proxy_conn, 0, cmd_noop_proxy_cb, noop_cmd);
+       return 0;
+}
index f7f1f8c22877c462c9d4fac3fcafa00fa644c001..9f2cc258a36e4e93170ca0465adc176c08d6f5ed 100644 (file)
@@ -13,5 +13,6 @@ int cmd_data_relay(struct client *client, struct smtp_server_cmd_ctx *cmd,
                   struct istream *data_input);
 int cmd_vrfy_relay(struct client *client, struct smtp_server_cmd_ctx *cmd,
                   const char *param);
+int cmd_noop_relay(struct client *client, struct smtp_server_cmd_ctx *cmd);
 
 #endif
index 3945d0b1d2640cc17dbc1d77b6d16d87da047c50..4d3e99041510e659b7b79070b2aba8d4b78df812 100644 (file)
@@ -4,7 +4,6 @@
 bool client_command_handle_proxy_reply(struct client *client,
        const struct smtp_reply *reply, struct smtp_reply *reply_r);
 
-int cmd_noop_relay(struct client *client, struct smtp_server_cmd_ctx *cmd);
 int cmd_quit_relay(struct client *client, struct smtp_server_cmd_ctx *cmd);
 
 void submission_helo_reply_submit(struct smtp_server_cmd_ctx *cmd,