Before, only messages sent using DATA command guaranteed consistent CRLF,
because these are sent using o_stream_dot(), which does that internally. For the
BDAT command, the message was sent as-is, which is not always accepted by MTAs.
#include "str.h"
#include "llist.h"
#include "istream.h"
+#include "istream-crlf.h"
#include "ostream.h"
#include "ostream-dot.h"
#include "smtp-common.h"
ctx->conn = conn;
ctx->pool = cmd->pool;
ctx->cmd_data = cmd;
- ctx->data = data;
- i_stream_ref(data);
/* capture abort event with our context */
smtp_client_command_set_abort_callback(cmd, _cmd_data_abort_cb, ctx);
if ((conn->caps.standard & SMTP_CAPABILITY_CHUNKING) == 0) {
/* DATA */
+ ctx->data = data;
+ i_stream_ref(data);
+
p_array_init(&ctx->cmds, ctx->pool, 1);
/* Data stream is sent in one go in the second stage. Since the data
} else {
/* BDAT */
+ ctx->data = i_stream_create_crlf(data);
+
p_array_init(&ctx->cmds, ctx->pool,
conn->set.max_data_chunk_pipeline);