summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authormischief <mischief@offblast.org>2014-06-25 22:06:29 -0700
committermischief <mischief@offblast.org>2014-06-25 22:06:29 -0700
commita1dad874469ff664375e9165d41034a1ee92b505 (patch)
treed56a67792556f0aeb0917ac1921e6e981fd91d0e /sys/src
parent072c45d4633d5f03e3b79f9c60c3655a6d4a1149 (diff)
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.
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/cmd/upas/fs/imap4.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/src/cmd/upas/fs/imap4.c b/sys/src/cmd/upas/fs/imap4.c
index 714a3e7d0..06e8fdd84 100644
--- 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";