From: Aki Tuomi Date: Mon, 20 Feb 2017 12:50:39 +0000 (+0200) Subject: lib-lda: Do not involve mail-deliver plugin unnecessarely X-Git-Tag: 2.3.0.rc1~2043 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23070cb7c58e32af755dae0426493608a28a4209;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/lib-lda/mail-deliver.c b/src/lib-lda/mail-deliver.c index 96b5c79b72..bb47c4d23c 100644 --- a/src/lib-lda/mail-deliver.c +++ b/src/lib-lda/mail-deliver.c @@ -602,6 +602,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;