From 75705d57f328f4ad10ad47692024a5c4de89dbc7 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 19 Jun 2002 05:35:59 +0000 Subject: Don't bother trying to authenticate (and thus don't throw up an error 2002-06-19 Jeffrey Stedfast * providers/smtp/camel-smtp-transport.c (smtp_connect): Don't bother trying to authenticate (and thus don't throw up an error dialog) unless the server is an ESMTP server and supports authentication. * camel-sasl-plain.c: Change the user-friendly name to PLAIN, this is what it should be. Not "Password" because user's immediately think that they need authentication when they see "Password" even if they don't need it at all. svn path=/trunk/; revision=17232 --- camel/providers/smtp/camel-smtp-transport.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'camel/providers/smtp') diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 924bc04a7b..7e5eddb6a0 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -424,6 +424,7 @@ static gboolean smtp_connect (CamelService *service, CamelException *ex) { CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service); + gboolean has_authtypes; /* We (probably) need to check popb4smtp before we connect ... */ if (service->url->authmech && !strcmp (service->url->authmech, "POPB4SMTP")) { @@ -448,18 +449,18 @@ smtp_connect (CamelService *service, CamelException *ex) return FALSE; /* check to see if AUTH is required, if so...then AUTH ourselves */ - if (service->url->authmech) { + has_authtypes = g_hash_table_size (transport->authtypes) > 0; + if (service->url->authmech && (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) && has_authtypes) { CamelSession *session = camel_service_get_session (service); CamelServiceAuthType *authtype; gboolean authenticated = FALSE; char *errbuf = NULL; - if (!(transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) || - !g_hash_table_lookup (transport->authtypes, service->url->authmech)) { + if (!g_hash_table_lookup (transport->authtypes, service->url->authmech)) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, _("SMTP server %s does not support requested " - "authentication type %s"), service->url->host, - service->url->authmech); + "authentication type %s."), + service->url->host, service->url->authmech); camel_service_disconnect (service, TRUE, NULL); return FALSE; } -- cgit v1.2.3