From f2b491e4795ccab8da05d8e67f735131e8b2bcfe Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 5 Jan 2013 00:12:54 +0200 Subject: [PATCH] lazy_expunge: Allow expunging from lazy_expunge namespace via virtual mailbox. (Instead of copying the message all over again to the lazy_expunge namespace.) --- src/plugins/lazy-expunge/lazy-expunge-plugin.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/lazy-expunge/lazy-expunge-plugin.c b/src/plugins/lazy-expunge/lazy-expunge-plugin.c index 2cb02cd397..4cda2813d0 100644 --- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c @@ -121,9 +121,20 @@ static void lazy_expunge_mail_expunge(struct mail *_mail) 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); -- 2.47.3