+2001-04-02 Dan Winship <danw@ximian.com>
+
+ * camel-service.h: Remove the "quick_login" member, which is
+ unnecessary.
+
+ * providers/smtp/camel-smtp-transport.c (smtp_auth): Remove the
+ references to quick_login and fix this to use the CamelSasl
+ interfaces correctly to do the same thing.
+ (connect_to_server): Split this out of smtp_connect
+ (smtp_connect): Use connect_to_server. When re-EHLO'ing after
+ auth, ignore errors.
+ (query_auth_types): Use connect_to_server rather than
+ smtp_connect, so it doesn't try to authenticate. Add LOGIN
+ authtype to the list of authtypes to check for.
+
+ * providers/smtp/camel-smtp-provider.c
+ (camel_provider_module_init): Add LOGIN authtype to the authtypes
+ list explicitly.
+
+ * camel-sasl.c (camel_sasl_authtype_list): Don't list LOGIN here:
+ it's not a real SASL authtype and is only used for SMTP.
+
+ * camel-sasl-plain.c:
+ * camel-sasl-login.c:
+ * camel-sasl-kerberos4.c:
+ * camel-sasl-cram-md5.c:
+ * camel-sasl-anonymous.c:
+ * providers/pop3/camel-pop3-provider.c: Remove "quick_login"
+ argument from authtypes.
+
2001-04-02 Gediminas Paulauskas <menesis@delfi.lt>
* camel-filter-driver.c: marked missing report status' for translation.
}
static gboolean
-smtp_connect (CamelService *service, CamelException *ex)
+connect_to_server (CamelService *service, CamelException *ex)
{
CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
CamelStream *tcp_stream;
smtp_helo (transport, ex);
}
+ return TRUE;
+}
+
+static gboolean
+smtp_connect (CamelService *service, CamelException *ex)
+{
+ CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
+
+ if (!connect_to_server (service, ex))
+ return FALSE;
+
/* check to see if AUTH is required, if so...then AUTH ourselves */
if (service->url->authmech) {
CamelSession *session = camel_service_get_session (service);
}
}
- /* we have to re-EHLO */
- smtp_helo (transport, ex);
+ /* The spec says we have to re-EHLO, but some servers
+ * we won't bother to name don't want you to... so ignore
+ * errors.
+ */
+ smtp_helo (transport, NULL);
}
return TRUE;
CamelServiceAuthType *authtype;
GList *types, *t, *next;
- if (!smtp_connect (service, ex))
+ if (!connect_to_server (service, ex))
return NULL;
- types = camel_sasl_authtype_list (TRUE);
+ types = g_list_copy (service->provider->authtypes);
for (t = types; t; t = next) {
authtype = t->data;
next = t->next;
}
}
+ smtp_disconnect (service, TRUE, NULL);
return types;
}
static gboolean
smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
{
- CamelServiceAuthType *authtype;
- gchar *cmdbuf, *respbuf = NULL;
+ gchar *cmdbuf, *respbuf = NULL, *challenge;
CamelSasl *sasl;
sasl = camel_sasl_new ("smtp", mech, CAMEL_SERVICE (transport));
return FALSE;
}
- /* get the authtype object so we know if we can challenge the server */
- authtype = camel_sasl_authtype (mech);
-
- /* tell the server we want to authenticate... */
- if (authtype && authtype->quick_login) {
- /* cool, we can challenge the server in our initial request */
- char *challenge;
-
- challenge = camel_sasl_challenge_base64 (sasl, NULL, ex);
+ challenge = camel_sasl_challenge_base64 (sasl, NULL, ex);
+ if (challenge) {
cmdbuf = g_strdup_printf ("AUTH %s %s\r\n", mech, challenge);
g_free (challenge);
} else
}
while (!camel_sasl_authenticated (sasl)) {
- char *challenge;
-
if (!respbuf)
goto lose;
/* eat whtspc */
- for (challenge = respbuf + 4; *challenge && isspace (*challenge); challenge++);
+ for (challenge = respbuf + 4; isspace (*challenge); challenge++);
challenge = camel_sasl_challenge_base64 (sasl, challenge, ex);
g_free (respbuf);