ref: a1dad874469ff664375e9165d41034a1ee92b505
parent: 072c45d4633d5f03e3b79f9c60c3655a6d4a1149
author: mischief <[email protected]>
date: Wed Jun 25 18:06:29 EDT 2014
upas/fs: disable imap mail fetch pipeline due to race pipeline = 1 with a dovecot imap server causes FETCH and OK responses get interleaved so some message bodies accidentally get merged together. disabling it will make fetching mail over imap slower, but it works.
--- a/sys/src/cmd/upas/fs/imap4.c
+++ b/sys/src/cmd/upas/fs/imap4.c
@@ -9,7 +9,18 @@
#pragma varargck type "Z" char*
int doublequote(Fmt*);
-int pipeline = 1;
+
+// if pipeline == 1 and upas/fs is used with dovecot,
+// 9Xn OK responses sometimes come much later after FETCH responses, i.e.
+// <- * 1 FETCH ...
+// <- * 2 FETCH ...
+// <- * 3 FETCH ...
+// <- 9X5 OK Fetch completed.
+// <- 9X6 OK Fetch completed.
+// download 40: did not get message body
+// <- 9X7 OK Fetch completed.
+// causing multiple messages to turn into one in imap4.c:/^imap4resp.
+int pipeline = 0;
static char Eio[] = "i/o error";