aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c13
2 files changed, 9 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index d6af52d537..4de990397c 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,9 @@
2002-03-18 Jeffrey Stedfast <fejj@ximian.com>
+ * providers/smtp/camel-smtp-transport.c
+ (connect_to_server_wrapper): Updated to use the same logic as the
+ POP code.
+
* providers/pop3/camel-pop3-store.c (connect_to_server): No longer
takes a stls_supported argument since we no longer need it with
the new logic.
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index d0b257cd6b..7807e87593 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -391,9 +391,6 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex)
#endif /* HAVE_SSL */
}
-#define EXCEPTION_RETRY(ex) (camel_exception_get_id (ex) != CAMEL_EXCEPTION_USER_CANCEL && \
- camel_exception_get_id (ex) != CAMEL_EXCEPTION_SERVICE_UNAVAILABLE)
-
static gboolean
connect_to_server_wrapper (CamelService *service, CamelException *ex)
{
@@ -401,12 +398,12 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
CamelSmtpTransport *transport = (CamelSmtpTransport *) service;
if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL_ALWAYS) {
- /* First try STARTTLS */
- 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 */
+ /* First try connecting to the SSL port */
+ if (!connect_to_server (service, FALSE, ex)) {
+ if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) {
+ /* Seems the SSL port is unavailable, lets try STARTTLS */
camel_exception_clear (ex);
- return connect_to_server (service, FALSE, ex);
+ return connect_to_server (service, TRUE, ex);
} else {
return FALSE;
}