aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/smtp/camel-smtp-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/smtp/camel-smtp-transport.c')
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index d45c617c02..0c331bb673 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -402,12 +402,14 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL_ALWAYS) {
/* First try STARTTLS */
- if (!connect_to_server (service, TRUE, ex) &&
- !(transport->flags & CAMEL_SMTP_TRANSPORT_STARTTLS) &&
- EXCEPTION_RETRY (ex)) {
- /* STARTTLS is unavailable - okay, now try port 465 */
- camel_exception_clear (ex);
- return connect_to_server (service, FALSE, ex);
+ if (!connect_to_server (service, TRUE, ex)) {
+ if (!(transport->flags & CAMEL_SMTP_TRANSPORT_STARTTLS) && EXCEPTION_RETRY (ex)) {
+ /* STARTTLS is unavailable - okay, now try port 465 */
+ camel_exception_clear (ex);
+ return connect_to_server (service, FALSE, ex);
+ } else {
+ return FALSE;
+ }
}
return TRUE;