From: Timo Sirainen Date: Mon, 9 Jan 2017 13:12:48 +0000 (+0200) Subject: lmtp: Don't deliver truncated email when client disconnects before "." line X-Git-Tag: 2.3.0.rc1~2335 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3bb61142ca8dc0c71efd430fa8f805a4c7262aa8;p=thirdparty%2Fdovecot%2Fcore.git lmtp: Don't deliver truncated email when client disconnects before "." line This didn't happen always, because the EOF was handled in two different places in different ways. --- diff --git a/src/lmtp/commands.c b/src/lmtp/commands.c index 1f72a10ac1..e8862e5945 100644 --- a/src/lmtp/commands.c +++ b/src/lmtp/commands.c @@ -1269,12 +1269,13 @@ static void client_input_data_handle(struct client *client) if (ret == 0) return; - if (!client->dot_input->eof) { + if (client->dot_input->stream_errno != 0) { /* client probably disconnected */ client_destroy(client, NULL, NULL); return; } + /* the ending "." line was seen. begin saving the mail. */ client_input_data_write(client); }