The pending counter was sometimes decremented twice in specific error
conditions, leading to an assert panic in the DATA command. This was caused by
some dead code. If the MAIL command failed in a pipeline before the RCPT command,
the assert was triggered.
Panic was:
Panic: file smtp-server-cmd-data.c: line 354 (cmd_data_start): assertion failed: (conn->state.pending_mail_cmds == 0 && conn->state.pending_rcpt_cmds == 0)
cmd_rcpt_check_state(struct smtp_server_cmd_ctx *cmd)
{
struct smtp_server_connection *conn = cmd->conn;
- struct smtp_server_command *command = cmd->cmd;
struct smtp_server_transaction *trans = conn->state.trans;
if (conn->state.pending_mail_cmds == 0 && trans == NULL) {
- if (command->hook_replied != NULL) {
- conn->state.pending_rcpt_cmds--;
- command->hook_replied = NULL;
- }
smtp_server_reply(cmd,
503, "5.5.0", "MAIL needed first");
return FALSE;