[dovecot-cvs] dovecot/src/plugins/lazy-expunge lazy-expunge-plugin.c, 1.3, 1.4

tss at dovecot.org tss at dovecot.org
Fri Jan 5 14:22:35 UTC 2007


Update of /var/lib/cvs/dovecot/src/plugins/lazy-expunge
In directory talvi:/tmp/cvs-serv8868

Modified Files:
	lazy-expunge-plugin.c 
Log Message:
If index/control dirs were different than the maildir, deleting mailboxes 
didn't move their contents correctly.


Index: lazy-expunge-plugin.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/lazy-expunge/lazy-expunge-plugin.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- lazy-expunge-plugin.c	17 Dec 2006 14:32:06 -0000	1.3
+++ lazy-expunge-plugin.c	5 Jan 2007 14:22:33 -0000	1.4
@@ -303,10 +303,17 @@
 
 	str_append(src_path, srcdir);
 	str_append(dest_path, destdir);
+	str_append_c(src_path, '/');
+	str_append_c(dest_path, '/');
 	src_dirlen = str_len(src_path);
 	dest_dirlen = str_len(dest_path);
 
 	while ((dp = readdir(dir)) != NULL) {
+		if (dp->d_name[0] == '.' &&
+		    (dp->d_name[1] == '\0' ||
+		     (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
+			continue;
+
 		str_truncate(src_path, src_dirlen);
 		str_append(src_path, dp->d_name);
 		str_truncate(dest_path, dest_dirlen);
@@ -369,13 +376,13 @@
 	if (strcmp(src2dir, srcdir) != 0) {
 		destdir = mail_storage_get_mailbox_control_dir(dest_storage,
 							       dest_name);
-		(void)dir_move_or_merge(src_storage, srcdir, destdir);
+		(void)dir_move_or_merge(src_storage, src2dir, destdir);
 	}
 	src3dir = mail_storage_get_mailbox_index_dir(src_storage, src_name);
 	if (strcmp(src3dir, srcdir) != 0 && strcmp(src3dir, src2dir) != 0) {
 		destdir = mail_storage_get_mailbox_index_dir(dest_storage,
 							     dest_name);
-		(void)dir_move_or_merge(src_storage, srcdir, destdir);
+		(void)dir_move_or_merge(src_storage, src3dir, destdir);
 	}
 	t_pop();
 



More information about the dovecot-cvs mailing list