summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-06-17 14:58:41 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-06-28 13:01:57 +0100
commit82298b9b058a4307024d9094090a9ed3ef060654 (patch)
treec5ab7edcffff4719464c2c88657f1d8c7ea3430d
parent271bbaf03659d4b5dafa2893329617561f98f052 (diff)
downloadevolution-data-server-82298b9b058a4307024d9094090a9ed3ef060654.tar.gz
Re-fetch capabilities after STARTTLS. There might be new auth methods available
(cherry picked from commit 2c9e14be88463cb00819393f17573dd4aed0e56c)
-rw-r--r--camel/providers/imapx/camel-imapx-server.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 88a22c9e4..6ce78eae6 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2397,6 +2397,16 @@ imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex)
camel_imapx_command_free(ic);
goto exit;
}
+
+ /* See if we got new capabilities in the STARTTLS response */
+ imapx_free_capability(is->cinfo);
+ is->cinfo = NULL;
+ if (ic->status->condition == IMAPX_CAPABILITY) {
+ is->cinfo = ic->status->u.cinfo;
+ ic->status->u.cinfo = NULL;
+ c(printf("got capability flags %08x\n", is->cinfo->capa));
+ }
+
camel_imapx_command_free(ic);
if (camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream)) == -1) {
@@ -2405,6 +2415,16 @@ imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex)
is->url->host, _("SSL negotiations failed"));
goto exit;
}
+ /* Get new capabilities if they weren't already given */
+ if (!is->cinfo) {
+ ic = camel_imapx_command_new("CAPABILITY", NULL, "CAPABILITY");
+ imapx_command_run (is, ic);
+ camel_exception_xfer (ex, ic->ex);
+ camel_imapx_command_free(ic);
+
+ if (camel_exception_is_set (ex))
+ goto exit;
+ }
}
#endif