dovecot-1.2: lazy-expunge: Drop \Deleted flag when moving message.

dovecot at dovecot.org dovecot at dovecot.org
Mon Jul 27 03:01:49 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/45b110c8da62
changeset: 9253:45b110c8da62
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jul 26 20:01:44 2009 -0400
description:
lazy-expunge: Drop \Deleted flag when moving message.

diffstat:

1 file changed, 16 insertions(+), 2 deletions(-)
src/plugins/lazy-expunge/lazy-expunge-plugin.c |   18 ++++++++++++++++--

diffs (31 lines):

diff -r 88d4e83fcea5 -r 45b110c8da62 src/plugins/lazy-expunge/lazy-expunge-plugin.c
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Sun Jul 26 19:51:37 2009 -0400
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Sun Jul 26 20:01:44 2009 -0400
@@ -150,11 +150,25 @@ static int lazy_expunge_move(struct mail
 			     const char *path, void *context)
 {
 	struct lazy_expunge_move_context *ctx = context;
-	const char *p;
+	const char *p, *p2;
 
 	str_truncate(ctx->path, ctx->dir_len);
 	p = strrchr(path, '/');
-	str_append(ctx->path, p == NULL ? path : p + 1);
+	if (p == NULL)
+		p = path;
+	else
+		p++;
+
+	/* drop \Deleted flag */
+	p2 = strstr(p, MAILDIR_FLAGS_FULL_SEP);
+	if (p2 != NULL)
+		p2 = strchr(p2, 'T');
+	if (p2 == NULL)
+		str_append(ctx->path, p);
+	else {
+		str_append_n(ctx->path, p, p2 - p);
+		str_append(ctx->path, p2 + 1);
+	}
 
 	if (rename(path, str_c(ctx->path)) == 0)
 		return 1;


More information about the dovecot-cvs mailing list