diff options
-rw-r--r-- | camel/ChangeLog | 6 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.c | 32 |
2 files changed, 20 insertions, 18 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 7754a6ce59..ec34de00d5 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,11 @@ 2000-05-04 Dan Winship <danw@helixcode.com> + * providers/pop3/camel-pop3-store.c (pop3_connect): Don't fall + back to plaintext passwords if APOP fails, since it should also + fail. + +2000-05-04 Dan Winship <danw@helixcode.com> + * camel-session.c (camel_session_list_providers): New function to replace camel_provider_scan. Returns a list of either (a) all currently-loaded providers, or (b) all available providers. diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index eb5c77558e..8cbc85435e 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -284,7 +284,7 @@ pop3_connect (CamelService *service, CamelException *ex) struct hostent *h; struct sockaddr_in sin; int fd, status; - char *buf, *apoptime, *apopend; + char *buf, *apoptime, *apopend, *msg; CamelPop3Store *store = CAMEL_POP3_STORE (service); #ifdef HAVE_KRB4 gboolean kpop = (service->url->authmech && @@ -387,7 +387,6 @@ pop3_connect (CamelService *service, CamelException *ex) g_free (buf); /* Authenticate via APOP if we can, USER/PASS if we can't. */ - status = CAMEL_POP3_FAIL; if (apoptime) { char *secret, md5asc[32], *d; unsigned char md5sum[16], *s; @@ -401,13 +400,9 @@ pop3_connect (CamelService *service, CamelException *ex) for (s = md5sum, d = md5asc; d < md5asc + 32; s++, d += 2) sprintf (d, "%.2x", *s); - status = camel_pop3_command (store, NULL, "APOP %s %s", + status = camel_pop3_command (store, &msg, "APOP %s %s", service->url->user, md5asc); - } - - if (status != CAMEL_POP3_OK ) { - char *msg; - + } else { status = camel_pop3_command (store, &msg, "USER %s", service->url->user); if (status != CAMEL_POP3_OK) { @@ -423,16 +418,17 @@ pop3_connect (CamelService *service, CamelException *ex) status = camel_pop3_command(store, &msg, "PASS %s", service->url->passwd); - if (status != CAMEL_POP3_OK) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - "Unable to authenticate to POP " - "server. Error sending password:" - " %s", msg ? msg : "(Unknown)"); - g_free (msg); - camel_stream_close (store->ostream); - camel_stream_close (store->istream); - return FALSE; - } + } + + if (status != CAMEL_POP3_OK) { + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, + "Unable to authenticate to POP " + "server. Error sending password:" + " %s", msg ? msg : "(Unknown)"); + g_free (msg); + camel_stream_close (store->ostream); + camel_stream_close (store->istream); + return FALSE; } service_class->connect (service, ex); |