static void lmtp_client_send_handshake(struct lmtp_client *client)
{
- o_stream_cork(client->output);
switch (client->protocol) {
case LMTP_CLIENT_PROTOCOL_LMTP:
o_stream_send_str(client->output,
client->set.my_hostname));
break;
}
- o_stream_send_str(client->output,
- t_strdup_printf("MAIL FROM:%s\r\n", client->set.mail_from));
- o_stream_uncork(client->output);
}
static int lmtp_input_get_reply_code(const char *line, int *reply_code_r)
lmtp_client_fail(client, line);
return -1;
}
+ if (client->input_state == LMTP_INPUT_STATE_LHLO) {
+ o_stream_send_str(client->output,
+ t_strdup_printf("MAIL FROM:%s\r\n",
+ client->set.mail_from));
+ }
client->input_state++;
lmtp_client_send_rcpts(client);
break;
return -1;
}
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;
case LMTP_INPUT_STATE_DATA:
/* DATA replies */
const char *line;
lmtp_client_ref(client);
+ o_stream_cork(client->output);
while ((line = i_stream_read_next_line(client->input)) != NULL) {
if (lmtp_client_input_line(client, line) < 0) {
+ o_stream_uncork(client->output);
lmtp_client_unref(&client);
return;
}
lmtp_client_fail(client, ERRSTR_TEMP_REMOTE_FAILURE
" (disconnected in input)");
}
+ o_stream_uncork(client->output);
lmtp_client_unref(&client);
}