#include "str.h"
#include "llist.h"
#include "istream.h"
-#include "istream-crlf.h"
#include "ostream.h"
#include "ostream-dot.h"
#include "smtp-common.h"
/* capture abort event with our context */
smtp_client_command_set_abort_callback(cmd, _cmd_data_abort_cb, ctx);
+ ctx->data = data;
+ i_stream_ref(data);
+
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 = data = i_stream_create_crlf(data);
-
p_array_init(&ctx->cmds, ctx->pool,
conn->set.max_data_chunk_pipeline);
(smtp_client_command_callback_t *)callback, context)
/* Send message data using DATA or BDAT (preferred if supported).
- This handles the DATA 354 response implicitly.
+ This handles the DATA 354 response implicitly. Making sure that the data has
+ CRLF line endings consistently is the responsibility of the caller.
*/
struct smtp_client_command *
smtp_client_command_data_submit_after(
#include "ioloop.h"
#include "net.h"
#include "istream.h"
+#include "istream-crlf.h"
#include "ostream.h"
#include "str.h"
#include "dns-lookup.h"
trans->data_provided = TRUE;
i_assert(trans->data_input == NULL);
- trans->data_input = data_input;
- i_stream_ref(data_input);
+ trans->data_input = i_stream_create_crlf(data_input);
trans->data_callback = data_callback;
trans->data_context = data_context;