Making IMAP folder failed on imap.gmx.com



Hi,

I'm implementing mailer with libtinymail(It's very awesome!).
And I think I found a kind of bug. It happened when I try to rename subfolder's subfolders(not Top level's) on IMAP that does not support NAMESPACE(e.g. imap.gmx.com).

For example, 'RENAME INBOX/aaa INBOX' will be sent as a IMAP command if I try to rename INBOX/aaa to INBOX/bbb.

If server does not support NAMESPACE, CamelImapStoreNamespace's member 'sep' always set NULL in function imap_connect_online() on file  libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c.

So, function camel_imap_store_summary_full_from_path() on file libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store-summary.c always call function camel_imap_store_summary_path_to_full() with invalid dir separator(NULL).

As a result,
INBOX/bbb's '/' is replaced with CamelImapStoreNamespace's dir separator. So invalid IMAP command sent.

In function imap_connect_online(),
if CamelImapStore's member 'dir_sep' is NULL, it set to '/' now(commented in 'Guess').
So, I think that if CamelImapStoreNamespace's member 'sep' is NULL, it should be set to '/', too.

It works properly after patch(and I also tested it with other server support NAMESPACE and dir separator is '.'. It works properly, too).

Because I'm not sure what author's idea, please confirm this and if I'm right, please let me know.

Thanks.
diff -uNr libtinymail-0.0.9.orig/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c libtinymail-0.0.9/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
--- libtinymail-0.0.9.orig/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c	2008-04-18 18:48:22.000000000 +0900
+++ libtinymail-0.0.9/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c	2008-12-03 10:00:00.000000000 +0900
@@ -2009,6 +2009,8 @@
 
 	if (!store->dir_sep)
 		store->dir_sep = '/';	/* Guess */
+	if (!ns->sep)
+		ns->sep = '/';
 
 	if (!store->namespace)
 		store->namespace = g_strdup ("");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]