aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-19 13:35:59 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-19 13:35:59 +0800
commit75705d57f328f4ad10ad47692024a5c4de89dbc7 (patch)
treed5820927f4c5e227abe4dea6933fb44c9180cff6 /camel/providers
parent32ee2c5d283b49a0926806e5b4f82639660a19f2 (diff)
downloadgsoc2013-evolution-75705d57f328f4ad10ad47692024a5c4de89dbc7.tar
gsoc2013-evolution-75705d57f328f4ad10ad47692024a5c4de89dbc7.tar.gz
gsoc2013-evolution-75705d57f328f4ad10ad47692024a5c4de89dbc7.tar.bz2
gsoc2013-evolution-75705d57f328f4ad10ad47692024a5c4de89dbc7.tar.lz
gsoc2013-evolution-75705d57f328f4ad10ad47692024a5c4de89dbc7.tar.xz
gsoc2013-evolution-75705d57f328f4ad10ad47692024a5c4de89dbc7.tar.zst
gsoc2013-evolution-75705d57f328f4ad10ad47692024a5c4de89dbc7.zip
Don't bother trying to authenticate (and thus don't throw up an error
2002-06-19 Jeffrey Stedfast <fejj@ximian.com> * 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
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c11
1 files changed, 6 insertions, 5 deletions
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;
}