dovecot-2.2: lazy_expunge: Allow expunging from lazy_expunge nam...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jan 5 01:14:36 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/fc521e6378d5
changeset: 15576:fc521e6378d5
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jan 05 00:12:54 2013 +0200
description:
lazy_expunge: Allow expunging from lazy_expunge namespace via virtual mailbox.
(Instead of copying the message all over again to the lazy_expunge
namespace.)

diffstat:

 src/plugins/lazy-expunge/lazy-expunge-plugin.c |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r c91d142130be -r fc521e6378d5 src/plugins/lazy-expunge/lazy-expunge-plugin.c
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Fri Jan 04 23:59:42 2013 +0200
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Sat Jan 05 00:12:54 2013 +0200
@@ -121,9 +121,20 @@
 	union mail_module_context *mmail = LAZY_EXPUNGE_MAIL_CONTEXT(mail);
 	struct lazy_expunge_transaction *lt =
 		LAZY_EXPUNGE_CONTEXT(_mail->transaction);
+	struct lazy_expunge_mailbox_list *llist;
+	struct mailbox *real_box;
 	struct mail_save_context *save_ctx;
 	const char *error;
 
+	/* don't copy the mail if we're expunging from lazy_expunge
+	   namespace (even if it's via a virtual mailbox) */
+	real_box = mail_get_real_mail(_mail)->box;
+	llist = LAZY_EXPUNGE_LIST_CONTEXT(real_box->list);
+	if (llist != NULL && llist->internal_namespace) {
+		mmail->super.expunge(_mail);
+		return;
+	}
+
 	if (lt->dest_box == NULL) {
 		lt->dest_box = mailbox_open_or_create(luser->lazy_ns->list,
 						      _mail->box, &error);


More information about the dovecot-cvs mailing list