aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
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;
}