From 54a196dcc331eabd155f42215b0e94ac88767665 Mon Sep 17 00:00:00 2001 From: ellie timoney Date: Fri, 24 Nov 2023 10:38:34 +1100 Subject: [PATCH] pop3d: try to not split ".\r\n" across packet boundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Works around some Thunderbird bug. Based on patch provided and tested in #4717 by @yaonos (Stéphane GAUBERT) Fixes: #4717 --- imap/pop3d.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imap/pop3d.c b/imap/pop3d.c index 64ff09c9c2..167e5c75e7 100644 --- a/imap/pop3d.c +++ b/imap/pop3d.c @@ -2052,6 +2052,9 @@ static int blat(int msgno, int lines) /* Protect against messages not ending in CRLF */ if (buf[strlen(buf)-1] != '\n') prot_printf(popd_out, "\r\n"); + /* Clients may become confused when the .\r\n sequence gets split + * up across packets. Flush first to prevent that. */ + prot_flush(popd_out); prot_printf(popd_out, ".\r\n"); /* Reset inactivity timer in case we spend a long time