dovecot-2.2: imap proxy: Avoid duplicate CAPABILITY reply when b...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jan 10 20:00:53 EET 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/4dd86f75346b
changeset: 17092:4dd86f75346b
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jan 10 13:00:39 2014 -0500
description:
imap proxy: Avoid duplicate CAPABILITY reply when backend is Dovecot.
This happened if the client sent a CAPABILITY command to the proxy.

diffstat:

 src/imap-login/imap-proxy.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r b6ab0e056c0b -r 4dd86f75346b src/imap-login/imap-proxy.c
--- a/src/imap-login/imap-proxy.c	Fri Jan 10 00:19:19 2014 +0200
+++ b/src/imap-login/imap-proxy.c	Fri Jan 10 13:00:39 2014 -0500
@@ -63,7 +63,14 @@
 	unsigned int len;
 	const char *mech_name, *error;
 
-	if (client->proxy_backend_capability == NULL) {
+	/* Send CAPABILITY command if we don't know the capabilities yet.
+	   Also as kind of a Dovecot-backend workaround if the client insisted
+	   on sending CAPABILITY command (even though our banner already sent
+	   it), send the (unnecessary) CAPABILITY command to backend as well
+	   to avoid sending the CAPABILITY reply twice (untagged and OK resp
+	   code). */
+	if (client->proxy_backend_capability == NULL ||
+	    client->client_ignores_capability_resp_code) {
 		str_append(str, "C CAPABILITY\r\n");
 		if (client->common.proxy_nopipelining) {
 			/* authenticate only after receiving C OK reply. */


More information about the dovecot-cvs mailing list