aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-05-05 00:02:49 +0800
committerDan Winship <danw@src.gnome.org>2000-05-05 00:02:49 +0800
commit67656eb615e5d06ec192cf85a21c859b5303b720 (patch)
tree90cc355124a3b439f2262dea1637500a1176abd9 /camel/providers
parentba6b73fe56390dc752b43443701073fff7289709 (diff)
downloadgsoc2013-evolution-67656eb615e5d06ec192cf85a21c859b5303b720.tar
gsoc2013-evolution-67656eb615e5d06ec192cf85a21c859b5303b720.tar.gz
gsoc2013-evolution-67656eb615e5d06ec192cf85a21c859b5303b720.tar.bz2
gsoc2013-evolution-67656eb615e5d06ec192cf85a21c859b5303b720.tar.lz
gsoc2013-evolution-67656eb615e5d06ec192cf85a21c859b5303b720.tar.xz
gsoc2013-evolution-67656eb615e5d06ec192cf85a21c859b5303b720.tar.zst
gsoc2013-evolution-67656eb615e5d06ec192cf85a21c859b5303b720.zip
Don't fall back to plaintext passwords if APOP fails, since it should also
* providers/pop3/camel-pop3-store.c (pop3_connect): Don't fall back to plaintext passwords if APOP fails, since it should also fail. svn path=/trunk/; revision=2798
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/pop3/camel-pop3-store.c32
1 files changed, 14 insertions, 18 deletions
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);