imapserver: implement "inprogress" response code (RFC 9585) for keepalive during long search

For long searches in big mailboxes, without any matches, we would previously
keep working and not say anything. Clients could interpret this silence as a
broken connection at some point. We now send a "we're still searching" untagged
OK responses with code INPROGRESS every 10 seconds while we're still searching,
to prevent the client from closing the connection. We also send how many
messages we've processed, and usually also how many we need to process in grand
total. Clients can use this to show a progress bar.
This commit is contained in:
Mechiel Lukkien
2025-03-30 10:29:15 +02:00
parent 3e128d744e
commit cc5e3165ea
6 changed files with 112 additions and 4 deletions

View File

@ -181,6 +181,7 @@ var serverCapabilities = strings.Join([]string{
"MULTIAPPEND", // ../rfc/3502
"REPLACE", // ../rfc/8508
"PREVIEW", // ../rfc/8970:114
"INPROGRESS", // ../rfc/9585:101
// "COMPRESS=DEFLATE", // ../rfc/4978, disabled for interoperability issues: The flate reader (inflate) still blocks on partial flushes, preventing progress.
}, " ")