From: Stephan Bosch Date: Sun, 14 Nov 2021 22:27:00 +0000 (+0100) Subject: lib-smtp: smtp-server-command - Emit smtp_server_command_started event a little later. X-Git-Tag: 2.3.18~136 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=771ebaf96182062764f23c7cd57c5c48a3503be3;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: smtp-server-command - Emit smtp_server_command_started event a little later. This way cmd_*args fields are available for the event. --- diff --git a/src/lib-smtp/smtp-server-command.c b/src/lib-smtp/smtp-server-command.c index ff7a313c6d..e40de9f8d6 100644 --- a/src/lib-smtp/smtp-server-command.c +++ b/src/lib-smtp/smtp-server-command.c @@ -186,10 +186,7 @@ smtp_server_command_new_invalid(struct smtp_server_connection *conn) cmd = smtp_server_command_alloc(conn); smtp_server_command_update_event(cmd); - struct event_passthrough *e = - event_create_passthrough(cmd->context.event)-> - set_name("smtp_server_command_started"); - e_debug(e->event(), "Invalid command"); + e_debug(cmd->context.event, "Invalid command"); return cmd; } @@ -207,10 +204,7 @@ smtp_server_command_new(struct smtp_server_connection *conn, smtp_server_command_update_event(cmd); - struct event_passthrough *e = - event_create_passthrough(cmd->context.event)-> - set_name("smtp_server_command_started"); - e_debug(e->event(), "New command"); + e_debug(cmd->context.event, "New command"); return cmd; } @@ -225,6 +219,11 @@ void smtp_server_command_execute(struct smtp_server_command *cmd, event_add_str(cmd->context.event, "cmd_human_args", params); } + struct event_passthrough *e = + event_create_passthrough(cmd->context.event)-> + set_name("smtp_server_command_started"); + e_debug(e->event(), "Execute command"); + if (cmd->reg == NULL) { /* RFC 5321, Section 4.2.4: Reply Code 502