so ignore them. */
*ns_r = mail_namespace_find_inbox(user->namespaces);
*box_r = mailbox_alloc((*ns_r)->list, "INBOX",
- MAILBOX_FLAG_IGNORE_ACLS);
+ MAILBOX_FLAG_IGNORE_ACLS |
+ MAILBOX_FLAG_ATTRIBUTE_SESSION);
mctx->key = t_strconcat(MAILBOX_ATTRIBUTE_PREFIX_DOVECOT_PVT_SERVER,
mctx->key, NULL);
} else {
/* mailbox attributes */
*ns_r = mail_namespace_find(user->namespaces, mctx->mailbox);
- *box_r = mailbox_alloc((*ns_r)->list, mctx->mailbox, 0);
+ *box_r = mailbox_alloc((*ns_r)->list, mctx->mailbox,
+ MAILBOX_FLAG_ATTRIBUTE_SESSION);
}
mailbox_set_reason(*box_r, mctx->ctx.cmd->name);
mailbox_equals(client->mailbox, ns, mailbox))
ctx->box = client->mailbox;
else {
- ctx->box = mailbox_alloc(ns->list, mailbox, 0);
+ ctx->box = mailbox_alloc(ns->list, mailbox,
+ MAILBOX_FLAG_ATTRIBUTE_SESSION);
mailbox_set_reason(ctx->box, "SETMETADATA");
if (mailbox_open(ctx->box) < 0) {
client_send_box_error(cmd, ctx->box);
ns = mail_namespace_find_inbox(user->namespaces);
/* Server metadata shouldn't depend on INBOX's ACLs, so ignore them. */
- box = mailbox_alloc(ns->list, "INBOX", MAILBOX_FLAG_IGNORE_ACLS);
+ box = mailbox_alloc(ns->list, "INBOX", MAILBOX_FLAG_IGNORE_ACLS |
+ MAILBOX_FLAG_ATTRIBUTE_SESSION);
mailbox_set_reason(box, "Server METADATA");
imtrans = imap_metadata_transaction_begin(box);
imtrans->server = TRUE;
/* Interpret name argument for mailbox_alloc_for_user() as a SPECIAL-USE
flag. */
MAILBOX_FLAG_SPECIAL_USE = 0x8000,
+ /* Mailbox is opened for reading/writing attributes. This allows ACL
+ plugin to determine correctly whether the mailbox should be allowed
+ to be opened. */
+ MAILBOX_FLAG_ATTRIBUTE_SESSION = 0x10000,
};
enum mailbox_feature {