Skip to content

Commit

Permalink
lib-smtp: server: Fixed assertion in smtp_server_connection_next_repl…
Browse files Browse the repository at this point in the history
…y() checking whether command is fully replied.

It did not handle LMTP DATA/BDAT command correctly, for which there can be multiple replies.

This fixes mixing local/remote recipients in LMTP, which used to crash:
Panic: file smtp-server-connection.c: line 610 (smtp_server_connection_next_reply): assertion failed: (cmd->state == SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY && smtp_server_command_is_replied(cmd))
  • Loading branch information
stephanbosch authored and sirainen committed Dec 22, 2017
1 parent cfb605f commit 28fede7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib-smtp/smtp-server-connection.c
Expand Up @@ -609,7 +609,7 @@ smtp_server_connection_next_reply(struct smtp_server_connection *conn)
}

i_assert(cmd->state == SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY &&
smtp_server_command_is_replied(cmd));
array_is_created(&cmd->replies));

smtp_server_command_completed(cmd);

Expand All @@ -619,8 +619,6 @@ smtp_server_connection_next_reply(struct smtp_server_connection *conn)
for (i = 0; i < cmd->replies_expected; i++) {
struct smtp_server_reply *reply;

if (!array_is_created(&cmd->replies))
break;
reply = array_idx_modifiable(&cmd->replies, i);

if (!reply->submitted) {
Expand Down

0 comments on commit 28fede7

Please sign in to comment.