[dovecot-cvs] dovecot/src/imap cmd-delete.c, 1.8, 1.9 cmd-subscribe.c, 1.11, 1.12 common.h, 1.21, 1.22 main.c, 1.63, 1.64

cras at dovecot.org cras at dovecot.org
Fri Jul 22 17:20:47 EEST 2005


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv27782/src/imap

Modified Files:
	cmd-delete.c cmd-subscribe.c common.h main.c 
Log Message:
Added tb-extra-mailbox-sep IMAP workaround.



Index: cmd-delete.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-delete.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cmd-delete.c	5 Feb 2005 18:07:26 -0000	1.8
+++ cmd-delete.c	22 Jul 2005 14:20:44 -0000	1.9
@@ -34,6 +34,13 @@
 			return TRUE;
 	}
 
+	if ((client_workarounds & WORKAROUND_TB_EXTRA_MAILBOX_SEP) != 0 &&
+	    *name != '\0' &&
+	    name[strlen(name)-1] == mail_storage_get_hierarchy_sep(storage)) {
+		/* drop the extra trailing hierarchy separator */
+		name = t_strndup(name, strlen(name)-1);
+	}
+
 	if (mail_storage_mailbox_delete(storage, name) < 0)
 		client_send_storage_error(cmd, storage);
 	else

Index: cmd-subscribe.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-subscribe.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cmd-subscribe.c	5 Feb 2005 18:07:26 -0000	1.11
+++ cmd-subscribe.c	22 Jul 2005 14:20:44 -0000	1.12
@@ -12,6 +12,18 @@
 	if (!client_read_string_args(cmd, 1, &mailbox))
 		return FALSE;
 
+	if ((client_workarounds & WORKAROUND_TB_EXTRA_MAILBOX_SEP) != 0) {
+		storage = client_find_storage(cmd, &mailbox);
+		if (storage == NULL)
+			return TRUE;
+
+		if (*mailbox != '\0' && mailbox[strlen(mailbox)-1] ==
+		    mail_storage_get_hierarchy_sep(storage)) {
+			/* drop the extra trailing hierarchy separator */
+			mailbox = t_strndup(mailbox, strlen(mailbox)-1);
+		}
+	}
+
 	if (!client_verify_mailbox_name(cmd, mailbox, subscribe, FALSE))
 		return TRUE;
 

Index: common.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/common.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- common.h	2 Apr 2005 22:44:06 -0000	1.21
+++ common.h	22 Jul 2005 14:20:44 -0000	1.22
@@ -26,7 +26,8 @@
 enum client_workarounds {
 	WORKAROUND_DELAY_NEWMAIL		= 0x01,
 	WORKAROUND_OUTLOOK_IDLE			= 0x02,
-	WORKAROUND_NETSCAPE_EOH			= 0x04
+	WORKAROUND_NETSCAPE_EOH			= 0x04,
+	WORKAROUND_TB_EXTRA_MAILBOX_SEP		= 0x08
 };
 
 extern struct ioloop *ioloop;

Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/main.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- main.c	2 Apr 2005 22:44:06 -0000	1.63
+++ main.c	22 Jul 2005 14:20:44 -0000	1.64
@@ -32,6 +32,7 @@
 	{ "delay-newmail", WORKAROUND_DELAY_NEWMAIL },
 	{ "outlook-idle", WORKAROUND_OUTLOOK_IDLE },
 	{ "netscape-eoh", WORKAROUND_NETSCAPE_EOH },
+	{ "tb-extra-mailbox-sep", WORKAROUND_TB_EXTRA_MAILBOX_SEP },
 	{ NULL, 0 }
 };
 



More information about the dovecot-cvs mailing list