From 522951a21d41ac283273b523d8c52403459cc2d1 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 20 Feb 2017 14:50:39 +0200 Subject: [PATCH] lib-lda: Do not involve mail-deliver plugin unnecessarely If no mail delivery by LDA/LMTP is being done, do not hook into the process. Fixes signal 11 crash with lazy-expunge. --- src/lib-lda/mail-deliver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib-lda/mail-deliver.c b/src/lib-lda/mail-deliver.c index 1fb070fc3f..cac630f8ce 100644 --- a/src/lib-lda/mail-deliver.c +++ b/src/lib-lda/mail-deliver.c @@ -599,6 +599,13 @@ static void mail_deliver_mailbox_allocated(struct mailbox *box) { struct mailbox_vfuncs *v = box->vlast; union mailbox_module_context *mbox; + struct mail_deliver_user *muser = + MAIL_DELIVER_USER_CONTEXT(box->storage->user); + + /* we are doing something other than lda/lmtp delivery + and should not be involved */ + if (muser->deliver_ctx == NULL) + return; mbox = p_new(box->pool, union mailbox_module_context, 1); mbox->super = *v;