]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lda: Do not involve mail-deliver plugin unnecessarely
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 20 Feb 2017 12:50:39 +0000 (14:50 +0200)
committerGitLab <gitlab@git.dovecot.net>
Mon, 20 Feb 2017 13:01:07 +0000 (15:01 +0200)
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

index 96b5c79b726e1357c8be34797c14c4c8491510b8..bb47c4d23c0e1c9c1e17ec978c0327a7ba2d89f4 100644 (file)
@@ -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;