]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Don't deliver truncated email when client disconnects before "." line
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 9 Jan 2017 13:12:48 +0000 (15:12 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 9 Jan 2017 13:20:26 +0000 (15:20 +0200)
This didn't happen always, because the EOF was handled in two different
places in different ways.

src/lmtp/commands.c

index 1f72a10ac170b68fc7c73ee905890fbeadca063c..e8862e59453311e14f1463c80c2427e4b4a809ff 100644 (file)
@@ -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);
 }