From: Stephan Bosch Date: Mon, 16 Mar 2020 21:01:14 +0000 (+0100) Subject: lib-smtp: smtp-server-command - Set cmd_name event field only for valid commands. X-Git-Tag: 2.3.11.2~506 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f2cd521f41e72cd458b4b671d6d9cfc2be62262;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: smtp-server-command - Set cmd_name event field only for valid commands. Set cmd_input_name for the user input. --- diff --git a/src/lib-smtp/smtp-server-command.c b/src/lib-smtp/smtp-server-command.c index 01669c03ba..dd8b0756ab 100644 --- a/src/lib-smtp/smtp-server-command.c +++ b/src/lib-smtp/smtp-server-command.c @@ -133,7 +133,11 @@ smtp_server_command_update_event(struct smtp_server_command *cmd) const char *label = (cmd->context.name == NULL ? "[INVALID]" : cmd->context.name); - event_add_str(event, "cmd_name", cmd->context.name); + if (cmd->reg != NULL) + event_add_str(event, "cmd_name", cmd->reg->name); + else + event_add_str(event, "cmd_name", "unknown"); + event_add_str(event, "cmd_input_name", cmd->context.name); event_set_append_log_prefix(event, t_strdup_printf("command %s: ", label)); }