This is especially critical while performing the DATA command.
The DATA (and AUTH) command use smtp_server_connection_reply_immediate()
from within the connection input handler. Without the new code, output
errors in that function are not caught and lead to the server to hang
if the connection is closed in the right moment.
conn->callbacks->conn_cmd_input_post != NULL)
conn->callbacks->conn_cmd_input_post(conn->context);
conn->handling_input = FALSE;
+
+ /* Handle output errors from immediate replies sent to client
+ (normal replies are exclusively sent in output handler). */
+ if (conn->conn.output != NULL && conn->conn.output->closed)
+ smtp_server_connection_handle_output_error(conn);
smtp_server_connection_unref(&conn);
}