From: Stephan Bosch Date: Wed, 27 Aug 2025 17:42:15 +0000 (+0200) Subject: lib-smtp: smtp-server - Drop smtp_server_reply_early() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc70a354a6b1928c8668ace29ceb1b56f2c505dd;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: smtp-server - Drop smtp_server_reply_early() Pipeline handling revised in previous commit makes this functionality superfluous. --- diff --git a/src/lib-smtp/smtp-server-private.h b/src/lib-smtp/smtp-server-private.h index e8cae543c3..47b2362694 100644 --- a/src/lib-smtp/smtp-server-private.h +++ b/src/lib-smtp/smtp-server-private.h @@ -106,7 +106,6 @@ struct smtp_server_command { bool input_locked:1; bool input_captured:1; bool pipeline_blocked:1; - bool reply_early:1; bool destroying:1; }; @@ -274,7 +273,7 @@ smtp_server_command_is_complete(struct smtp_server_command *cmd) { struct smtp_server_connection *conn = cmd->context.conn; - return (conn->input_broken || (cmd->next != NULL) || cmd->reply_early || + return (conn->input_broken || (cmd->next != NULL) || !smtp_server_connection_pending_command_data(conn)); } diff --git a/src/lib-smtp/smtp-server-reply.c b/src/lib-smtp/smtp-server-reply.c index f01f51bb85..6edf60eb19 100644 --- a/src/lib-smtp/smtp-server-reply.c +++ b/src/lib-smtp/smtp-server-reply.c @@ -533,19 +533,6 @@ void smtp_server_reply_all(struct smtp_server_cmd_ctx *_cmd, va_end(args); } -void smtp_server_reply_early(struct smtp_server_cmd_ctx *_cmd, - unsigned int status, const char *enh_code, - const char *fmt, ...) -{ - va_list args; - - _cmd->cmd->reply_early = TRUE; - - va_start(args, fmt); - smtp_server_reply_allv(_cmd, status, enh_code, fmt, args); - va_end(args); -} - void smtp_server_reply_quit(struct smtp_server_cmd_ctx *_cmd) { struct smtp_server_command *cmd = _cmd->cmd; diff --git a/src/lib-smtp/smtp-server.h b/src/lib-smtp/smtp-server.h index 2ee7b6af77..8e13dd719a 100644 --- a/src/lib-smtp/smtp-server.h +++ b/src/lib-smtp/smtp-server.h @@ -774,11 +774,6 @@ void smtp_server_reply_forward(struct smtp_server_cmd_ctx *cmd, void smtp_server_reply_all(struct smtp_server_cmd_ctx *_cmd, unsigned int status, const char *enh_code, const char *fmt, ...) ATTR_FORMAT(4, 5); -/* Submit and send the same message for all expected replies for this command - early; i.e., no matter whether all command data is received completely. */ -void smtp_server_reply_early(struct smtp_server_cmd_ctx *_cmd, - unsigned int status, const char *enh_code, - const char *fmt, ...) ATTR_FORMAT(4, 5); /* Reply the command with a 221 bye message */ void smtp_server_reply_quit(struct smtp_server_cmd_ctx *_cmd); diff --git a/src/lib-smtp/test-smtp-server-errors.c b/src/lib-smtp/test-smtp-server-errors.c index c087d4b2b2..999a44da1e 100644 --- a/src/lib-smtp/test-smtp-server-errors.c +++ b/src/lib-smtp/test-smtp-server-errors.c @@ -1291,8 +1291,8 @@ test_server_big_data_data_continue(void *conn_ctx ATTR_UNUSED, } if (ctx->payload_input->v_offset >= max_size) { - smtp_server_reply_early(cmd, 552, "5.3.4", - "Message too big for system"); + smtp_server_reply(cmd, 552, "5.3.4", + "Message too big for system"); return -1; }