From: Stephan Bosch Date: Sun, 6 Jan 2019 15:21:29 +0000 (+0100) Subject: lib-smtp: client: command: Add debug message showing what commands are being sent... X-Git-Tag: 2.3.6~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d734431c4044efd350f9d1c70972777192e63d29;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: client: command: Add debug message showing what commands are being sent to the server. --- diff --git a/src/lib-smtp/smtp-client-command.c b/src/lib-smtp/smtp-client-command.c index 569261eefd..ba04bf7117 100644 --- a/src/lib-smtp/smtp-client-command.c +++ b/src/lib-smtp/smtp-client-command.c @@ -485,7 +485,13 @@ void smtp_client_command_set_replies(struct smtp_client_command *cmd, static void smtp_client_command_sent(struct smtp_client_command *cmd) { - smtp_client_command_debug(cmd, "Sent"); + if (cmd->data == NULL) + smtp_client_command_debug(cmd, "Sent"); + else { + i_assert(str_len(cmd->data) > 2); + str_truncate(cmd->data, str_len(cmd->data)-2); + smtp_client_command_debug(cmd, "Sent: %s", str_c(cmd->data)); + } if (smtp_client_command_name_equals(cmd, "QUIT")) cmd->conn->sent_quit = TRUE;