struct io *io;
int fd;
+ const char *data_header;
ARRAY_DEFINE(recipients, struct lmtp_rcpt);
unsigned int rcpt_next_receive_idx;
unsigned int rcpt_next_data_idx;
}
client->input_state++;
o_stream_cork(client->output);
+ if (client->data_header != NULL)
+ o_stream_send_str(client->output, client->data_header);
lmtp_client_send_data(client);
o_stream_uncork(client->output);
break;
return 0;
}
+void lmtp_client_set_data_header(struct lmtp_client *client, const char *str)
+{
+ client->data_header = p_strdup(client->pool, str);
+}
+
static void lmtp_client_send_rcpts(struct lmtp_client *client)
{
const struct lmtp_rcpt *rcpt;
enum lmtp_client_protocol protocol,
const char *host, unsigned int port);
+/* Add headers from given string before the rest of the data. The string must
+ use CRLF line feeds and end with CRLF. */
+void lmtp_client_set_data_header(struct lmtp_client *client, const char *str);
/* Add recipient to the session. rcpt_to_callback is called once LMTP server
replies with RCPT TO. If RCPT TO was a succees, data_callback is called
when DATA replies. */