]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: Move relay part of VRFY command to submission-backend-relay.c.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 9 Sep 2018 23:07:58 +0000 (01:07 +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-vrfy.c [deleted file]
src/submission/submission-backend-relay.c
src/submission/submission-backend-relay.h
src/submission/submission-commands.h

index 920f5c968300e61889c2abd8ee4994263454748f..b531a62c96bc9a06df70d3a772f93e7ae092d90d 100644 (file)
@@ -35,8 +35,7 @@ submission_DEPENDENCIES = \
 
 cmds = \
        cmd-noop.c \
-       cmd-quit.c \
-       cmd-vrfy.c
+       cmd-quit.c
 
 submission_SOURCES = \
        $(cmds) \
diff --git a/src/submission/cmd-vrfy.c b/src/submission/cmd-vrfy.c
deleted file mode 100644 (file)
index e4be183..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
-
-#include "submission-common.h"
-#include "smtp-syntax.h"
-#include "smtp-client.h"
-#include "smtp-client-connection.h"
-
-#include "submission-commands.h"
-
-/*
- * VRFY command
- */
-
-struct cmd_vrfy_context {
-       struct client *client;
-       struct smtp_server_cmd_ctx *cmd;
-       struct smtp_client_command *cmd_proxied;
-};
-
-static void cmd_vrfy_proxy_cb(const struct smtp_reply *proxy_reply,
-                             struct cmd_vrfy_context *vrfy_cmd)
-{
-       struct smtp_server_cmd_ctx *cmd = vrfy_cmd->cmd;
-       struct client *client = vrfy_cmd->client;
-       struct smtp_reply reply;
-
-       if (!client_command_handle_proxy_reply(client, proxy_reply, &reply))
-               return;
-
-       if (!smtp_reply_has_enhanced_code(proxy_reply)) {
-               switch (proxy_reply->status) {
-               case 250:
-               case 251:
-               case 252:
-                       reply.enhanced_code = SMTP_REPLY_ENH_CODE(2, 5, 0);
-                       break;
-               default:
-                       break;
-               }
-       }
-
-       smtp_server_reply_forward(cmd, &reply);
-}
-
-int cmd_vrfy_relay(struct client *client, struct smtp_server_cmd_ctx *cmd,
-                  const char *param)
-{
-       struct cmd_vrfy_context *vrfy_cmd;
-
-       vrfy_cmd = p_new(cmd->pool, struct cmd_vrfy_context, 1);
-       vrfy_cmd->client = client;
-       vrfy_cmd->cmd = cmd;
-
-       vrfy_cmd->cmd_proxied = smtp_client_command_vrfy_submit(
-               client->proxy_conn, 0, param, cmd_vrfy_proxy_cb, vrfy_cmd);
-       return 0;
-}
-
index 9f0c3e6d88d0205abe003de7bffd44d63e845bdc..960e6b579d0782b02d86cf9d2d32d65329e0fe95 100644 (file)
@@ -487,3 +487,53 @@ int cmd_data_relay(struct client *client, struct smtp_server_cmd_ctx *cmd,
                client->proxy_conn, 0, data_input, cmd_data_proxy_cb, data_ctx);
        return 0;
 }
+
+/*
+ * VRFY command
+ */
+
+struct cmd_vrfy_context {
+       struct client *client;
+       struct smtp_server_cmd_ctx *cmd;
+       struct smtp_client_command *cmd_proxied;
+};
+
+static void cmd_vrfy_proxy_cb(const struct smtp_reply *proxy_reply,
+                             struct cmd_vrfy_context *vrfy_cmd)
+{
+       struct smtp_server_cmd_ctx *cmd = vrfy_cmd->cmd;
+       struct client *client = vrfy_cmd->client;
+       struct smtp_reply reply;
+
+       if (!client_command_handle_proxy_reply(client, proxy_reply, &reply))
+               return;
+
+       if (!smtp_reply_has_enhanced_code(proxy_reply)) {
+               switch (proxy_reply->status) {
+               case 250:
+               case 251:
+               case 252:
+                       reply.enhanced_code = SMTP_REPLY_ENH_CODE(2, 5, 0);
+                       break;
+               default:
+                       break;
+               }
+       }
+
+       smtp_server_reply_forward(cmd, &reply);
+}
+
+int cmd_vrfy_relay(struct client *client, struct smtp_server_cmd_ctx *cmd,
+                  const char *param)
+{
+       struct cmd_vrfy_context *vrfy_cmd;
+
+       vrfy_cmd = p_new(cmd->pool, struct cmd_vrfy_context, 1);
+       vrfy_cmd->client = client;
+       vrfy_cmd->cmd = cmd;
+
+       vrfy_cmd->cmd_proxied = smtp_client_command_vrfy_submit(
+               client->proxy_conn, 0, param, cmd_vrfy_proxy_cb, vrfy_cmd);
+       return 0;
+}
+
index 8d0864473b036fc2df8bdc73d16dc9fab81e1834..f7f1f8c22877c462c9d4fac3fcafa00fa644c001 100644 (file)
@@ -11,5 +11,7 @@ int cmd_rset_relay(struct client *client, struct smtp_server_cmd_ctx *cmd);
 int cmd_data_relay(struct client *client, struct smtp_server_cmd_ctx *cmd,
                   struct smtp_server_transaction *trans,
                   struct istream *data_input);
+int cmd_vrfy_relay(struct client *client, struct smtp_server_cmd_ctx *cmd,
+                  const char *param);
 
 #endif
index 285e5cd293b91cc824b5865aa337e049a1dffeee..3945d0b1d2640cc17dbc1d77b6d16d87da047c50 100644 (file)
@@ -4,8 +4,6 @@
 bool client_command_handle_proxy_reply(struct client *client,
        const struct smtp_reply *reply, struct smtp_reply *reply_r);
 
-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);
 int cmd_quit_relay(struct client *client, struct smtp_server_cmd_ctx *cmd);