diff options
Diffstat (limited to 'camel/providers/imap/camel-imap-store.c')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index afe9ed8c4..b22743e72 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -872,9 +872,9 @@ static struct { } ssl_options[] = { { "", "imaps", IMAPS_PORT, MODE_SSL }, /* really old (1.x) */ { "always", "imaps", IMAPS_PORT, MODE_SSL }, - { "when-possible", "imap", IMAP_PORT, MODE_TLS }, - { "never", "imap", IMAP_PORT, MODE_CLEAR }, - { NULL, "imap", IMAP_PORT, MODE_CLEAR }, + { "when-possible", "imap", IMAP_PORT, MODE_TLS }, + { "never", "imap", IMAP_PORT, MODE_CLEAR }, + { NULL, "imap", IMAP_PORT, MODE_CLEAR }, }; static gboolean @@ -918,8 +918,11 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex) } if (ai == NULL) return FALSE; - - ret = connect_to_server (service, ai, mode, ex); + + if (!(ret = connect_to_server (service, ai, mode, ex)) && mode == MODE_SSL) + ret = connect_to_server (service, ai, MODE_TLS, ex); + else if (!ret && mode == MODE_TLS) + ret = connect_to_server (service, ai, MODE_CLEAR, ex); camel_freeaddrinfo (ai); |