From fef8823fc08fbf37334928db27bbdff5b1b4d158 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 11 Sep 2025 10:51:51 +0300 Subject: [PATCH] plugins/acl: doveadm acl - Fix crash if ACLs not enabled Ensure ACLs are actually enabled when opening mailbox. Fixes Panic: Module context acl_storage_module missing --- src/plugins/acl/doveadm-acl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/acl/doveadm-acl.c b/src/plugins/acl/doveadm-acl.c index a99aad722a..1c7ff5f4d0 100644 --- a/src/plugins/acl/doveadm-acl.c +++ b/src/plugins/acl/doveadm-acl.c @@ -49,6 +49,16 @@ cmd_acl_mailbox_open(struct doveadm_mail_cmd_context *ctx, mailbox_free(&box); return -1; } + + /* check that ACLs are enabled */ + struct acl_mailbox *abox = ACL_CONTEXT(box); + if (abox == NULL) { + e_error(box->event, "ACL not enabled for %s", user->username); + doveadm_mail_failed_error(ctx, MAIL_ERROR_NOTFOUND); + mailbox_free(&box); + return -1; + } + *box_r = box; return 0; } -- 2.47.3