aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-02-25 00:09:19 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-02-25 00:09:19 +0800
commit7588597e8917f7445be635b6fc6a1447879f7455 (patch)
tree7c6b4f7c938e09855c475b222f8a626c2f309471 /camel/providers
parentcd413978fcc310ca6c721142a2c11a6e4b692b8a (diff)
downloadgsoc2013-evolution-7588597e8917f7445be635b6fc6a1447879f7455.tar
gsoc2013-evolution-7588597e8917f7445be635b6fc6a1447879f7455.tar.gz
gsoc2013-evolution-7588597e8917f7445be635b6fc6a1447879f7455.tar.bz2
gsoc2013-evolution-7588597e8917f7445be635b6fc6a1447879f7455.tar.lz
gsoc2013-evolution-7588597e8917f7445be635b6fc6a1447879f7455.tar.xz
gsoc2013-evolution-7588597e8917f7445be635b6fc6a1447879f7455.tar.zst
gsoc2013-evolution-7588597e8917f7445be635b6fc6a1447879f7455.zip
New function...back from the depths of hell from whence it came
2003-02-21 Jeffrey Stedfast <fejj@ximian.com> * camel-iconv.c (camel_iconv_charset_name): New function...back from the depths of hell from whence it came originally. Turns out that g_iconv_open() is lame and can't handle all the stuff we used to handle in e_iconv_charset_name(). (camel_iconv_open): Use camel_iconv_charset_name() on the to/from charsets rather than camel_charset_canonical_name(). Now maybe g_iconv_open will work for charsets such as "ks_c_5601-1987". * providers/pop3/camel-pop3-store.c (pop3_connect): Reget the capabilities after a successful authentication. * providers/pop3/camel-pop3-engine.c (get_capabilities): If we are in the TRANSACTION state and CAPA did not list UIDL as a supported command, try checking for it the hard way. svn path=/trunk/; revision=20033
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/pop3/camel-pop3-engine.c14
-rw-r--r--camel/providers/pop3/camel-pop3-store.c7
2 files changed, 19 insertions, 2 deletions
diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c
index a76df8f9bc..6ea3704667 100644
--- a/camel/providers/pop3/camel-pop3-engine.c
+++ b/camel/providers/pop3/camel-pop3-engine.c
@@ -217,6 +217,18 @@ get_capabilities(CamelPOP3Engine *pe, int read_greeting)
while (camel_pop3_engine_iterate(pe, pc) > 0)
;
camel_pop3_engine_command_free(pe, pc);
+
+ if (pe->state == CAMEL_POP3_ENGINE_TRANSACTION && !(pe->capa & CAMEL_POP3_CAP_UIDL)) {
+ /* check for UIDL support manually */
+ pc = camel_pop3_engine_command_new (pe, CAMEL_POP3_COMMAND_SIMPLE, NULL, NULL, "UIDL 1\r\n");
+ while (camel_pop3_engine_iterate (pe, pc) > 0)
+ ;
+
+ if (pc->state == CAMEL_POP3_COMMAND_OK)
+ pe->capa |= CAMEL_POP3_CAP_UIDL;
+
+ camel_pop3_engine_command_free (pe, pc);
+ }
}
/* returns true if the command was sent, false if it was just queued */
@@ -350,7 +362,7 @@ camel_pop3_engine_command_new(CamelPOP3Engine *pe, guint32 flags, CamelPOP3Comma
pc->data = g_strdup_vprintf(fmt, ap);
pc->state = CAMEL_POP3_COMMAND_IDLE;
- /* TODO: what abou write errors? */
+ /* TODO: what about write errors? */
engine_command_queue(pe, pc);
return pc;
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 566d57c9ba..f0928ea4cc 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -484,7 +484,8 @@ pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *err
for (s = md5sum, d = md5asc; d < md5asc + 32; s++, d += 2)
sprintf (d, "%.2x", *s);
- pcp = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "APOP %s %s\r\n", service->url->user, md5asc);
+ pcp = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "APOP %s %s\r\n",
+ service->url->user, md5asc);
} else {
CamelServiceAuthType *auth;
GList *l;
@@ -581,6 +582,10 @@ pop3_connect (CamelService *service, CamelException *ex)
return FALSE;
}
+ /* Now that we are in the TRANSACTION state, try regetting the capabilities */
+ store->engine->state = CAMEL_POP3_ENGINE_TRANSACTION;
+ camel_pop3_engine_reget_capabilities (store->engine);
+
return TRUE;
}